Example #1
0
 public function __construct(\SwaggerGen\Swagger\AbstractObject $parent, $definition, $description = null)
 {
     parent::__construct($parent);
     // Parse regex
     $match = array();
     $count = preg_match('/^([a-z]+)/i', $definition, $match);
     $format = strtolower($match[1]);
     if (isset(self::$classTypes[$format])) {
         $type = self::$classTypes[$format];
         $class = "SwaggerGen\\Swagger\\Type\\{$type}Type";
         $this->Type = new $class($this, $definition);
     } else {
         throw new \SwaggerGen\Exception('Type format not recognized: ' . $format);
     }
     $this->description = $description;
 }
 /**
  * @var string $definition
  */
 public function __construct(\SwaggerGen\Swagger\AbstractObject $parent, $definition)
 {
     parent::__construct($parent);
     $this->parseDefinition($definition);
 }