<?php /** * Global functions and initialization. * @author Alexander Prokhorov * @license Simplified BSD * @link https://github.com/Athari/YaLinqo YaLinqo on GitHub */ \YaLinqo\Functions::init(); \YaLinqo\Utils::init(); if (!function_exists('from')) { /** * Create Enumerable from an array or any other traversible source. * @param array|\Iterator|\IteratorAggregate|\YaLinqo\Enumerable $source * @throws \InvalidArgumentException If source is not array or Traversible or Enumerable. * @return \YaLinqo\Enumerable * @see \YaLinqo\Enumerable::from */ function from($source) { return \YaLinqo\Enumerable::from($source); } }
/** @covers YaLinqo\Functions::init */ function testInit() { F::init(); }
self::$blank = function () { }; self::$compareStrict = function ($a, $b) { if ($a === $b) { return 0; } elseif ($a > $b) { return 1; } else { return -1; } }; self::$compareLoose = function ($a, $b) { if ($a == $b) { return 0; } elseif ($a > $b) { return 1; } else { return -1; } }; } public static function increment() { $i = 0; return function () use(&$i) { return $i++; }; } } Functions::init();