original_string: protected function getFunctionArgs(\stdClass $route, \ReflectionFunctionAbstract $refl)
      {
          $args = [];
          $params = $refl->getParameters();
  
          foreach ($params as $param) {
              $key = $param->name;
  
              if (property_exists($route, $key)) {
                  $value = $route->$key;
              } else {
                  if (!$param->isOptional()) {
                      $fn = $refl instanceof \ReflectionMethod ? $refl->class . '::' . $refl->name : $refl->name;
                      throw new \RuntimeException("Missing argument '$key' for {$fn}()");
                  }
                  
                  $value = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
              }
  
              $args[$key] = $value;
          }
          
          return $args;
      }
code: protected function getFunctionArgs(\stdClass $route, \ReflectionFunctionAbstract $refl)
      {
          $args = [];
          $params = $refl->getParameters();
  
          foreach ($params as $param) {
              $key = $param->name;
  
              if (property_exists($route, $key)) {
                  $value = $route->$key;
              } else {
                  if (!$param->isOptional()) {
                      $fn = $refl instanceof \ReflectionMethod ? $refl->class . '::' . $refl->name : $refl->name;
                      throw new \RuntimeException("Missing argument '$key' for {$fn}()");
                  }
                  
                  $value = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
              }
  
              $args[$key] = $value;
          }
          
          return $args;
      }
code_tokens: protected function getFunctionArgs ( \ stdClass $ route , \ ReflectionFunctionAbstract $ refl ) { $ args = [ ] ; $ params = $ refl -> getParameters ( ) ; foreach ( $ params as $ param ) { $ key = $ param -> name ; if ( property_exists ( $ route , $ key ) ) { $ value = $ route -> $ key ; } else { if ( ! $ param -> isOptional ( ) ) { $ fn = $ refl instanceof \ ReflectionMethod ? $ refl -> class . '::' . $ refl -> name : $ refl -> name ; throw new \ RuntimeException ( "Missing argument '$key' for {$fn}()" ) ; } $ value = $ param -> isDefaultValueAvailable ( ) ? $ param -> getDefaultValue ( ) : null ; } $ args [ $ key ] = $ value ; } return $ args ; }
docstring: Get the arguments for a function from a route using reflection
  
  @param \stdClass                   $route
  @param \ReflectionFunctionAbstract $refl
  @return array
docstring_tokens: Get the arguments for a function from a route using reflection