, * Pádraic Brady * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return [ 'meta' => [ 'title' => 'Self, static and parent keywords on constants', // Default values. If not specified will be the one used 'prefix' => 'Humbug', 'whitelist' => [], 'whitelist-global-constants' => true, 'whitelist-global-classes' => false, 'whitelist-global-functions' => true, 'registered-classes' => [], 'registered-functions' => [], ], 'Usage for classes in the global scope' => <<<'PHP' name = $name; } public static function test() { self::FOO; static::FOO; } public function getName(): string { return $this->name; } } class B extends A { const FOO = 'BAR'; public function __construct(string $name) { parent::__construct($name); parent::FOO; } } B::test(); echo (new B('yo'))->getName().PHP_EOL; ---- name = $name; } public static function test() { self::FOO; static::FOO; } public function getName() : string { return $this->name; } } class B extends \Humbug\A { const FOO = 'BAR'; public function __construct(string $name) { parent::__construct($name); parent::FOO; } } \Humbug\B::test(); echo (new \Humbug\B('yo'))->getName() . \PHP_EOL; PHP , 'Usage for classes in a namespaced' => <<<'PHP' name = $name; } public static function test() { self::FOO; static::FOO; } public function getName(): string { return $this->name; } } class B extends A { const FOO = 'BAR'; public function __construct(string $name) { parent::__construct($name); parent::FOO; } } } namespace { use Foo\B; B::test(); echo (new B('yo'))->getName().PHP_EOL; } ---- name = $name; } public static function test() { self::FOO; static::FOO; } public function getName() : string { return $this->name; } } class B extends \Humbug\Foo\A { const FOO = 'BAR'; public function __construct(string $name) { parent::__construct($name); parent::FOO; } } namespace Humbug; use Humbug\Foo\B; \Humbug\Foo\B::test(); echo (new \Humbug\Foo\B('yo'))->getName() . \PHP_EOL; PHP , ];