Esempio n. 1
0
 /**
  * Returns an array of this class' constant names which are defined
  * in this instance
  * @return string[]
  */
 public function getNames()
 {
     $isSet = PHPArray::filter(static::getConstants(), function ($value) {
         return $this->hasFlag($value);
     });
     return \array_keys($isSet);
 }
Esempio n. 2
0
 /**
  * Whether any item passes a predicate function
  * @param \Closure $predicate
  * @return bool
  */
 public function some(\Closure $predicate)
 {
     return PHPArray::some($this->_Arr, $predicate);
 }
Esempio n. 3
0
 public function testSome()
 {
     $arr = array(3, 2, 1);
     $r = PHPArray::some($arr, function ($item) {
         return $item >= 2;
     });
     $this->assertTrue($r);
 }