original_string: public function run(...$argv) : void
      {
          $recipe = $this->recipe;
          if (isset($this->config->aliases, $this->config->aliases->$recipe)) {
              $alias = $this->config->aliases->$recipe;
              $recipe = $alias[0];
              $argv = array_merge(array_splice($alias, 1), $argv);
          }
          $file = "{$this->path}/recipes/$recipe/Recipe.php";
          if (strpos($recipe, '@')) {
              list($vendor, $recipe) = explode('@', $recipe);
              $file = "{$this->path}/vendor/$vendor/recipes/$recipe/Recipe.php";
              if (!file_exists($file)) {
                  $file = "{$this->path}/recipes/$recipe/Recipe.php";
              }
          }
          if (file_exists($file)) {
              $recipefn = require $file;
              $reflection = new ReflectionFunction($recipefn);
              $wanteds = $reflection->getParameters();
              if ($reflection->getNumberOfRequiredParameters() > count($argv)) {
                  $usage = call_user_func($tmp = function () use (&$tmp, &$wanteds) : string {
                      $param = array_shift($wanteds);
                      $out = ' ';
                      if ($param->isOptional()) {
                          $out .= '[';
                      }
                      if ($param->isVariadic()) {
                          $out .= '...';
                      }
                      $out .= strtoupper($param->getName());
                      if ($wanteds) {
                          $out .= $tmp();
                      }
                      if ($param->isOptional()) {
                          $out .= ']';
                      }
                      return $out;
                  }, $wanteds);
                  fwrite(STDERR, "\nUsage: `$ vendor/bin/codger $recipe$usage`\n\n");
                  if ($docComment = $reflection->getDocComment()) {
                      $docComment = preg_replace("@(^/\*\*\n|\n\s?\*/$)@", '', $docComment);
                      $docComment = preg_replace("@^\s?\*\s?@m", '', $docComment);
                      fwrite(STDERR, "$docComment\n\n");
                  }
              } else {
                  if ($wanteds && end($wanteds)->isVariadic() && end($wanteds)->name == 'options') {
                      $copy = $argv;
                      $this->setOptions(array_splice($copy, count($wanteds) - 1));
                  }
                  $recipefn->call($this, ...$argv)->process();
              }
          } else {
              fwrite(STDERR, "Recipe `$recipe` could not be found in `{$this->path}/recipes`, skipping...\n");
          }
      }
code: public function run(...$argv) : void
      {
          $recipe = $this->recipe;
          if (isset($this->config->aliases, $this->config->aliases->$recipe)) {
              $alias = $this->config->aliases->$recipe;
              $recipe = $alias[0];
              $argv = array_merge(array_splice($alias, 1), $argv);
          }
          $file = "{$this->path}/recipes/$recipe/Recipe.php";
          if (strpos($recipe, '@')) {
              list($vendor, $recipe) = explode('@', $recipe);
              $file = "{$this->path}/vendor/$vendor/recipes/$recipe/Recipe.php";
              if (!file_exists($file)) {
                  $file = "{$this->path}/recipes/$recipe/Recipe.php";
              }
          }
          if (file_exists($file)) {
              $recipefn = require $file;
              $reflection = new ReflectionFunction($recipefn);
              $wanteds = $reflection->getParameters();
              if ($reflection->getNumberOfRequiredParameters() > count($argv)) {
                  $usage = call_user_func($tmp = function () use (&$tmp, &$wanteds) : string {
                      $param = array_shift($wanteds);
                      $out = ' ';
                      if ($param->isOptional()) {
                          $out .= '[';
                      }
                      if ($param->isVariadic()) {
                          $out .= '...';
                      }
                      $out .= strtoupper($param->getName());
                      if ($wanteds) {
                          $out .= $tmp();
                      }
                      if ($param->isOptional()) {
                          $out .= ']';
                      }
                      return $out;
                  }, $wanteds);
                  fwrite(STDERR, "\nUsage: `$ vendor/bin/codger $recipe$usage`\n\n");
                  if ($docComment = $reflection->getDocComment()) {
                      $docComment = preg_replace("@(^/\*\*\n|\n\s?\*/$)@", '', $docComment);
                      $docComment = preg_replace("@^\s?\*\s?@m", '', $docComment);
                      fwrite(STDERR, "$docComment\n\n");
                  }
              } else {
                  if ($wanteds && end($wanteds)->isVariadic() && end($wanteds)->name == 'options') {
                      $copy = $argv;
                      $this->setOptions(array_splice($copy, count($wanteds) - 1));
                  }
                  $recipefn->call($this, ...$argv)->process();
              }
          } else {
              fwrite(STDERR, "Recipe `$recipe` could not be found in `{$this->path}/recipes`, skipping...\n");
          }
      }
code_tokens: public function run ( ... $ argv ) : void { $ recipe = $ this -> recipe ; if ( isset ( $ this -> config -> aliases , $ this -> config -> aliases -> $ recipe ) ) { $ alias = $ this -> config -> aliases -> $ recipe ; $ recipe = $ alias [ 0 ] ; $ argv = array_merge ( array_splice ( $ alias , 1 ) , $ argv ) ; } $ file = "{$this->path}/recipes/$recipe/Recipe.php" ; if ( strpos ( $ recipe , '@' ) ) { list ( $ vendor , $ recipe ) = explode ( '@' , $ recipe ) ; $ file = "{$this->path}/vendor/$vendor/recipes/$recipe/Recipe.php" ; if ( ! file_exists ( $ file ) ) { $ file = "{$this->path}/recipes/$recipe/Recipe.php" ; } } if ( file_exists ( $ file ) ) { $ recipefn = require $ file ; $ reflection = new ReflectionFunction ( $ recipefn ) ; $ wanteds = $ reflection -> getParameters ( ) ; if ( $ reflection -> getNumberOfRequiredParameters ( ) > count ( $ argv ) ) { $ usage = call_user_func ( $ tmp = function ( ) use ( & $ tmp , & $ wanteds ) : string { $ param = array_shift ( $ wanteds ) ; $ out = ' ' ; if ( $ param -> isOptional ( ) ) { $ out .= '[' ; } if ( $ param -> isVariadic ( ) ) { $ out .= '...' ; } $ out .= strtoupper ( $ param -> getName ( ) ) ; if ( $ wanteds ) { $ out .= $ tmp ( ) ; } if ( $ param -> isOptional ( ) ) { $ out .= ']' ; } return $ out ; } , $ wanteds ) ; fwrite ( STDERR , "\nUsage: `$ vendor/bin/codger $recipe$usage`\n\n" ) ; if ( $ docComment = $ reflection -> getDocComment ( ) ) { $ docComment = preg_replace ( "@(^/\*\*\n|\n\s?\*/$)@" , '' , $ docComment ) ; $ docComment = preg_replace ( "@^\s?\*\s?@m" , '' , $ docComment ) ; fwrite ( STDERR , "$docComment\n\n" ) ; } } else { if ( $ wanteds && end ( $ wanteds ) -> isVariadic ( ) && end ( $ wanteds ) -> name == 'options' ) { $ copy = $ argv ; $ this -> setOptions ( array_splice ( $ copy , count ( $ wanteds ) - 1 ) ) ; } $ recipefn -> call ( $ this , ... $ argv ) -> process ( ) ; } } else { fwrite ( STDERR , "Recipe `$recipe` could not be found in `{$this->path}/recipes`, skipping...\n" ) ; } }
docstring: Run the recipe.
  
  @param mixed ...$argv Arguments passed from CLI.
  @return void
docstring_tokens: Run the recipe .