CoreFiles by mySites.guru
CommandIsSuccessful.php43 lines, 1,057 bytes, from Joomla_5.4.11-Stable-Full_Package.zip
Raw History Compare with 5.4.10
md5
ba757d1d0a103868e8b86e607370715d
sha1
d5894f42b90a79c0745de1149673f03bd9e66cf5
sha256
84d332f5853f93fd8785ad2eb85189ec418d9e1b775e7e24a960a063f47aeee8
<?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\Tester\Constraint;

use PHPUnit\Framework\Constraint\Constraint;
use Symfony\Component\Console\Command\Command;

final class CommandIsSuccessful extends Constraint
{
    public function toString(): string
    {
        return 'is successful';
    }

    protected function matches($other): bool
    {
        return Command::SUCCESS === $other;
    }

    protected function failureDescription($other): string
    {
        return 'the command '.$this->toString();
    }

    protected function additionalFailureDescription($other): string
    {
        $mapping = [
            Command::FAILURE => 'Command failed.',
            Command::INVALID => 'Command was invalid.',
        ];

        return $mapping[$other] ?? \sprintf('Command returned exit status %d.', $other);
    }
}

The same content is in 73 releases, Joomla 5.4.0-rc1 to 6.3.0-alpha1. See them all, or every version of this file.