Esempio n. 1
0
 /**
  * @param $blueprint
  *
  * @return array
  * @throws \InvalidArgumentException
  */
 protected function parseBlueprint($blueprint)
 {
     $callback = function (&$value) {
         if (is_string($value)) {
             $value = str_replace(':current', '*', $value);
         }
         if ($value[0] === ':') {
             # structure
             $structure = $this->getStructure($value);
             $value = $this->parseBlueprint($structure);
             return;
         }
         if (strpos($value, '|') === false) {
             return;
         }
         $parts = preg_split('/\\s?\\|\\s?/', $value);
         $selector = array_shift($parts);
         $value = ApistConf::select($selector);
         foreach ($parts as $part) {
             $this->addCallbackToFilter($value, $part);
         }
     };
     if (!is_array($blueprint)) {
         $callback($blueprint);
     } else {
         array_walk_recursive($blueprint, $callback);
     }
     return $blueprint;
 }
Esempio n. 2
0
 /**
  * Make http request
  *
  * @param array $arguments
  * @throws \GuzzleHttp\Exception\GuzzleException
  */
 protected function makeRequest(array $arguments = [])
 {
     $request = new Request($this->getMethod(), $this->url);
     $response = $this->guzzle->send($request, $arguments);
     $this->setResponse($response);
     $this->setContent((string) $response->getBody());
 }
Esempio n. 3
0
 public function non_array_blueprint()
 {
     return $this->get('/', ApistConf::select('.page_head .title'));
 }