icanhazstring/systemctl-php

View on GitHub
src/Exception/UnitNotFoundException.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace icanhazstring\SystemCtl\Exception;

use RuntimeException;

/**
 * Class UnitNotFoundException
 *
 * @package icanhazstring\SystemCtl\Exception
 */
class UnitNotFoundException extends RuntimeException implements ExceptionInterface
{
    /**
     * @param string $type
     * @param string $name
     *
     * @return UnitNotFoundException
     */
    public static function create(string $type, string $name): self
    {
        return new self(
            sprintf('Could not find %s "%s"', ucfirst($type), $name)
        );
    }
}