Verify if in all elements the condition is once accepted

@param array $arr The array to be used
@param $callback Function fired in array elements
@return bool
483760
public static function only(array $arr, callable $callback): bool
    {
        $arrLength = 0;

        foreach ($arr as $index => $value) {
            if ($callback($value, $index) === true) {
                $arrLength++;
            }
        }

        return $arrLength === 1;
    }
170589
public static function doesArrayContainOnlyStringKeys($arr)
    {
        if (!is_array($arr) || empty($arr)) {
            return false;
        }

        return count(array_filter(array_keys($arr), 'is_string')) == count(array_keys($arr));
    }
1179109
protected static function isArrayAssoc($arr)
    {
        $arr = (array)$arr;
        if (array() === $arr) return false;
        return array_keys($arr) !== range(0, count($arr) - 1);
    }
950549
public function _is_associative_array($arr) {
		foreach ( array_keys($arr) as $key => $val ) {
			if ($key!==$val) {
				return TRUE;
			}
		}
		return FALSE;
	}
825230
public static function after($arr, $i) {
		$res = [];
		$do = false;
		foreach($arr as $k=>$v) {
			if($do)
				$res[$k] = $v;
			if($k === $i)
				$do = true;
		}
		return $res;
	}
751426
public function is(callable $callback) {
    foreach ($this->nodes as $node) {
      if ($callback($node)) {
        return TRUE;
      }
    }
    return FALSE;
  }
1004966
public static function containsAllKeys(array $arr, array $keys)
    {
        foreach($keys as $key)
        {
            if( !isset( $arr[$key] ) )
                return false;
        }

        return true;
    }
74488
public static function some(array $set, Closure $callback) {
        foreach ($set as $value) {
            if ($callback($value, $value)) {
                return true;
            }
        }

        return false;
    }
217215
public function containsCallback(callable $callback)
	{
		// Normalize the callback
		$pc = new ProgrammableCallback($callback);
		$callback = $pc->getCallback();
		foreach ($this->items as $filter)
		{
			if ($callback === $filter->getCallback())
			{
				return true;
			}
		}

		return false;
	}
695120
private function isCallbackBlacklisted($callback, $listener)
    {
        return ((ContainerOnLoadCallbackListener::class === $listener)
                && \is_array($callback)
                && ('checkPermission' === $callback[1])
                && (0 === strpos($callback[0], 'tl_')));
    }
178018
public static function find(array $arr, callable $callback)
    {
        foreach ($arr as $index => $value) {
            if ($callback($value, $index) === true) {
                return $value;
            }
        }

        return null;
    }
274625
private function validate_helper_input( $helper ) {
		if ( ! is_array( $helper ) || empty( $helper ) ) {
			return false;
		}

		if ( !  isset( $helper[ 'name' ] ) || ! isset( $helper[ 'class' ]  ) ) {
			return false;
		}

		//if not set, set callback name to "helper"
		if ( ! isset( $helper[ 'callback' ] ) ) {
			$helper[ 'callback' ] = 'helper';
		}

		return $helper;

	}
8620
protected static function isArrayObject($arr)
    {
        foreach(array_keys($arr) as $key) {
            if (!is_int($key)) {
                return true;
            }
        }

        return false;
    }
471109
public static boolean haveCommonElement(int[] arra, int[] arrb,
            int bcount) {

        for (int i = 0; i < arra.length; i++) {
            int c = arra[i];

            for (int j = 0; j < bcount; j++) {
                if (c == arrb[j]) {
                    return true;
                }
            }
        }

        return false;
    }
238950
function allSame(arr) {
    if (!check.array(arr)) {
      return false;
    }
    if (!arr.length) {
      return true;
    }
    var first = arr[0];
    return arr.every(function (item) {
      return item === first;
    });
  }
324699
public static function isIndexedArray($arr)
    {
        if (!is_array($arr)) {
            return false;
        }
        if (array_values($arr) === $arr) {
            return true;
        }
        return false;
    }
729093
public function checkRequired(array $arr){
        //Filter out null values
        $filtered = $this->filterNull($arr);
        
        if(isset($this->required_trans))
            throw new MissingRequiredFieldsException;
        
        //check if all required fields are present
        return count(array_intersect_key(array_flip($this->required_trans), $filtered)) === count($this->required_trans);
    }