CoreFiles by mySites.guru
FiberCaster.php43 lines, 1,062 bytes, from Joomla_4.3.2-Stable-Full_Package.zip
Raw History Compare with 4.3.1
md5
abc8ee7a578e7830258b4e84c3766c88
sha1
f316b70ea305297454841eaf23327d40a13c5b7c
sha256
5e0b6928c2da8244c25831b3154f2e7cb506c14bf9977d172bc7594c085343b3
<?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\VarDumper\Caster;

use Symfony\Component\VarDumper\Cloner\Stub;

/**
 * Casts Fiber related classes to array representation.
 *
 * @author GrĂ©goire Pineau <[email protected]>
 */
final class FiberCaster
{
    public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0)
    {
        $prefix = Caster::PREFIX_VIRTUAL;

        if ($fiber->isTerminated()) {
            $status = 'terminated';
        } elseif ($fiber->isRunning()) {
            $status = 'running';
        } elseif ($fiber->isSuspended()) {
            $status = 'suspended';
        } elseif ($fiber->isStarted()) {
            $status = 'started';
        } else {
            $status = 'not started';
        }

        $a[$prefix.'status'] = $status;

        return $a;
    }
}

The same content is in 98 releases, Joomla 4.1.0-beta3 to 5.0.0-alpha1. See them all, or every version of this file.