- md5
- 3e2749b5065e9385a4abbf04ef74428a
- sha1
- 609b9929507aa5b53ac59c5a051a146b33500b2d
- sha256
- fe47a9a22ce4e1a3cac05c663b645adad2ecbd8068049a0726394340185d4107
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Helper;
/**
* Configures the output of the Tree helper.
*
* @author Simon André <[email protected]>
*/
final class TreeStyle
{
public function __construct(
private readonly string $prefixEndHasNext,
private readonly string $prefixEndLast,
private readonly string $prefixLeft,
private readonly string $prefixMidHasNext,
private readonly string $prefixMidLast,
private readonly string $prefixRight,
) {
}
public static function box(): self
{
return new self('┃╸ ', '┗╸ ', '', '┃ ', ' ', '');
}
public static function boxDouble(): self
{
return new self('╠═ ', '╚═ ', '', '║ ', ' ', '');
}
public static function compact(): self
{
return new self('├ ', '└ ', '', '│ ', ' ', '');
}
public static function default(): self
{
return new self('├── ', '└── ', '', '│ ', ' ', '');
}
public static function light(): self
{
return new self('|-- ', '`-- ', '', '| ', ' ', '');
}
public static function minimal(): self
{
return new self('. ', '. ', '', '. ', ' ', '');
}
public static function rounded(): self
{
return new self('├─ ', '╰─ ', '', '│ ', ' ', '');
}
/**
* @internal
*/
public function applyPrefixes(\RecursiveTreeIterator $iterator): void
{
$iterator->setPrefixPart(\RecursiveTreeIterator::PREFIX_LEFT, $this->prefixLeft);
$iterator->setPrefixPart(\RecursiveTreeIterator::PREFIX_MID_HAS_NEXT, $this->prefixMidHasNext);
$iterator->setPrefixPart(\RecursiveTreeIterator::PREFIX_MID_LAST, $this->prefixMidLast);
$iterator->setPrefixPart(\RecursiveTreeIterator::PREFIX_END_HAS_NEXT, $this->prefixEndHasNext);
$iterator->setPrefixPart(\RecursiveTreeIterator::PREFIX_END_LAST, $this->prefixEndLast);
$iterator->setPrefixPart(\RecursiveTreeIterator::PREFIX_RIGHT, $this->prefixRight);
}
}
The same content is in 48 releases, Joomla 6.0.0-beta1 to 6.2.1. See them all, or every version of this file.