original_string: public function commands()
      {
          $shellList = $this->getShellList();
          $flatten = Hash::flatten($shellList);
          $duplicates = array_intersect($flatten, array_unique(array_diff_key($flatten, array_unique($flatten))));
          $duplicates = Hash::expand($duplicates);
  
          $options = [];
          foreach ($shellList as $type => $commands) {
              foreach ($commands as $shell) {
                  $prefix = '';
                  if (!in_array(strtolower($type), ['app', 'core']) &&
                      isset($duplicates[$type]) &&
                      in_array($shell, $duplicates[$type])
                  ) {
                      $prefix = $type . '.';
                  }
  
                  $options[] = $prefix . $shell;
              }
          }
  
          return $options;
      }
code: public function commands()
      {
          $shellList = $this->getShellList();
          $flatten = Hash::flatten($shellList);
          $duplicates = array_intersect($flatten, array_unique(array_diff_key($flatten, array_unique($flatten))));
          $duplicates = Hash::expand($duplicates);
  
          $options = [];
          foreach ($shellList as $type => $commands) {
              foreach ($commands as $shell) {
                  $prefix = '';
                  if (!in_array(strtolower($type), ['app', 'core']) &&
                      isset($duplicates[$type]) &&
                      in_array($shell, $duplicates[$type])
                  ) {
                      $prefix = $type . '.';
                  }
  
                  $options[] = $prefix . $shell;
              }
          }
  
          return $options;
      }
code_tokens: public function commands ( ) { $ shellList = $ this -> getShellList ( ) ; $ flatten = Hash :: flatten ( $ shellList ) ; $ duplicates = array_intersect ( $ flatten , array_unique ( array_diff_key ( $ flatten , array_unique ( $ flatten ) ) ) ) ; $ duplicates = Hash :: expand ( $ duplicates ) ; $ options = [ ] ; foreach ( $ shellList as $ type => $ commands ) { foreach ( $ commands as $ shell ) { $ prefix = '' ; if ( ! in_array ( strtolower ( $ type ) , [ 'app' , 'core' ] ) && isset ( $ duplicates [ $ type ] ) && in_array ( $ shell , $ duplicates [ $ type ] ) ) { $ prefix = $ type . '.' ; } $ options [ ] = $ prefix . $ shell ; } } return $ options ; }
docstring: Return a list of all commands
  
  @return array
docstring_tokens: Return a list of all commands