/** * Verify that the path manager is manageable. */ public function testSetAndRetrievePathManager() { self::assertSame($this->manager, $this->event->getManager(), 'The path manager was not returned.'); $manager = $this->getMockForAbstractClass(PathInterface::class); $this->event->setManager($manager); self::assertSame($manager, $this->event->getManager(), 'The path manager was not changed.'); }
/** * Replaces the contents of the file, if applicable. * * @param BeforeSetPathEvent $event The event manager. */ public function beforeSetPath(BeforeSetPathEvent $event) { $manager = $event->getManager(); if (PathInterface::DIRECTORY === $manager->getType()) { return; } $path = $event->getPath(); if ($this->isMatch($path)) { $event->setManager(new Memory($this->processContents($path, $manager->getContents()), $manager->getType(), $manager->getModified(), $manager->getPermissions())); } }
/** * Checks if the path should be filtered out. * * @param BeforeSetPathEvent $event The event manager. */ public function beforeSetPath(BeforeSetPathEvent $event) { if (!$this->isAllowed($event->getPath())) { $event->skip(); } }