Beispiel #1
0
 /**
  * @param Apist $resource
  *
  * @throws ParseException
  * @throws \InvalidArgumentException
  */
 public function load(Apist $resource)
 {
     $data = Yaml::parse($this->file);
     if (isset($data['baseUrl'])) {
         $resource->setBaseUrl($data['baseUrl']);
         unset($data['baseUrl']);
     }
     $this->blueprintParser->parse($data);
 }
Beispiel #2
0
 /**
  * @param Apist $resource
  */
 public function load(Apist $resource)
 {
     $data = Yaml::parse($this->file);
     if (isset($data['baseUrl'])) {
         $resource->setBaseUrl($data['baseUrl']);
         unset($data['baseUrl']);
     }
     foreach ($data as $method => $methodConfig) {
         if ($method[0] === '_') {
             # structure
             $this->structures[$method] = $methodConfig;
         } else {
             # method
             if (!isset($methodConfig['blueprint'])) {
                 $methodConfig['blueprint'] = null;
             }
             $methodConfig['blueprint'] = $this->parseBlueprint($methodConfig['blueprint']);
             $this->methods[$method] = $methodConfig;
         }
     }
 }