src/Utility/Validate/Check.php
public static function getInstance(string $checkClass) : CheckInterface
    {
        $checkClass = $checkClass;

        if (!class_exists($checkClass)) {
            throw new RuntimeException("Check class [$checkClass] does not exist");
        }

        if (!in_array(static::$interface, array_keys(class_implements($checkClass)))) {
            throw new RuntimeException("Check class [$checkClass] does not implement [" . static::$interface . "]");
        }

        return new $checkClass();
    }
public static function getInstance(string $checkClass) : CheckInterface
    {
        $checkClass = $checkClass;

        if (!class_exists($checkClass)) {
            throw new RuntimeException("Check class [$checkClass] does not exist");
        }

        if (!in_array(static::$interface, array_keys(class_implements($checkClass)))) {
            throw new RuntimeException("Check class [$checkClass] does not implement [" . static::$interface . "]");
        }

        return new $checkClass();
    }
public static function getInstance ( string $ checkClass ) : CheckInterface { $ checkClass = $ checkClass ; if ( ! class_exists ( $ checkClass ) ) { throw new RuntimeException ( "Check class [$checkClass] does not exist" ) ; } if ( ! in_array ( static :: $ interface , array_keys ( class_implements ( $ checkClass ) ) ) ) { throw new RuntimeException ( "Check class [$checkClass] does not implement [" . static :: $ interface . "]" ) ; } return new $ checkClass ( ) ; }
Get an instance of a given check class

@throws \RuntimeException when class does not exist or is invalid
@param string $checkClass Name of the check class
@return \CsvMigrations\Utility\Validate\Check\CheckInterface
Get an instance of a given check class