Returns code for the parameters of the wrapper method for the stored routine.

@return string
552056
protected function getWrapperArgs(): string
  {
    $ret = '';

    if ($this->routine['designation']=='bulk')
    {
      $ret .= 'BulkHandler $bulkHandler';
    }

    foreach ($this->routine['parameters'] as $i => $parameter)
    {
      if ($ret!='') $ret .= ', ';

      $dataType    = DataTypeHelper::columnTypeToPhpTypeHinting($parameter);
      $declaration = DataTypeHelper::phpTypeHintingToPhpTypeDeclaration($dataType.'|null');
      if ($declaration!=='')
      {
        $ret .= $declaration.' ';
      }

      $ret .= '$'.$this->nameMangler->getParameterName($parameter['parameter_name']);
    }

    return $ret;
  }
1205373
public function getParameters($method)
    {
        //Loop through the default values for paremeters, and make the correct output string
        $params = array();
        $paramsWithDefault = array();
        foreach ($method->getParameters() as $param) {
            $paramStr = '$' . $param->getName();
            $params[] = $paramStr;
            if ($param->isOptional()) {
                $default = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
                if (is_bool($default)) {
                    $default = $default ? 'true' : 'false';
                } elseif (is_array($default)) {
                    $default = 'array()';
                } elseif (is_null($default)) {
                    $default = 'null';
                } elseif (is_int($default)) {
                    //$default = $default;
                } elseif (is_resource($default)) {
                    //skip to not fail
                } else {
                    $default = "'" . trim($default) . "'";
                }
                $paramStr .= " = $default";
            }
            $paramsWithDefault[] = $paramStr;
        }

        $this->params = $params;
        $this->params_with_default = $paramsWithDefault;
    }
742175
private function compileAllParameters()
    {
        foreach (array_keys($this->raw_parameters) as $section) {
            $this->parameters[$section] = $this->compileParameters($section);
        }

        return $this->parameters;
    }
1106833
private function getRecordListParams()
    {
        $metadataPrefix = null;
        $from = null;
        $until = null;
        $fromGranularity = null;
        $untilGranularity  = null;
        $set = isset($this->params['set']) ? $this->params['set'] : null;


        $checks = [
            function () use (&$from, &$fromGranularity) {
                if (isset($this->params['from'])) {
                    list($from, $fromGranularity)  = $this->parseRequestDate($this->params['from']);
                }
            },
            function () use (&$until, &$untilGranularity) {
                if (isset($this->params['until'])) {
                    list($until, $untilGranularity) = $this->parseRequestDate($this->params['until']);
                }
            },
            function () use (&$from, &$until) {
                if ($from !== null and $until !== null && $from > $until) {
                    throw new BadArgumentException(
                        'The `from` argument must be less than or equal to the `until` argument'
                    );
                }
            },
            function () use (&$from, &$until, &$fromGranularity, &$untilGranularity) {
                if ($from !== null and $until !== null && $fromGranularity !== $untilGranularity) {
                    throw new BadArgumentException('The `from` and `until` arguments have different granularity');
                }
            },
            function () use (&$fromGranularity) {
                if ($fromGranularity !== null &&
                    $fromGranularity === Identity::GRANULARITY_YYYY_MM_DDTHH_MM_SSZ &&
                    $this->repository->getGranularity() === Identity::GRANULARITY_YYYY_MM_DD) {
                    throw new BadArgumentException(
                        'The granularity of the `from` argument is not supported by this repository'
                    );
                }
            },
            function () use (&$untilGranularity) {
                if ($untilGranularity !== null &&
                    $untilGranularity === Identity::GRANULARITY_YYYY_MM_DDTHH_MM_SSZ &&
                    $this->repository->getGranularity() === Identity::GRANULARITY_YYYY_MM_DD) {
                    throw new BadArgumentException(
                        'The granularity of the `until` argument is not supported by this repository'
                    );
                }
            },
            function () use (&$metadataPrefix) {
                if (!isset($this->params['metadataPrefix'])) {
                    throw new BadArgumentException("Missing required argument metadataPrefix");
                }
                $metadataPrefix = $this->params['metadataPrefix'];
                if (is_array($metadataPrefix)) {
                    throw new BadArgumentException("Only one metadataPrefix allowed");
                }
                $this->checkMetadataPrefix($metadataPrefix);
            }
        ];

        $this->doChecks($checks);
        return [$metadataPrefix, $from, $until, $set];
    }
