Joli\Jane\OpenApi\JaneOpenApi::createContext PHP Method

createContext() public method

Return a list of class guessed
public createContext ( string $openApiSpec, string $name, string $namespace, string $directory ) : Joli\Jane\Generator\Context\Context
$openApiSpec string
$name string
$namespace string
$directory string
return Joli\Jane\Generator\Context\Context
    public function createContext($openApiSpec, $name, $namespace, $directory)
    {
        $schema = $this->schemaParser->parseSchema($openApiSpec);
        $classes = $this->chainGuesser->guessClass($schema, $name);
        foreach ($classes as $class) {
            $properties = $this->chainGuesser->guessProperties($class->getObject(), $name, $classes);
            foreach ($properties as $property) {
                $property->setType($this->chainGuesser->guessType($property->getObject(), $property->getName(), $classes));
            }
            $class->setProperties($properties);
        }
        return new Context($schema, $namespace, $directory, $classes);
    }