protected function build($config, array $options)
 {
     if (!empty($config['operations'])) {
         foreach ($config['operations'] as &$operation) {
             $operation['parameters']['api_key'] = array('description' => 'Billomat API key', 'location' => 'header', 'type' => 'string', 'sentAs' => 'X-BillomatApiKey', 'required' => true);
         }
     }
     return parent::build($config, $options);
 }
 /**
  * {@inheritdoc}
  */
 protected function resolveExtension($name, array &$op, array &$operations)
 {
     // parent method handles "parameters" property
     parent::resolveExtension($name, $op, $operations);
     $resolved = array();
     $original = empty($op['data']) ? false : $op['data'];
     foreach ((array) $op['extends'] as $extendedCommand) {
         $toArray = $operations[$extendedCommand];
         $toArray['data'] = isset($toArray['data']) ? $toArray['data'] : array();
         $resolved = empty($resolved) ? $toArray['data'] : array_merge($resolved, $toArray['data']);
         $op = $op + $toArray;
     }
     $op['data'] = $original ? array_merge_recursive($resolved, $original) : $resolved;
 }
Example #3
0
 /**
  * Adds the correct service description to a client
  *
  * @param Desk\Client $client The client to add the description to
  */
 public function addServiceDescription(Client &$client)
 {
     $description = $this->loader->load(Client::getDescriptionFilename());
     $client->setDescription($description);
 }
 /**
  * {@inheritdoc}
  *
  * Overridden to sort the $config array based on dependencies
  */
 protected function build($config, array $options)
 {
     return parent::build($this->sortConfig($config), $options);
 }