src/DTO/TransferObject.php
private function throwUnlessCorrectSubclass($property, $value)
    {
        $typeUsedToBe = $this->getTypeUsedToBe($property);

        if ($typeUsedToBe === "object") {
            $classUsedToBe = $this->getClassUsedToBe($property);

            if (!is_subclass_of($value, $classUsedToBe)) {
                throw new Exception();
            }
        }
    }
private function throwUnlessCorrectSubclass($property, $value)
    {
        $typeUsedToBe = $this->getTypeUsedToBe($property);

        if ($typeUsedToBe === "object") {
            $classUsedToBe = $this->getClassUsedToBe($property);

            if (!is_subclass_of($value, $classUsedToBe)) {
                throw new Exception();
            }
        }
    }
private function throwUnlessCorrectSubclass ( $ property , $ value ) { $ typeUsedToBe = $ this -> getTypeUsedToBe ( $ property ) ; if ( $ typeUsedToBe === "object" ) { $ classUsedToBe = $ this -> getClassUsedToBe ( $ property ) ; if ( ! is_subclass_of ( $ value , $ classUsedToBe ) ) { throw new Exception ( ) ; } } }
Throw Unless Correct Subclass

@param $property
@param $value
@throws Exception
Throw Unless Correct Subclass