protected function getRestrictedByGetClassResult(PhpType $type = null, $value, $resultEqualsValue)
 {
     if (null === $type) {
         if ($resultEqualsValue) {
             return $this->typeRegistry->getClassOrCreate($value);
         }
         return null;
     }
     return $type->visit(new RestrictByGetClassResultVisitor($this->typeRegistry, $value, $resultEqualsValue));
 }