1123215
public function getCode()
        {
            $ret;

            if($this->count < $this->dataLength) {
                $row = $this->count % $this->blocks;
                $col = $this->count / $this->blocks;
                if($col >= $this->rsblocks[0]->dataLength) {
                    $row += $this->b1;
                }
                $ret = $this->rsblocks[$row]->data[$col];
            } else if($this->count < $this->dataLength + $this->eccLength) {
                $row = ($this->count - $this->dataLength) % $this->blocks;
                $col = ($this->count - $this->dataLength) / $this->blocks;
                $ret = $this->rsblocks[$row]->ecc[$col];
            } else {
                return 0;
            }
            $this->count++;
            
            return $ret;
        }
212269
private function functionCallParameter() {
    switch ($this->currentType) {
      case '&':
        return $this->writeVariable();
      case T_ELLIPSIS:
        $node = new SplatNode();
        $this->mustMatch(T_ELLIPSIS, $node);
        $node->addChild($this->expr(), 'expression');
        return $node;
      default:
        return $this->expr();
    }
  }
267438
public function dumpParameters()
    {
        $parameters = [];
        foreach ($this->getParameters() as $parameter) {
            $string = '';
            if ($parameter->isArray()) {
                $string .= 'array ';
            } elseif ($parameter->getClass()) {
                $string .= $parameter->getClass()->name.' ';
            }
            if ($parameter->isPassedByReference()) {
                $string .= '&';
            }
            $string .= '$'.$parameter->name;
            if ($parameter->isOptional()) {
                $string .= ' = '.var_export($parameter->getDefaultValue(), true);
            }
            $parameters[] = $string;
        }

        return '('.implode(', ', $parameters).')';
    }
1044846
public function getParameters()
    {
        $params = array();
        foreach ($this->parameters as $name => $param) {
            $params[$name] = htmlentities($param, ENT_QUOTES, 'UTF-8', false);
        }
        return $params;
    }
652695
public function getCode()
    {
        $result = $this->code;
        if (is_callable($result)) {
            $result = $result($this);
        }

        return (string) $result;
    }
855895
private function generatePhpDocParameters(): void
  {
    $parameters = [];
    foreach ($this->routine['phpdoc']['parameters'] as $parameter)
    {
      $mangledName = $this->nameMangler->getParameterName($parameter['parameter_name']);

      $parameters[] = ['php_name'             => '$'.$mangledName,
                       'description'          => $parameter['description'],
                       'php_type'             => $parameter['php_type'],
                       'data_type_descriptor' => $parameter['data_type_descriptor']];
    }

    $this->enhancePhpDocParameters($parameters);

    if (!empty($parameters))
    {
      // Compute the max lengths of parameter names and the PHP types of the parameters.
      $max_name_length = 0;
      $max_type_length = 0;
      foreach ($parameters as $parameter)
      {
        $max_name_length = max($max_name_length, mb_strlen($parameter['php_name']));
        $max_type_length = max($max_type_length, mb_strlen($parameter['php_type']));
      }

      $this->codeStore->append(' *', false);

      // Generate phpDoc for the parameters of the wrapper method.
      foreach ($parameters as $parameter)
      {
        $format = sprintf(' * %%-%ds %%-%ds %%-%ds %%s', mb_strlen('@param'), $max_type_length, $max_name_length);

        $lines = explode(PHP_EOL, $parameter['description'] ?? '');
        if (!empty($lines))
        {
          $line = array_shift($lines);
          $this->codeStore->append(sprintf($format, '@param', $parameter['php_type'], $parameter['php_name'], $line), false);
          foreach ($lines as $line)
          {
            $this->codeStore->append(sprintf($format, ' ', ' ', ' ', $line), false);
          }
        }
        else
        {
          $this->codeStore->append(sprintf($format, '@param', $parameter['php_type'], $parameter['php_name'], ''), false);
        }

        if ($parameter['data_type_descriptor']!==null)
        {
          $this->codeStore->append(sprintf($format, ' ', ' ', ' ', $parameter['data_type_descriptor']), false);
        }
      }
    }
  }
