public function test_get() { $input = ['name' => ['first' => 'Brad', 'last' => 'Bell'], 'spouse' => ['name' => ['first' => 'Brandon', 'last' => 'Kelly'], 'mood' => 'Happy', 'age' => '75'], 'mood' => 'Angry', 'age' => 25]; $this->assertEquals(25, Dot::get($input, 'age')); $this->assertEquals(75, Dot::get($input, 'spouse.age')); $this->assertEquals('Kelly', Dot::get($input, 'spouse.name.last')); }
/** * @param string $name * @param null|mixed $default * * @return null|Cookie */ public function get($name, $default = null) { return Dot::get($this->cookies, $name, $default); }
/** * @return null|string */ protected function getDefaultDomain() { return Dot::get($_SERVER, 'SERVER_NAME'); }