Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if a value exists in an array
<?php in_array(mixed $needle, array $haystack, bool $strict = false): bool
<?php     

    public function isInEuropeanUnion(): bool

    {

        return in_array($this, self::europeanUnionCountries());

    }



    public static function europeanUnionCountries(): array
<?php     public function isVatClassification(): bool

    {

        return in_array($this, self::vatClassifications());

    }
<?php     public function isRetail(): bool

    {

        return in_array($this, [

            self::TYPE_11_1,

            self::TYPE_11_2,

            self::TYPE_11_3,

            self::TYPE_11_4,

            self::TYPE_11_5,

        ]);

    }



    public function hasCounterpart(): bool
<?php     public function hasCounterpart(): bool

    {

        return !in_array($this, [

            self::TYPE_11_1,

            self::TYPE_11_2,

            self::TYPE_11_3,

            self::TYPE_11_4,

            self::TYPE_11_5,

            self::TYPE_13_1,

            self::TYPE_13_2,

            self::TYPE_13_3,

            self::TYPE_13_4,

            self::TYPE_13_30,

            self::TYPE_13_31,

        ]);

    }



    public function supportsFuelInvoice(): bool
<?php     public function supportsFuelInvoice(): bool

    {

        return in_array($this, [

            self::TYPE_1_1,

            self::TYPE_1_2,

            self::TYPE_1_3,

            self::TYPE_1_4,

            self::TYPE_1_5,

            self::TYPE_1_6,

            self::TYPE_3_1,

            self::TYPE_3_2,

            self::TYPE_5_1,

            self::TYPE_5_2,

            self::TYPE_6_1,

            self::TYPE_11_1,

            self::TYPE_11_3,

            self::TYPE_11_4,

            self::TYPE_11_5,

        ]);

    }



    public function supportsDeliveryNote(): bool
<?php     public function supportsDeliveryNote(): bool

    {

        return in_array($this, [

            self::TYPE_1_1,

            self::TYPE_1_2,

            self::TYPE_1_3,

            self::TYPE_1_6,

            self::TYPE_5_1,

            self::TYPE_5_2,

            self::TYPE_11_1,

        ]);

    }



    public function supportsSelfPricing(): bool
<?php     public function supportsSelfPricing(): bool

    {

        return in_array($this, [

            self::TYPE_1_1,

            self::TYPE_1_4,

            self::TYPE_1_5,

            self::TYPE_1_6,

            self::TYPE_2_1,

            self::TYPE_2_4,

            self::TYPE_5_1,

            self::TYPE_5_2,

        ]);

    }



    public function supportsTaxFree(): bool
<?php     public function supportsTaxFree(): bool

    {

        return in_array($this, [

            self::TYPE_11_1,

            self::TYPE_11_4,

            self::TYPE_11_5,

        ]);

    }



    public function label(): string
<?php     public function affectsTotalGrossValue(): bool

    {

        return !in_array($this, [

            self::TAX_8,

            self::TAX_9,

            self::TAX_10,

        ]);

    }

}
<?php     public function set($key, $value): static

    {

        if (in_array($key, ['correlatedInvoices', 'otherCorrelatedEntities', 'multipleConnectedMarks']) && !is_array($value)) {

            return $this->push($key, $value);

        }
<?php     public function contains(mixed $value): bool

    {

        if ($value === null) {

            return empty($this->classifications) || in_array($value, $this->classifications, true);

        }



        if ($value instanceof BackedEnum) {
<?php             $value = $value->value;

        }



        return in_array($value, $this->classifications, true);

    }