示例#1
0
文件: Path.php 项目: phootwork/file
 /**
  * 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;
 }
示例#2
0
 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);
         }
     }
 }
示例#3
0
 /**
  * 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;
 }