AmqpCaster.php
2 years ago
ArgsStub.php
1 year ago
Caster.php
1 year ago
ClassStub.php
1 year ago
ConstStub.php
2 years ago
CutArrayStub.php
2 years ago
CutStub.php
1 year ago
DOMCaster.php
1 year ago
DateCaster.php
2 years ago
DoctrineCaster.php
2 years ago
DsCaster.php
2 years ago
DsPairStub.php
2 years ago
EnumStub.php
1 year ago
ExceptionCaster.php
1 year ago
FiberCaster.php
2 years ago
FrameStub.php
1 year ago
GmpCaster.php
2 years ago
ImagineCaster.php
2 years ago
ImgStub.php
2 years ago
IntlCaster.php
2 years ago
LinkStub.php
1 year ago
MemcachedCaster.php
2 years ago
MysqliCaster.php
2 years ago
PdoCaster.php
2 years ago
PgSqlCaster.php
1 year ago
ProxyManagerCaster.php
2 years ago
RdKafkaCaster.php
1 year ago
RedisCaster.php
2 years ago
ReflectionCaster.php
1 year ago
ResourceCaster.php
1 year ago
SplCaster.php
1 year ago
StubCaster.php
2 years ago
SymfonyCaster.php
2 years ago
TraceStub.php
1 year ago
UuidCaster.php
2 years ago
XmlReaderCaster.php
1 year ago
XmlResourceCaster.php
2 years ago
FiberCaster.php
39 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace Matomo\Dependencies\Symfony\Component\VarDumper\Caster; |
| 12 | |
| 13 | use Matomo\Dependencies\Symfony\Component\VarDumper\Cloner\Stub; |
| 14 | /** |
| 15 | * Casts Fiber related classes to array representation. |
| 16 | * |
| 17 | * @author Grégoire Pineau <lyrixx@lyrixx.info> |
| 18 | */ |
| 19 | final class FiberCaster |
| 20 | { |
| 21 | public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0) |
| 22 | { |
| 23 | $prefix = Caster::PREFIX_VIRTUAL; |
| 24 | if ($fiber->isTerminated()) { |
| 25 | $status = 'terminated'; |
| 26 | } elseif ($fiber->isRunning()) { |
| 27 | $status = 'running'; |
| 28 | } elseif ($fiber->isSuspended()) { |
| 29 | $status = 'suspended'; |
| 30 | } elseif ($fiber->isStarted()) { |
| 31 | $status = 'started'; |
| 32 | } else { |
| 33 | $status = 'not started'; |
| 34 | } |
| 35 | $a[$prefix . 'status'] = $status; |
| 36 | return $a; |
| 37 | } |
| 38 | } |
| 39 |