/** * Construct a new Windows path normalizer. * * @param WindowsPathFactoryInterface|null $factory The path factory to use. */ public function __construct(WindowsPathFactoryInterface $factory = null) { if (null === $factory) { $factory = WindowsPathFactory::instance(); } parent::__construct($factory); }
/** * Construct a new file system path factory. * * @param PathFactoryInterface|null $unixFactory The path factory to use for Unix paths. * @param PathFactoryInterface|null $windowsFactory The path factory to use for Windows paths. * @param Isolator|null $isolator The isolator to use. */ public function __construct(PathFactoryInterface $unixFactory = null, PathFactoryInterface $windowsFactory = null, Isolator $isolator = null) { if (null === $unixFactory) { $unixFactory = UnixPathFactory::instance(); } if (null === $windowsFactory) { $windowsFactory = WindowsPathFactory::instance(); } $this->unixFactory = $unixFactory; $this->windowsFactory = $windowsFactory; $this->isolator = Isolator::get($isolator); }
/** * Construct a new file system path factory. * * @param PathFactoryInterface|null $unixFactory The path factory to use for Unix paths. * @param PathFactoryInterface|null $windowsFactory The path factory to use for Windows paths. * @param Isolator|null $isolator The isolator to use. */ public function __construct(PathFactoryInterface $unixFactory = null, PathFactoryInterface $windowsFactory = null, $isolator = null) { if (null === $unixFactory) { $unixFactory = UnixPathFactory::instance(); } if (null === $windowsFactory) { $windowsFactory = WindowsPathFactory::instance(); } $this->unixFactory = $unixFactory; $this->windowsFactory = $windowsFactory; // Bolt doesn't use isolator, so warn users it is not available if ($isolator != null) { throw new Exception("Bolt pathogen does not use isolator", 1); } }
/** * Get the most appropriate path factory for this type of path. * * @return Factory\WindowsPathFactoryInterface The path factory. */ protected static function factory() { return Factory\WindowsPathFactory::instance(); }