Beispiel #1
0
 /**
  * Filters a supplied `array` of `$params`, searching for `$keys` and
  * replacing each occurance with `[FILTERED]`.
  *
  * @param   array  $keys
  * @param   array  $params Parameters to filter.
  * @return  array  Filtered parameters.
  */
 public static function params(array $keys = array(), $params = array())
 {
     if (empty($keys) or empty($params)) {
         return $params;
     }
     foreach ($params as $param => &$value) {
         if (Arr::is_array($value)) {
             $value = self::params($keys, $value);
         } elseif (!is_integer($param) and in_array($param, $keys)) {
             $value = '[FILTERED]';
         }
     }
     return $params;
 }
 private static function build_notice_for($exception, array $options = array())
 {
     if ($exception instanceof \Exception) {
         $options['exception'] = self::unwrap_exception($exception);
     } elseif (Arr::is_array($exception)) {
         $options = Arr::merge($options, $exception);
     }
     return Notice::factory($options);
 }
Beispiel #3
0
 /**
  * Tests Arr::is_array()
  *
  * @test
  * @dataProvider provider_is_array
  * @param mixed   $value     Value to check
  * @param boolean $expected  Is $value an array?
  */
 public function test_is_array($array, $expected)
 {
     $this->assertSame($expected, Arr::is_array($array));
 }