original_string: public function listCommand()
      {
          $head = ['Name', 'Stashed At', 'From Preset', 'Cloned At'];
          $rows = [];
          $basePath = sprintf(FLOW_PATH_ROOT . 'Data/MagicWandStash');
  
          if (!is_dir($basePath)) {
              $this->renderLine('Stash is empty.');
              $this->quit(1);
          }
  
          $baseDir = new \DirectoryIterator($basePath);
          $anyEntry = false;
  
          foreach ($baseDir as $entry) {
              if (!in_array($entry, ['.', '..'])) {
                  $stashEntryName = $entry->getFilename();
                  $manifest = $this->readStashEntryManifest($stashEntryName) ?: [];
  
                  $rows[] = [
                      $stashEntryName,
                      $manifest['stashed_at'] ? date('Y-m-d H:i:s', $manifest['stashed_at']) : 'N/A',
                      isset($manifest['preset']['name']) ? $manifest['preset']['name'] : 'N/A',
                      $manifest['cloned_at'] ? date('Y-m-d H:i:s', $manifest['cloned_at']) : 'N/A',
                  ];
  
                  $anyEntry = true;
              }
          }
  
          if (!$anyEntry) {
              $this->renderLine('Stash is empty.');
              $this->quit(1);
          }
  
          $this->output->outputTable($rows, $head);
      }
code: public function listCommand()
      {
          $head = ['Name', 'Stashed At', 'From Preset', 'Cloned At'];
          $rows = [];
          $basePath = sprintf(FLOW_PATH_ROOT . 'Data/MagicWandStash');
  
          if (!is_dir($basePath)) {
              $this->renderLine('Stash is empty.');
              $this->quit(1);
          }
  
          $baseDir = new \DirectoryIterator($basePath);
          $anyEntry = false;
  
          foreach ($baseDir as $entry) {
              if (!in_array($entry, ['.', '..'])) {
                  $stashEntryName = $entry->getFilename();
                  $manifest = $this->readStashEntryManifest($stashEntryName) ?: [];
  
                  $rows[] = [
                      $stashEntryName,
                      $manifest['stashed_at'] ? date('Y-m-d H:i:s', $manifest['stashed_at']) : 'N/A',
                      isset($manifest['preset']['name']) ? $manifest['preset']['name'] : 'N/A',
                      $manifest['cloned_at'] ? date('Y-m-d H:i:s', $manifest['cloned_at']) : 'N/A',
                  ];
  
                  $anyEntry = true;
              }
          }
  
          if (!$anyEntry) {
              $this->renderLine('Stash is empty.');
              $this->quit(1);
          }
  
          $this->output->outputTable($rows, $head);
      }
code_tokens: public function listCommand ( ) { $ head = [ 'Name' , 'Stashed At' , 'From Preset' , 'Cloned At' ] ; $ rows = [ ] ; $ basePath = sprintf ( FLOW_PATH_ROOT . 'Data/MagicWandStash' ) ; if ( ! is_dir ( $ basePath ) ) { $ this -> renderLine ( 'Stash is empty.' ) ; $ this -> quit ( 1 ) ; } $ baseDir = new \ DirectoryIterator ( $ basePath ) ; $ anyEntry = false ; foreach ( $ baseDir as $ entry ) { if ( ! in_array ( $ entry , [ '.' , '..' ] ) ) { $ stashEntryName = $ entry -> getFilename ( ) ; $ manifest = $ this -> readStashEntryManifest ( $ stashEntryName ) ? : [ ] ; $ rows [ ] = [ $ stashEntryName , $ manifest [ 'stashed_at' ] ? date ( 'Y-m-d H:i:s' , $ manifest [ 'stashed_at' ] ) : 'N/A' , isset ( $ manifest [ 'preset' ] [ 'name' ] ) ? $ manifest [ 'preset' ] [ 'name' ] : 'N/A' , $ manifest [ 'cloned_at' ] ? date ( 'Y-m-d H:i:s' , $ manifest [ 'cloned_at' ] ) : 'N/A' , ] ; $ anyEntry = true ; } } if ( ! $ anyEntry ) { $ this -> renderLine ( 'Stash is empty.' ) ; $ this -> quit ( 1 ) ; } $ this -> output -> outputTable ( $ rows , $ head ) ; }
docstring: Lists all entries
  
  @return void
docstring_tokens: Lists all entries