guessType() 공개 메소드

{@inheritDoc}
public guessType ( $object, $name, $classes )
예제 #1
0
 /**
  * Return a list of class guessed
  *
  * @param string $openApiSpec
  * @param string $name
  * @param string $namespace
  * @param string $directory
  *
  * @return Context
  */
 public function createContext($openApiSpec, $name, $namespace, $directory)
 {
     $schema = $this->serializer->deserialize(file_get_contents($openApiSpec), 'Joli\\Jane\\OpenApi\\Model\\OpenApi', 'json');
     $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);
 }
예제 #2
0
 /**
  * Return a list of class guessed
  *
  * @param string $openApiSpec
  * @param string $name
  * @param string $namespace
  * @param string $directory
  *
  * @return 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);
 }