Exemplo n.º 1
0
 /**
  * Check if an item exists in an array using "dot" notation.
  *
  * @param  array   $array
  * @param  string  $key
  * @return bool
  */
 function wpdevsclub_array_has($array, $key)
 {
     return Arr::has($array, $key);
 }
Exemplo n.º 2
0
 function test_has()
 {
     $data = array('names' => array('developer' => 'Tonya'));
     $this->assertTrue(wpdevsclub_array_has($data, 'names'));
     $this->assertTrue(Arr::has($data, 'names.developer', true));
     $this->assertFalse(wpdevsclub_array_has($data, 'foo'));
     $this->assertFalse(Arr::has($data, 'foo.bar'));
 }
Exemplo n.º 3
0
 /**
  * Checks if the parameters exists.  Uses dot notation for multidimensional keys.
  *
  * @since 1.0.0
  *
  * @param  string $parameter_key Parameter key, specified in dot notation, i.e. key.key.key
  * @return bool
  */
 public function has($parameter_key)
 {
     return Arr_Helpers::has($this->config, $parameter_key);
 }