File "ConstructorPromotion.php"

Full Path: /var/www/html/back/vendor/phpdocumentor/reflection/tests/integration/data/PHP8/ConstructorPromotion.php
File size: 722 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

declare(strict_types=1);

namespace PHP8;

use DateTimeImmutable;

class ConstructorPromotion
{
    private const DEFAULT_VALUE = 'default';

    /**
     * Constructor with promoted properties
     *
     * @param string $name my docblock name
     */
    public function __construct(
        /**
         * Summary
         *
         * Description
         *
         * @var string $name property description
         */
        public string $name = 'default name',
        protected Email $email = new Email(),
        private DateTimeImmutable $birth_date,
        private DateTimeImmutable $created_at = new DateTimeImmutable('now'),
        private array $uses_constants = [self::DEFAULT_VALUE],
    ) {}
}