public function decrementValue() { parent::decrementValue(); if ($this->getValue() < 0) { $this->setValue(255); } }
/** * @param string $key * @return mixed */ public function get($key) { if (!property_exists($this->items, $key) && array_key_exists($key, (array) $this->items)) { $items = (array) $this->items; return $items[$key]; } $value = $this->items->{$key}; if (is_object($value)) { return $this->make($value); } else { if (is_array($value)) { return ArrayContainer::reference($this->items->{(string) $key}); } } return $value; }
/** * @test */ public function removeReturnsContainer() { $container = $this->container->remove('testId1'); $this->assertSame($container, $this->container); }