private function extractExtendedParametersInfo(): void
  {
    $key = array_search('begin', $this->routineSourceCodeLines);

    if ($key!==false)
    {
      for ($i = 1; $i<$key; $i++)
      {
        $k = preg_match('/^\s*--\s+param:(?:\s*(\w+)\s+(\w+)(?:(?:\s+([^\s-])\s+([^\s-])\s+([^\s-])\s*$)|(?:\s*$)))?/',
                        $this->routineSourceCodeLines[$key - $i + 1],
                        $matches);

        if ($k==1)
        {
          $count = count($matches);
          if ($count==3 || $count==6)
          {
            $parameter_name = $matches[1];
            $data_type      = $matches[2];

            if ($count==6)
            {
              $list_delimiter = $matches[3];
              $list_enclosure = $matches[4];
              $list_escape    = $matches[5];
            }
            else
            {
              $list_delimiter = ',';
              $list_enclosure = '"';
              $list_escape    = '\\';
            }

            if (!isset($this->extendedParameters[$parameter_name]))
            {
              $this->extendedParameters[$parameter_name] = ['name'      => $parameter_name,
                                                            'data_type' => $data_type,
                                                            'delimiter' => $list_delimiter,
                                                            'enclosure' => $list_enclosure,
                                                            'escape'    => $list_escape];
            }
            else
            {
              throw new RoutineLoaderException("Duplicate parameter '%s'", $parameter_name);
            }
          }
          else
          {
            throw new RoutineLoaderException('Error: Expected: -- param: <field_name> <type_of_list> [delimiter enclosure escape]');
          }
        }
      }
    }
  }
private function extractExtendedParametersInfo(): void
  {
    $key = array_search('begin', $this->routineSourceCodeLines);

    if ($key!==false)
    {
      for ($i = 1; $i<$key; $i++)
      {
        $k = preg_match('/^\s*--\s+param:(?:\s*(\w+)\s+(\w+)(?:(?:\s+([^\s-])\s+([^\s-])\s+([^\s-])\s*$)|(?:\s*$)))?/',
                        $this->routineSourceCodeLines[$key - $i + 1],
                        $matches);

        if ($k==1)
        {
          $count = count($matches);
          if ($count==3 || $count==6)
          {
            $parameter_name = $matches[1];
            $data_type      = $matches[2];

            if ($count==6)
            {
              $list_delimiter = $matches[3];
              $list_enclosure = $matches[4];
              $list_escape    = $matches[5];
            }
            else
            {
              $list_delimiter = ',';
              $list_enclosure = '"';
              $list_escape    = '\\';
            }

            if (!isset($this->extendedParameters[$parameter_name]))
            {
              $this->extendedParameters[$parameter_name] = ['name'      => $parameter_name,
                                                            'data_type' => $data_type,
                                                            'delimiter' => $list_delimiter,
                                                            'enclosure' => $list_enclosure,
                                                            'escape'    => $list_escape];
            }
            else
            {
              throw new RoutineLoaderException("Duplicate parameter '%s'", $parameter_name);
            }
          }
          else
          {
            throw new RoutineLoaderException('Error: Expected: -- param: <field_name> <type_of_list> [delimiter enclosure escape]');
          }
        }
      }
    }
  }
private function extractExtendedParametersInfo ( ) : void { $ key = array_search ( 'begin' , $ this -> routineSourceCodeLines ) ; if ( $ key !== false ) { for ( $ i = 1 ; $ i < $ key ; $ i ++ ) { $ k = preg_match ( '/^\s*--\s+param:(?:\s*(\w+)\s+(\w+)(?:(?:\s+([^\s-])\s+([^\s-])\s+([^\s-])\s*$)|(?:\s*$)))?/' , $ this -> routineSourceCodeLines [ $ key - $ i + 1 ] , $ matches ) ; if ( $ k == 1 ) { $ count = count ( $ matches ) ; if ( $ count == 3 || $ count == 6 ) { $ parameter_name = $ matches [ 1 ] ; $ data_type = $ matches [ 2 ] ; if ( $ count == 6 ) { $ list_delimiter = $ matches [ 3 ] ; $ list_enclosure = $ matches [ 4 ] ; $ list_escape = $ matches [ 5 ] ; } else { $ list_delimiter = ',' ; $ list_enclosure = '"' ; $ list_escape = '\\' ; } if ( ! isset ( $ this -> extendedParameters [ $ parameter_name ] ) ) { $ this -> extendedParameters [ $ parameter_name ] = [ 'name' => $ parameter_name , 'data_type' => $ data_type , 'delimiter' => $ list_delimiter , 'enclosure' => $ list_enclosure , 'escape' => $ list_escape ] ; } else { throw new RoutineLoaderException ( "Duplicate parameter '%s'" , $ parameter_name ) ; } } else { throw new RoutineLoaderException ( 'Error: Expected: -- param: <field_name> <type_of_list> [delimiter enclosure escape]' ) ; } } } } }
Extracts extended info of the routine parameters.
Extracts extended info of the routine parameters .