/** * Returns a copy of this path with the same segments as this path but with a trailing separator removed. * * @return $this */ public function removeTrailingSeparator() { if ($this->hasTrailingSeparator()) { $this->pathname = $this->pathname->substring(0, -1); } return $this; }
private function parseExtensions(Map $data) { $this->extensions = new Map(); foreach ($data as $k => $v) { $key = new Text($k); if ($key->startsWith('x-')) { $this->extensions->set($key->substring(2), $v); } } }
/** * Sets the full name (vendor/name) of the package * * @param string $name * @return $this */ public function setFullName($name) { $fullName = new Text($name); $this->fullName = $name; $this->name = $fullName->substring($fullName->indexOf('/') + 1)->toString(); $this->vendor = $fullName->substring(0, $fullName->indexOf('/'))->toString(); return $this; }