src/Utils.php
public static function checkOverwriteRunMethod($child_class)
    {
        $parent_class = '\\Jenner\\SimpleFork\\Process';
        if ($child_class == $parent_class) {
            $message = "you should extend the `{$parent_class}`" .
                ' and overwrite the run method';
            throw new \RuntimeException($message);
        }

        $child = new \ReflectionClass($child_class);
        if ($child->getParentClass() === false) {
            $message = "you should extend the `{$parent_class}`" .
                ' and overwrite the run method';
            throw new \RuntimeException($message);
        }

        $parent_methods = $child->getParentClass()->getMethods(\ReflectionMethod::IS_PUBLIC);

        foreach ($parent_methods as $parent_method) {
            if ($parent_method->getName() !== 'run') continue;

            $declaring_class = $child->getMethod($parent_method->getName())
                ->getDeclaringClass()
                ->getName();

            if ($declaring_class === $parent_class) {
                throw new \RuntimeException('you must overwrite the run method');
            }
        }
    }
public static function checkOverwriteRunMethod($child_class)
    {
        $parent_class = '\\Jenner\\SimpleFork\\Process';
        if ($child_class == $parent_class) {
            $message = "you should extend the `{$parent_class}`" .
                ' and overwrite the run method';
            throw new \RuntimeException($message);
        }

        $child = new \ReflectionClass($child_class);
        if ($child->getParentClass() === false) {
            $message = "you should extend the `{$parent_class}`" .
                ' and overwrite the run method';
            throw new \RuntimeException($message);
        }

        $parent_methods = $child->getParentClass()->getMethods(\ReflectionMethod::IS_PUBLIC);

        foreach ($parent_methods as $parent_method) {
            if ($parent_method->getName() !== 'run') continue;

            $declaring_class = $child->getMethod($parent_method->getName())
                ->getDeclaringClass()
                ->getName();

            if ($declaring_class === $parent_class) {
                throw new \RuntimeException('you must overwrite the run method');
            }
        }
    }
public static function checkOverwriteRunMethod ( $ child_class ) { $ parent_class = '\\Jenner\\SimpleFork\\Process' ; if ( $ child_class == $ parent_class ) { $ message = "you should extend the `{$parent_class}`" . ' and overwrite the run method' ; throw new \ RuntimeException ( $ message ) ; } $ child = new \ ReflectionClass ( $ child_class ) ; if ( $ child -> getParentClass ( ) === false ) { $ message = "you should extend the `{$parent_class}`" . ' and overwrite the run method' ; throw new \ RuntimeException ( $ message ) ; } $ parent_methods = $ child -> getParentClass ( ) -> getMethods ( \ ReflectionMethod :: IS_PUBLIC ) ; foreach ( $ parent_methods as $ parent_method ) { if ( $ parent_method -> getName ( ) !== 'run' ) continue ; $ declaring_class = $ child -> getMethod ( $ parent_method -> getName ( ) ) -> getDeclaringClass ( ) -> getName ( ) ; if ( $ declaring_class === $ parent_class ) { throw new \ RuntimeException ( 'you must overwrite the run method' ) ; } } }
check if the sub class of Process has overwrite the run method

@param $child_class
check if the sub class of Process has overwrite the run method