src/Utilities/Reflection.php
public static function getOneChildClass($parentClass)
    {
        $childClasses = self::getChildClasses($parentClass);

        /*
         * No child classes?
         * Oops, the base / parent class hasn't child class
         */
        if (empty($childClasses)) {
            throw MissingChildClassesException::create($parentClass);
        }

        /*
         * More than 1 child class?
         * Oops, the base / parent class has too many child classes
         */
        if (count($childClasses) > 1) {
            throw TooManyChildClassesException::create($parentClass, $childClasses);
        }

        return trim($childClasses[0]);
    }
public static function getOneChildClass($parentClass)
    {
        $childClasses = self::getChildClasses($parentClass);

        /*
         * No child classes?
         * Oops, the base / parent class hasn't child class
         */
        if (empty($childClasses)) {
            throw MissingChildClassesException::create($parentClass);
        }

        /*
         * More than 1 child class?
         * Oops, the base / parent class has too many child classes
         */
        if (count($childClasses) > 1) {
            throw TooManyChildClassesException::create($parentClass, $childClasses);
        }

        return trim($childClasses[0]);
    }
public static function getOneChildClass ( $ parentClass ) { $ childClasses = self :: getChildClasses ( $ parentClass ) ; /*
         * No child classes?
         * Oops, the base / parent class hasn't child class
         */ if ( empty ( $ childClasses ) ) { throw MissingChildClassesException :: create ( $ parentClass ) ; } /*
         * More than 1 child class?
         * Oops, the base / parent class has too many child classes
         */ if ( count ( $ childClasses ) > 1 ) { throw TooManyChildClassesException :: create ( $ parentClass , $ childClasses ) ; } return trim ( $ childClasses [ 0 ] ) ; }
Returns namespace of one child class which extends given class.
Extended class should has only one child class.

@param array|object|string $parentClass Class who child class should be returned. An array of objects,
namespaces, object or namespace.
@throws MissingChildClassesException
@throws TooManyChildClassesException
@return mixed
Returns namespace of one child class which extends given class . Extended class should has only one child class .