Noherczeg\Breadcrumb\Segment::get PHP Метод

get() публичный Метод

get: Mediocre getter which returns a single requested property.
public get ( string $property_name ) : string
$property_name string
Результат string
    public function get($property_name)
    {
        if (!is_string($property_name)) {
            throw new \InvalidArgumentException('Invalid parameter given!');
        } elseif (array_key_exists($property_name, get_object_vars($this))) {
            return $this->{$property_name};
        } else {
            throw new \OutOfRangeException("Requested property does not exist!");
        }
    }

Usage Example

Пример #1
0
 /**
  * @Test
  */
 public function testTogglers()
 {
     $this->segment->disable();
     $this->assertEquals(true, $this->segment->get('disabled'));
     $this->segment->enable();
     $this->assertEquals(false, $this->segment->get('disabled'));
 }
All Usage Examples Of Noherczeg\Breadcrumb\Segment::get