/**
  * Find all items in an array that pass the truth test
  */
 public static function filter($array, $closure = null)
 {
     if (!$closure) {
         return ArraysMethods::clean($array);
     }
     return array_filter($array, $closure);
 }
Exemple #2
0
 /**
  * Get the caching hash of the Method
  *
  * @param array $parameters The parameters to hash
  *
  * @return string
  */
 protected function createHashFromParameters($parameters)
 {
     $parameters = Arrays::sortKeys($parameters);
     $parameters = Arrays::clean($parameters);
     $hash = array();
     foreach ($parameters as $k => $v) {
         $hash[] = $k . '-' . $v;
     }
     if ($this->user) {
         $hash[] = $this->user->getUid();
     }
     return implode('-', $hash);
 }