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

        if ($typeUsedToBe !== "null") {
            $typeWantsToBe = $this->getTypeWantsToBe($value);

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

        if ($typeUsedToBe !== "null") {
            $typeWantsToBe = $this->getTypeWantsToBe($value);

            if ($typeUsedToBe !== $typeWantsToBe) {
                throw new Exception();
            }
        }
    }
private function throwUnlessCorrectType ( $ property , $ value ) { $ typeUsedToBe = $ this -> getTypeUsedToBe ( $ property ) ; if ( $ typeUsedToBe !== "null" ) { $ typeWantsToBe = $ this -> getTypeWantsToBe ( $ value ) ; if ( $ typeUsedToBe !== $ typeWantsToBe ) { throw new Exception ( ) ; } } }
Throw Unless Correct Type

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