Filesystem Component v1.1.0 Release Notes

Release Date: 2020-12-05 // over 3 years ago
    • ➕ add ability to extend Filesystem class with Macros.

      use Atomastic\Filesystem\Filesystem;
      use Atomastic\Macroable\Macroable;
      
      Filesystem::macro('countFiles', function($path) {
          return count(iterator_to_array($this->find()->in($path)->files(), false));
      });
      
      $filesytem = new Filesystem();
      
      echo $filesytem->countFiles('/directory');
      
    • 👌 improve tests for directory create() method.