Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
69
vendor/doctrine/rst-parser/lib/Nodes/TocNode.php
vendored
Normal file
69
vendor/doctrine/rst-parser/lib/Nodes/TocNode.php
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\RST\Nodes;
|
||||
|
||||
use Doctrine\RST\Environment;
|
||||
|
||||
class TocNode extends Node
|
||||
{
|
||||
private const DEFAULT_DEPTH = 2;
|
||||
|
||||
/** @var Environment */
|
||||
protected $environment;
|
||||
|
||||
/** @var string[] */
|
||||
private $files;
|
||||
|
||||
/** @var string[] */
|
||||
private $options;
|
||||
|
||||
/**
|
||||
* @param string[] $files
|
||||
* @param string[] $options
|
||||
*/
|
||||
public function __construct(Environment $environment, array $files, array $options)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->files = $files;
|
||||
$this->environment = $environment;
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
public function getEnvironment(): Environment
|
||||
{
|
||||
return $this->environment;
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
public function getFiles(): array
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
public function getOptions(): array
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
public function getDepth(): int
|
||||
{
|
||||
if (isset($this->options['depth'])) {
|
||||
return (int) $this->options['depth'];
|
||||
}
|
||||
|
||||
if (isset($this->options['maxdepth'])) {
|
||||
return (int) $this->options['maxdepth'];
|
||||
}
|
||||
|
||||
return self::DEFAULT_DEPTH;
|
||||
}
|
||||
|
||||
public function isTitlesOnly(): bool
|
||||
{
|
||||
return isset($this->options['titlesonly']);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue