original_string: final public function beforeStep(\Codeception\Event\StepEvent $e)
    {
      $step = $e->getStep();
      // access to the protected property using reflection
      $refArgs = new ReflectionProperty(get_class($step), 'arguments');
      // change property accessibility to public
      $refArgs->setAccessible(true);
      // retrieve 'arguments' value
      $args = $refArgs->getValue($step);
      foreach ($args as $index => $arg) {
        if (is_string($arg)) {
        // case if arg is a string
        // e.g. I see "{{param}}"
          $args[$index] = $this->getValueFromParam($arg);
        } elseif (is_a($arg, '\Behat\Gherkin\Node\TableNode')) {
        // case if arg is a table
        // e.g. I see :
        //  | paramater |
        //  | {{param}} |
          $table = [];
          foreach ($arg->getRows() as $i => $row) {
            foreach ($row as $j => $cell) {
                $table[$i][$j] = $this->getValueFromParam($cell);
            }
          }
          $args[$index] = new TableNode($table);
        }
      }
      // set new arguments value
      $refArgs->setValue($step, $args);
    }
code: final public function beforeStep(\Codeception\Event\StepEvent $e)
    {
      $step = $e->getStep();
      // access to the protected property using reflection
      $refArgs = new ReflectionProperty(get_class($step), 'arguments');
      // change property accessibility to public
      $refArgs->setAccessible(true);
      // retrieve 'arguments' value
      $args = $refArgs->getValue($step);
      foreach ($args as $index => $arg) {
        if (is_string($arg)) {
        // case if arg is a string
        // e.g. I see "{{param}}"
          $args[$index] = $this->getValueFromParam($arg);
        } elseif (is_a($arg, '\Behat\Gherkin\Node\TableNode')) {
        // case if arg is a table
        // e.g. I see :
        //  | paramater |
        //  | {{param}} |
          $table = [];
          foreach ($arg->getRows() as $i => $row) {
            foreach ($row as $j => $cell) {
                $table[$i][$j] = $this->getValueFromParam($cell);
            }
          }
          $args[$index] = new TableNode($table);
        }
      }
      // set new arguments value
      $refArgs->setValue($step, $args);
    }
code_tokens: final public function beforeStep ( \ Codeception \ Event \ StepEvent $ e ) { $ step = $ e -> getStep ( ) ; // access to the protected property using reflection $ refArgs = new ReflectionProperty ( get_class ( $ step ) , 'arguments' ) ; // change property accessibility to public $ refArgs -> setAccessible ( true ) ; // retrieve 'arguments' value $ args = $ refArgs -> getValue ( $ step ) ; foreach ( $ args as $ index => $ arg ) { if ( is_string ( $ arg ) ) { // case if arg is a string // e.g. I see "{{param}}" $ args [ $ index ] = $ this -> getValueFromParam ( $ arg ) ; } elseif ( is_a ( $ arg , '\Behat\Gherkin\Node\TableNode' ) ) { // case if arg is a table // e.g. I see : //  | paramater | //  | {{param}} | $ table = [ ] ; foreach ( $ arg -> getRows ( ) as $ i => $ row ) { foreach ( $ row as $ j => $ cell ) { $ table [ $ i ] [ $ j ] = $ this -> getValueFromParam ( $ cell ) ; } } $ args [ $ index ] = new TableNode ( $ table ) ; } } // set new arguments value $ refArgs -> setValue ( $ step , $ args ) ; }
docstring: Parse scenario's step before execution
  
  @param \Codeception\Event\StepEvent $e
  @return void
docstring_tokens: Parse scenario s step before execution