コード例 #1
0
ファイル: Set.php プロジェクト: estelsmith/earley-parser
 public function __toString()
 {
     $items = $this->items->getArrayCopy();
     $itemStrings = array_map(function (Item $item) {
         return $item->__toString() . "\n";
     }, $items);
     return implode($itemStrings);
 }
コード例 #2
0
 /**
  * @return Collection|Item[]
  */
 public function getItems()
 {
     return $this->items->sortBy(function (Item $item) {
         return $item->getWeight();
     });
 }
コード例 #3
0
 /**
  * Remove item
  *
  * @param Item $item Item
  *
  * @return $this
  */
 public function removeItem(Item $item)
 {
     $this->items->removeElement($item);
     return $this;
 }
コード例 #4
0
ファイル: Project.php プロジェクト: gbelmm/ACL
 /**
  * @return Item[]
  */
 public function getItems()
 {
     return $this->items->toArray();
 }
コード例 #5
0
 public function testNearestUseBy()
 {
     $oneMinLater = strtotime('+1 minute');
     $this->items['bread']->setUseBy($oneMinLater);
     $this->assertEquals($oneMinLater, $this->items->getNearestUseBy());
 }
コード例 #6
0
ファイル: Debugbar.php プロジェクト: codexproject/core
 /**
  * Offset to unset
  * @link  http://php.net/manual/en/arrayaccess.offsetunset.php
  *
  * @param mixed $offset <p>
  *                      The offset to unset.
  *                      </p>
  *
  * @return void
  * @since 5.0.0
  */
 public function offsetUnset($offset)
 {
     $this->items->forget($offset);
 }