1339793
public function buildCode()
    {
        $code = '';

        if ($this->documentation) {
            $code .= '    /**'."\n";
            $code .= '     * '.str_replace("\n", "\n     * ", wordwrap($this->documentation, 73))."\n";
            $code .= '     */'."\n";
        }

        $code .= '    public function '.$this->name.'('.implode(', ', $this->parameters).')'."\n";
        $code .= '    {'."\n";
        $code .= '        '.str_replace("\n", "\n        ", $this->body)."\n";
        $code .= '    }';

        // Trim trailing whitespaces
        $code = preg_replace('/[ ]+$/m', '', $code);

        return $code;
    }
1233760
public function getPhpPrototypeFunction(): string
    {
        if ($this->method->getFunctionName()) {
            return 'function '.$this->method->getFunctionName().'('.$this->displayParamsWithType($this->method->getParams()).')'.': '.$this->method->getReturnType().'{}';
        }
        return '';
    }
1248904
public function getDynUrlParams()
    {
        $result = '';
        $listType = $this->getListType();
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        switch ($listType) {
            default:
                $result .= $this->getViewConfig()->getDynUrlParameters($listType);
                break;
            case 'search':
                $result .= "&amp;listtype={$listType}";
                if ($searchParamForLink = rawurlencode($config->getRequestParameter('searchparam', true))) {
                    $result .= "&amp;searchparam={$searchParamForLink}";
                }

                if (($var = $config->getRequestParameter('searchcnid', true))) {
                    $result .= '&amp;searchcnid=' . rawurlencode(rawurldecode($var));
                }
                if (($var = $config->getRequestParameter('searchvendor', true))) {
                    $result .= '&amp;searchvendor=' . rawurlencode(rawurldecode($var));
                }
                if (($var = $config->getRequestParameter('searchmanufacturer', true))) {
                    $result .= '&amp;searchmanufacturer=' . rawurlencode(rawurldecode($var));
                }
                break;
        }

        return $result;
    }
128586
function getWrapperName()
    {
        $wrapper = $this->wrapper;
        if ($wrapper === null)
            throw new \Exception(sprintf(
                'No Wrapper Defined on (%s) Context.'
                , Std\flatten($this)
            ));

        return $wrapper;
    }
1343740
public function getParams()
    {
        $result = $this->overriddenParams + parent::getParams();
        // Forward the connection charset/collate to the default table options
        if (!isset($result['defaultTableOptions']['charset']) && !isset($result['defaultTableOptions']['collate'])) {
            if (isset($result['character_set']) && isset($result['collation'])) {
                if (!isset($result['defaultTableOptions'])) {
                    $result['defaultTableOptions'] = [];
                }
                $result['defaultTableOptions']['charset'] = $result['character_set'];
                $result['defaultTableOptions']['collate'] = $result['collation'];
            }
        }

        return $result;
    }
85966
private function extractRoutineTypeAndName(): void
  {
    $n = preg_match('/create\\s+(procedure|function)\\s+([a-zA-Z0-9_]+)/i', $this->routineSourceCode, $matches);
    if ($n==1)
    {
      $this->routineType = strtolower($matches[1]);

      if ($this->routineName!=$matches[2])
      {
        throw new RoutineLoaderException("Stored routine name '%s' does not corresponds with filename", $matches[2]);
      }
    }
    else
    {
      throw new RoutineLoaderException('Unable to find the stored routine name and type');
    }
  }
132211
public function loadStoredRoutine(): array
  {
    $this->routineName           = pathinfo($this->sourceFilename, PATHINFO_FILENAME);
    $this->phpStratumOldMetadata = $this->phpStratumMetadata;
    $this->filemtime             = filemtime($this->sourceFilename);

    $load = $this->mustLoadStoredRoutine();
    if ($load)
    {
      $this->io->text(sprintf('Loading routine <dbo>%s</dbo>', OutputFormatter::escape($this->routineName)));

      $this->readSourceCode();
      $this->extractPlaceholders();
      $this->extractDesignationType();
      $this->extractReturnType();
      $this->extractRoutineTypeAndName();
      $this->validateReturnType();
      $this->loadRoutineFile();
      $this->extractBulkInsertTableColumnsInfo();
      $this->extractExtendedParametersInfo();
      $this->extractRoutineParametersInfo();
      $this->extractDocBlockPartsWrapper();
      $this->validateParameterLists();
      $this->updateMetadata();
    }

    return $this->phpStratumMetadata;
  }