Joli\Jane\Guesser\JsonSchema\AllOfGuesser::guessType PHP Method

guessType() public method

public guessType ( $object, $name, $classes )
    public function guessType($object, $name, $classes)
    {
        $type = null;
        foreach ($object->getAllOf() as $allOf) {
            $allOfSchema = $allOf;
            if ($allOfSchema instanceof Reference) {
                $allOfSchema = $this->resolver->resolve($allOf);
            }
            if (null !== $allOfSchema->getType()) {
                if (null !== $type) {
                    throw new \RuntimeException('an allOf instruction with 2 or more types is strictly impossible, check your schema');
                }
                $type = $this->chainGuesser->guessType($allOf, $name, $classes);
            }
        }
        if ($type === null) {
            return new Type($object, 'mixed');
        }
        return $type;
    }