Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
47
vendor/doctrine/rst-parser/lib/References/Doc.php
vendored
Normal file
47
vendor/doctrine/rst-parser/lib/References/Doc.php
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\RST\References;
|
||||
|
||||
use Doctrine\RST\Environment;
|
||||
|
||||
final class Doc extends Reference
|
||||
{
|
||||
/** @var string */
|
||||
private $name;
|
||||
|
||||
/** @var Resolver */
|
||||
private $resolver;
|
||||
|
||||
/**
|
||||
* Used with "ref" - it means the dependencies added in found()
|
||||
* must be resolved to their final path later (they are not
|
||||
* already document names).
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $dependenciesMustBeResolved;
|
||||
|
||||
public function __construct(string $name = 'doc', bool $dependenciesMustBeResolved = false)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->resolver = new Resolver();
|
||||
$this->dependenciesMustBeResolved = $dependenciesMustBeResolved;
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function resolve(Environment $environment, string $data): ?ResolvedReference
|
||||
{
|
||||
return $this->resolver->resolve($environment, $data);
|
||||
}
|
||||
|
||||
public function found(Environment $environment, string $data): void
|
||||
{
|
||||
$environment->addDependency($data, $this->dependenciesMustBeResolved);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue