protected function checkSpecificObject(array $acceptedTypes, $value)
    {
        if (is_object($value)) {
            foreach ($acceptedTypes as $type) {
                $c = get_class($value);
                if ($c == ltrim($type, '\\') || is_subclass_of($c, $type)) {
                    return $value;
                }
            }
        }

        return null;
    }
protected function checkSpecificObject(array $acceptedTypes, $value)
    {
        if (is_object($value)) {
            foreach ($acceptedTypes as $type) {
                $c = get_class($value);
                if ($c == ltrim($type, '\\') || is_subclass_of($c, $type)) {
                    return $value;
                }
            }
        }

        return null;
    }
protected function checkSpecificObject ( array $ acceptedTypes , $ value ) { if ( is_object ( $ value ) ) { foreach ( $ acceptedTypes as $ type ) { $ c = get_class ( $ value ) ; if ( $ c == ltrim ( $ type , '\\' ) || is_subclass_of ( $ c , $ type ) ) { return $ value ; } } } return null ; }
Will check to see if the value is an object and its class is listed in
the accepted types.

@param  array $acceptedTypes Accepted types.
@param  mixed $value Value to test.
@return null|object
Will check to see if the value is an object and its class is listed in the accepted types .