<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Metadata\Parser;
/**
* Attribute and annotation information is static within a single PHP process.
* It is therefore okay to use a Singleton registry here.
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class Registry
{
private static ?Parser $instance = null;
public static function parser(): Parser
{
return self::$instance ?? self::$instance = self::build();
}
private static function build(): Parser
{
return new CachingParser(
new ParserChain(
new AttributeParser,
new AnnotationParser,
),
);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Annotation | Folder | 0755 |
|
|
| AnnotationParser.php | File | 18.87 KB | 0644 |
|
| AttributeParser.php | File | 24.39 KB | 0644 |
|
| CachingParser.php | File | 2.46 KB | 0644 |
|
| Parser.php | File | 1.07 KB | 0644 |
|
| ParserChain.php | File | 2.18 KB | 0644 |
|
| Registry.php | File | 1.02 KB | 0644 |
|