Hostnet\Component\Webpack\Asset\Tracker::addPath PHP Method

addPath() public method

Add a path to the list of tracked paths (this can be both dir's or files).
public addPath ( string $path ) : Tracker
$path string the path to track.
return Tracker this instance.
    public function addPath($path)
    {
        if (empty($path) || false === ($real_path = realpath($path))) {
            throw new FileNotFoundException(null, 0, null, $path);
        }
        $this->paths[] = $real_path;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * @expectedException \Symfony\Component\Filesystem\Exception\FileNotFoundException
  * @expectedExceptionMessage File "/i/dont/exist" could not be found.
  */
 public function testAddInvalidPath()
 {
     $profiler = new Profiler();
     $finder = $this->getMock(TemplateFinderInterface::class);
     $fixture_path = realpath(__DIR__ . '/../../Fixture');
     $tracker = new Tracker($profiler, $finder, $fixture_path . '/cache', $fixture_path, []);
     $tracker->addPath("/i/dont/exist");
 }
All Usage Examples Of Hostnet\Component\Webpack\Asset\Tracker::addPath