Example #1
0
 /**
  * Add images to the given project.
  *
  * @param Project $project
  */
 public function __invoke(Project $project)
 {
     $files = $project->sourceFiles();
     $files->name('*.gif')->name('*.png')->name('*.jpg');
     $project->watchlist->watchFiles($files);
     foreach ($files as $file) {
         /** @var SplFileInfo $file */
         $project->addFile(new LazyFile($file->getPathname(), $file->getRelativePathname()));
     }
 }
Example #2
0
 public function __invoke(Project $project)
 {
     $files = $project->sourceFiles();
     $files->name('*.md');
     foreach ($files as $file) {
         /** @var SplFileInfo $file */
         $content = file_get_contents($file->getPathname());
         $project->addFile(new MarkdownFile($file->getRelativePathname(), $content));
     }
     $project->watchlist->watchFiles($files);
 }