public function generate(string $file_path){
		$namespace_name = $this->namespaceModel();

		$api = Yaml::parseFile($file_path);

		$namespace = new PhpNamespace($namespace_name);

		foreach ($api['definitions'] as $class_name => $class_details){

			$class = new ClassType($class_name, $namespace);
			$class->setExtends("$namespace_name\\".self::MODEL_CLASS_NAME);
			$class->addComment("** This file was generated automatically, you might want to avoid editing it **");

			if (!empty($class_details['description'])){
				$class->addComment("\n".$class_details['description']);
			}

			if (isset($class_details['allOf'])){
				$parent_class_name = $this->typeFromRef($class_details['allOf'][0]);
				$class->setExtends("$namespace_name\\$parent_class_name");
				$properties = $class_details['allOf'][1]['properties'];
			}
			else {
				$properties = $class_details['properties'];
			}

			$this->classProperties($properties, $class);

			$this->classes[$class_name] = $class;
		}
	}
public function generate(string $file_path){
		$namespace_name = $this->namespaceModel();

		$api = Yaml::parseFile($file_path);

		$namespace = new PhpNamespace($namespace_name);

		foreach ($api['definitions'] as $class_name => $class_details){

			$class = new ClassType($class_name, $namespace);
			$class->setExtends("$namespace_name\\".self::MODEL_CLASS_NAME);
			$class->addComment("** This file was generated automatically, you might want to avoid editing it **");

			if (!empty($class_details['description'])){
				$class->addComment("\n".$class_details['description']);
			}

			if (isset($class_details['allOf'])){
				$parent_class_name = $this->typeFromRef($class_details['allOf'][0]);
				$class->setExtends("$namespace_name\\$parent_class_name");
				$properties = $class_details['allOf'][1]['properties'];
			}
			else {
				$properties = $class_details['properties'];
			}

			$this->classProperties($properties, $class);

			$this->classes[$class_name] = $class;
		}
	}
public function generate ( string $ file_path ) { $ namespace_name = $ this -> namespaceModel ( ) ; $ api = Yaml :: parseFile ( $ file_path ) ; $ namespace = new PhpNamespace ( $ namespace_name ) ; foreach ( $ api [ 'definitions' ] as $ class_name => $ class_details ) { $ class = new ClassType ( $ class_name , $ namespace ) ; $ class -> setExtends ( "$namespace_name\\" . self :: MODEL_CLASS_NAME ) ; $ class -> addComment ( "** This file was generated automatically, you might want to avoid editing it **" ) ; if ( ! empty ( $ class_details [ 'description' ] ) ) { $ class -> addComment ( "\n" . $ class_details [ 'description' ] ) ; } if ( isset ( $ class_details [ 'allOf' ] ) ) { $ parent_class_name = $ this -> typeFromRef ( $ class_details [ 'allOf' ] [ 0 ] ) ; $ class -> setExtends ( "$namespace_name\\$parent_class_name" ) ; $ properties = $ class_details [ 'allOf' ] [ 1 ] [ 'properties' ] ; } else { $ properties = $ class_details [ 'properties' ] ; } $ this -> classProperties ( $ properties , $ class ) ; $ this -> classes [ $ class_name ] = $ class ; } }
Generates classes in the "classes" field

@param string $file_path
Generates classes in the classes field