--TEST--
PHP 8.2 test.
--RULESET--
{
    "@PhpCsFixer": true,
    "@PHP82Migration": true
}
--REQUIREMENTS--
{"php": 80200}
--EXPECT--
<?php

// https://wiki.php.net/rfc/readonly_classes
final readonly class Foo
{
    public string $prop;
}

// https://wiki.php.net/rfc/fetch_property_in_const_expressions
enum A: string
{
    case B = 'B';
    public const C = [self::B->name => self::B->value];
    public const D = self::B?->value;
}

#[Attr(A::B->name)]
class E {}

// https://wiki.php.net/rfc/null-false-standalone-types
class FalseNull
{
    private false $a = false;
    private null $b = null;

    public function __construct(
        private false $falsy = false,
        private null $nully = null
    ) {}

    public function falsy(): false
    {
        return $this->falsy;
    }

    public function nully(): null
    {
        return $this->nully;
    }

    public function setAB(false $a, null $b): void
    {
        $this->a = $a;
        $this->b = $b;
    }
}

function falsyNull(null $n, false $f): ?false {}

array_filter([], fn (null $n) => null === $n);
array_filter([], fn (false $n) => false === $n);

// https://wiki.php.net/rfc/true-type
class TrueType
{
    private true $a = true;

    public function __construct(
        private true $havingABud = true
    ) {}

    public function havingABud(): true
    {
        return $this->havingABud;
    }

    public function setA(true $a): void
    {
        $this->a = $a;
    }
}

function truish(true $true): true
{
    return $true;
}

array_filter([], fn (true $n) => true === $n);

// https://wiki.php.net/rfc/constants_in_traits
trait WithConstants
{
    public const ONE = 'one';
    protected const TWO = 'two';
    private const THREE = 'three';
}

// https://wiki.php.net/rfc/dnf_types
function generateSlug(null|(HasId&HasTitle) $post)
{
    throw new Exception('not implemented');
}

--INPUT--
<?php

// https://wiki.php.net/rfc/readonly_classes
READONLY       final       class       Foo
{
    public string $prop;
}

// https://wiki.php.net/rfc/fetch_property_in_const_expressions
enum A: string
{
    case B = 'B';
    const C = [self::B -> name => self::B->value];
    const D = self::B ?-> value;
}

#[Attr(A::B -> name)]
class E
{
}

// https://wiki.php.net/rfc/null-false-standalone-types
class FalseNull {
    private FALSE $a = FALSE;
    private NULL $b = NULL;

    public function __construct(
        private FALSE $falsy = FALSE,
        private NULL $nully = NULL
    ) {
    }

    public   function   falsy()   :   FALSE
    {
        return $this -> falsy;
    }

    public   function   nully()   :   NULL
    {
        return $this -> nully;
    }

    public function setAB(FALSE $a, NULL $b): void
    {
        $this->a = $a;
        $this->b = $b;
    }
}

function   falsyNull   (NULL   $n,   FALSE   $f):   NULL|FALSE
{
}

array_filter([], fn     (NULL     $n)     =>     NULL     ===     $n);
array_filter([], fn     (FALSE     $n)     =>     FALSE     ===     $n);

// https://wiki.php.net/rfc/true-type
class TrueType {
    private TRUE $a = TRUE;

    public function __construct(
        private TRUE $havingABud = TRUE
    ) {
    }

    public   function   havingABud()   :   TRUE
    {
        return $this -> havingABud;
    }

    public function setA(TRUE $a): void
    {
        $this->a = $a;
    }
}

function truish   (TRUE   $true)   :   TRUE
{
    return   $true;
}

array_filter([], fn     (TRUE     $n)     =>     TRUE     ===     $n);

// https://wiki.php.net/rfc/constants_in_traits
trait      WithConstants      {
    public    const ONE   = 'one';
    protected const TWO   = 'two';
    private   const THREE = 'three';
}

// https://wiki.php.net/rfc/dnf_types
function generateSlug((HasTitle&HasId)|null $post)
{
    throw new \Exception('not implemented');
}
