original_string: protected function startCommandsPlugin($app)
      {
          $this->onRegister('commands', function ($app) {
              /** @var \Illuminate\Foundation\Application $app */
              // Commands
              if ($app->runningInConsole()) {
                  foreach ($this->findCommands as $path) {
                      $dir = path_get_directory((new ReflectionClass(get_called_class()))->getFileName());
                      $classes = $this->findCommandsIn(path_join($dir, $path), $this->findCommandsRecursive);
  
                      $this->commands = array_merge($this->commands, $classes);
                  }
                  if (is_array($this->commands) && count($this->commands) > 0) {
                      $commands = [];
                      foreach ($this->commands as $k => $v) {
                          if (is_string($k)) {
                              $app[ $this->commandPrefix.$k ] = $app->share(function ($app) use ($k, $v) {
                                  return $app->build($v);
                              });
  
                              $commands[] = $this->commandPrefix.$k;
                          } else {
                              $commands[] = $v;
                          }
                      }
                      $this->commands($commands);
                  }
              }
          });
      }
code: protected function startCommandsPlugin($app)
      {
          $this->onRegister('commands', function ($app) {
              /** @var \Illuminate\Foundation\Application $app */
              // Commands
              if ($app->runningInConsole()) {
                  foreach ($this->findCommands as $path) {
                      $dir = path_get_directory((new ReflectionClass(get_called_class()))->getFileName());
                      $classes = $this->findCommandsIn(path_join($dir, $path), $this->findCommandsRecursive);
  
                      $this->commands = array_merge($this->commands, $classes);
                  }
                  if (is_array($this->commands) && count($this->commands) > 0) {
                      $commands = [];
                      foreach ($this->commands as $k => $v) {
                          if (is_string($k)) {
                              $app[ $this->commandPrefix.$k ] = $app->share(function ($app) use ($k, $v) {
                                  return $app->build($v);
                              });
  
                              $commands[] = $this->commandPrefix.$k;
                          } else {
                              $commands[] = $v;
                          }
                      }
                      $this->commands($commands);
                  }
              }
          });
      }
code_tokens: protected function startCommandsPlugin ( $ app ) { $ this -> onRegister ( 'commands' , function ( $ app ) { /** @var \Illuminate\Foundation\Application $app */ // Commands if ( $ app -> runningInConsole ( ) ) { foreach ( $ this -> findCommands as $ path ) { $ dir = path_get_directory ( ( new ReflectionClass ( get_called_class ( ) ) ) -> getFileName ( ) ) ; $ classes = $ this -> findCommandsIn ( path_join ( $ dir , $ path ) , $ this -> findCommandsRecursive ) ; $ this -> commands = array_merge ( $ this -> commands , $ classes ) ; } if ( is_array ( $ this -> commands ) && count ( $ this -> commands ) > 0 ) { $ commands = [ ] ; foreach ( $ this -> commands as $ k => $ v ) { if ( is_string ( $ k ) ) { $ app [ $ this -> commandPrefix . $ k ] = $ app -> share ( function ( $ app ) use ( $ k , $ v ) { return $ app -> build ( $ v ) ; } ) ; $ commands [ ] = $ this -> commandPrefix . $ k ; } else { $ commands [ ] = $ v ; } } $ this -> commands ( $ commands ) ; } } } ) ; }
docstring: startCommandsPlugin method.
  
  @param \Illuminate\Foundation\Application $app
docstring_tokens: startCommandsPlugin method .