Ejemplo n.º 1
0
 /**
  * Adds a trailing slash to this path.
  *
  * @return PathInterface A new path instance with a trailing slash suffixed to this path.
  */
 public function joinTrailingSlash()
 {
     if (!$this->hasAtoms()) {
         return $this;
     }
     return parent::joinTrailingSlash();
 }
Ejemplo n.º 2
0
 /**
  * Normalizes and validates a sequence of path atoms.
  *
  * This method is called internally by the constructor upon instantiation.
  * It can be overridden in child classes to change how path atoms are
  * normalized and/or validated.
  *
  * @param mixed<string> $atoms The path atoms to normalize.
  *
  * @return array<string>                                The normalized path atoms.
  * @throws Exception\EmptyPathAtomException             If any path atom is empty.
  * @throws Exception\PathAtomContainsSeparatorException If any path atom contains a separator.
  */
 protected function normalizeAtoms($atoms)
 {
     $atoms = parent::normalizeAtoms($atoms);
     if (count($atoms) < 1) {
         throw new Exception\EmptyPathException();
     }
     return $atoms;
 }
Ejemplo n.º 3
0
 public function normalize($path)
 {
     $path = $this->normalizeSeparators($path);
     list($drive, $path) = $this->splitDrive($path);
     return $drive . parent::normalize($path);
 }