original_string: public function locate($pack)
      {
          $finder = new Finder();
          $packDirectory = $this->packs[$pack]->getDirectory();
          $commandDir = $packDirectory.DIRECTORY_SEPARATOR."Command";
  
          if (is_dir($commandDir)) {
              foreach ($finder->name("*.php")->in($packDirectory.DIRECTORY_SEPARATOR."Command") as $file) {
                  $commandClass = str_replace('.php','' , $file->getFilename());
                  $fullClassName = "\\".$this->packs[$pack]->getNameSpace()."\\Command\\".$commandClass;
  
                  if (class_exists($fullClassName)) {
                      $command = new $fullClassName;
  
                      if ($command instanceof \Singular\Console\Command\Command) {
                          $this->console->add($command);
                      }
                  }
              }
          }
      }
code: public function locate($pack)
      {
          $finder = new Finder();
          $packDirectory = $this->packs[$pack]->getDirectory();
          $commandDir = $packDirectory.DIRECTORY_SEPARATOR."Command";
  
          if (is_dir($commandDir)) {
              foreach ($finder->name("*.php")->in($packDirectory.DIRECTORY_SEPARATOR."Command") as $file) {
                  $commandClass = str_replace('.php','' , $file->getFilename());
                  $fullClassName = "\\".$this->packs[$pack]->getNameSpace()."\\Command\\".$commandClass;
  
                  if (class_exists($fullClassName)) {
                      $command = new $fullClassName;
  
                      if ($command instanceof \Singular\Console\Command\Command) {
                          $this->console->add($command);
                      }
                  }
              }
          }
      }
code_tokens: public function locate ( $ pack ) { $ finder = new Finder ( ) ; $ packDirectory = $ this -> packs [ $ pack ] -> getDirectory ( ) ; $ commandDir = $ packDirectory . DIRECTORY_SEPARATOR . "Command" ; if ( is_dir ( $ commandDir ) ) { foreach ( $ finder -> name ( "*.php" ) -> in ( $ packDirectory . DIRECTORY_SEPARATOR . "Command" ) as $ file ) { $ commandClass = str_replace ( '.php' , '' , $ file -> getFilename ( ) ) ; $ fullClassName = "\\" . $ this -> packs [ $ pack ] -> getNameSpace ( ) . "\\Command\\" . $ commandClass ; if ( class_exists ( $ fullClassName ) ) { $ command = new $ fullClassName ; if ( $ command instanceof \ Singular \ Console \ Command \ Command ) { $ this -> console -> add ( $ command ) ; } } } } }
docstring: Localiza a registra os comandos de um pacote automaticamente.
  
  @param string $pack
docstring_tokens: Localiza a registra os comandos de um pacote automaticamente .