protected function generateSampleOutput($st_params, $counter)
    {
        if (!isset($st_params['ApiReturn'])) {
            $responseBody = '';
        } else {
          $ret = [];
          $partial_template = $this->loadPartialTemplate('sampleReponseTpl');
          foreach ($st_params['ApiReturn'] as $params) {
              if (in_array($params['type'], array('object', 'array(object) ', 'array', 'string', 'boolean', 'integer', 'number')) && isset($params['sample'])) {
                  $tr = array(
                      '{{ elt_id }}'      => $counter,
                      '{{ response }}'    => $params['sample'],
                      '{{ description }}' => '',
                  );
                  if (isset($params['description'])) {
                      $tr['{{ description }}'] = $params['description'];
                  }
                  $ret[] = strtr($partial_template, $tr);
              }
          }

          $responseBody = implode(PHP_EOL, $ret);
        }

        if(!isset($st_params['ApiReturnHeaders'])) {
          $responseHeaders = '';
        } else {
          $ret = [];
          $partial_template = $this->loadPartialTemplate('sampleReponseHeaderTpl');

          foreach ($st_params['ApiReturnHeaders'] as $headers) {
            if(isset($headers['sample'])) {
              $tr = array(
                '{{ elt_id }}'      => $counter,
                '{{ response }}'    => $headers['sample'],
                '{{ description }}' => ''
              );

              $ret[] = strtr($partial_template, $tr);
            }
          }

          $responseHeaders = implode(PHP_EOL, $ret);
        }

        return array($responseHeaders, $responseBody);
    }
protected function generateSampleOutput($st_params, $counter)
    {
        if (!isset($st_params['ApiReturn'])) {
            $responseBody = '';
        } else {
          $ret = [];
          $partial_template = $this->loadPartialTemplate('sampleReponseTpl');
          foreach ($st_params['ApiReturn'] as $params) {
              if (in_array($params['type'], array('object', 'array(object) ', 'array', 'string', 'boolean', 'integer', 'number')) && isset($params['sample'])) {
                  $tr = array(
                      '{{ elt_id }}'      => $counter,
                      '{{ response }}'    => $params['sample'],
                      '{{ description }}' => '',
                  );
                  if (isset($params['description'])) {
                      $tr['{{ description }}'] = $params['description'];
                  }
                  $ret[] = strtr($partial_template, $tr);
              }
          }

          $responseBody = implode(PHP_EOL, $ret);
        }

        if(!isset($st_params['ApiReturnHeaders'])) {
          $responseHeaders = '';
        } else {
          $ret = [];
          $partial_template = $this->loadPartialTemplate('sampleReponseHeaderTpl');

          foreach ($st_params['ApiReturnHeaders'] as $headers) {
            if(isset($headers['sample'])) {
              $tr = array(
                '{{ elt_id }}'      => $counter,
                '{{ response }}'    => $headers['sample'],
                '{{ description }}' => ''
              );

              $ret[] = strtr($partial_template, $tr);
            }
          }

          $responseHeaders = implode(PHP_EOL, $ret);
        }

        return array($responseHeaders, $responseBody);
    }
protected function generateSampleOutput ( $ st_params , $ counter ) { if ( ! isset ( $ st_params [ 'ApiReturn' ] ) ) { $ responseBody = '' ; } else { $ ret = [ ] ; $ partial_template = $ this -> loadPartialTemplate ( 'sampleReponseTpl' ) ; foreach ( $ st_params [ 'ApiReturn' ] as $ params ) { if ( in_array ( $ params [ 'type' ] , array ( 'object' , 'array(object) ' , 'array' , 'string' , 'boolean' , 'integer' , 'number' ) ) && isset ( $ params [ 'sample' ] ) ) { $ tr = array ( '{{ elt_id }}' => $ counter , '{{ response }}' => $ params [ 'sample' ] , '{{ description }}' => '' , ) ; if ( isset ( $ params [ 'description' ] ) ) { $ tr [ '{{ description }}' ] = $ params [ 'description' ] ; } $ ret [ ] = strtr ( $ partial_template , $ tr ) ; } } $ responseBody = implode ( PHP_EOL , $ ret ) ; } if ( ! isset ( $ st_params [ 'ApiReturnHeaders' ] ) ) { $ responseHeaders = '' ; } else { $ ret = [ ] ; $ partial_template = $ this -> loadPartialTemplate ( 'sampleReponseHeaderTpl' ) ; foreach ( $ st_params [ 'ApiReturnHeaders' ] as $ headers ) { if ( isset ( $ headers [ 'sample' ] ) ) { $ tr = array ( '{{ elt_id }}' => $ counter , '{{ response }}' => $ headers [ 'sample' ] , '{{ description }}' => '' ) ; $ ret [ ] = strtr ( $ partial_template , $ tr ) ; } } $ responseHeaders = implode ( PHP_EOL , $ ret ) ; } return array ( $ responseHeaders , $ responseBody ) ; }
Generate the sample output

@param  array   $st_params
@param  integer $counter
@return string
Generate the sample output