{"id":13579032,"url":"https://github.com/miroshnikov/idles","last_synced_at":"2025-09-16T20:13:30.789Z","repository":{"id":57017513,"uuid":"457534363","full_name":"miroshnikov/idles","owner":"miroshnikov","description":"PHP functional utility library, port of javascript Lodash/Ramda, a set of side-effect free, immutable and automatically curried functions that support lazy evaluation.","archived":false,"fork":false,"pushed_at":"2024-10-07T14:58:59.000Z","size":2494,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-05T23:40:07.614Z","etag":null,"topics":["functional","lodash","php","php-library","ramda","toolbox","toolkit","tools","utilities","utility","utility-library","utils"],"latest_commit_sha":null,"homepage":"https://idlephp.tech","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miroshnikov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-09T21:28:28.000Z","updated_at":"2024-10-07T14:58:36.000Z","dependencies_parsed_at":"2022-08-22T11:31:39.281Z","dependency_job_id":"2fcb530b-ded5-4ef6-9922-6fc892a87a2e","html_url":"https://github.com/miroshnikov/idles","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"c0a066e7dc8629ef7e473a3e4a24cb16b6b06461"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miroshnikov%2Fidles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miroshnikov%2Fidles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miroshnikov%2Fidles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miroshnikov%2Fidles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miroshnikov","download_url":"https://codeload.github.com/miroshnikov/idles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238281053,"owners_count":19446078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["functional","lodash","php","php-library","ramda","toolbox","toolkit","tools","utilities","utility","utility-library","utils"],"created_at":"2024-08-01T15:01:35.962Z","updated_at":"2025-09-16T20:13:30.773Z","avatar_url":"https://github.com/miroshnikov.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://idlephp.tech\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://github.com/miroshnikov/idles/blob/main/docs/assets/logo.png\" width=\"128\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n# IDLES - a PHP functional library\nA PHP functional utility library, port of Javascript Lodash/Fp and Ramda libraries to PHP.\n\nAll functions are \u003cstrong\u003eside-effect free\u003c/strong\u003e and \u003cstrong\u003eautomatically curried\u003c/strong\u003e, data is \u003cstrong\u003eimmutable\u003c/strong\u003e.\n\nThe iterable collection parameter is usually supplied last to make currying convenient.\n\n\u003cstrong\u003eLazy / delayed evaluation\u003c/strong\u003e is supported in functional pipelines.\n\nGo to __[https://idlephp.tech](https://idlephp.tech)__ for more details, documentation and examples.\n\n## Requirements\n`PHP 7.4` or higher\n\n## Installation\n`composer require miroshnikov/idles`\n\n## Roadmap\n\u003e [!NOTE]  \n\u003e Idles is currently under active development. \n\u003e Roadmap is to add all methods from Lodash and Ramda libraries and some functional tools.\n\n## Documentation\n\n### Array\n#### [concat](https://idlephp.tech/#concat)\n\n```php\nconcat(?iterable $array, $value): iterable\n```\n\nConcatinates `$array` with additional iterables/values\n\n#### [count](https://idlephp.tech/#count)\n\n```php\ncount(callable $predicate, ?iterable $collection): int\n```\n\nCounts the number of items in `$collection` matching the `$predicate`\n\n#### [countBy](https://idlephp.tech/#countBy)\n\n```php\ncountBy(callable $iteratee, ?iterable $collection): array\n```\n\nReturns an array: [`$iteratee($value)` =\u003e number of times the `$iteratee($value)` was found in `$collection`]\n\n#### [drop](https://idlephp.tech/#drop)\n\n```php\ndrop(int $n, ?iterable $collection): iterable\n```\n\nSkips the first `$n` elemens and returns the rest of the iterable\n\n#### [dropRight](https://idlephp.tech/#dropRight)\n\n```php\ndropRight(int $n, ?iterable $collection): iterable\n```\n\nSkips the last `$n` elements\n\n#### [findIndex](https://idlephp.tech/#findIndex)\n\n```php\nfindIndex(callable $predicate, ?iterable $collection): int\n```\n\nLike `find` but returns the index of the first element predicate returns truthy for, `-1` if not found\n\n#### [findLastIndex](https://idlephp.tech/#findLastIndex)\n\n```php\nfindLastIndex(callable $predicate, ?iterable $collection): int\n```\n\nLike `find` but returns the index of the last element predicate returns truthy for, `-1` if not found\n\n#### [flatten](https://idlephp.tech/#flatten)\n\n```php\nflatten(?iterable $collection): iterable\n```\n\nFlattens iterable a single level deep.\n\n#### [flattenDeep](https://idlephp.tech/#flattenDeep)\n\n```php\nflattenDeep(?iterable $collection): iterable\n```\n\nRecursively flattens iterable.\n\n#### [flattenDepth](https://idlephp.tech/#flattenDepth)\n\n```php\nflattenDepth(int $depth, ?iterable $collection): iterable\n```\n\nRecursively flatten array up to depth times.\n\n#### [fromPairs](https://idlephp.tech/#fromPairs)\n\n```php\nfromPairs(?iterable $collection): array\n```\n\nCreates a new record from a list key-value pairs. The inverse of `toPairs`.\n\n#### [head](https://idlephp.tech/#head)\n\n```php\nhead(?iterable $collecton)\n```\n\nGets the first element of iterable\n\n#### [indexOf](https://idlephp.tech/#indexOf)\n\n```php\nindexOf($value, ?iterable|string $collection): int\n```\n\nReturns the index of the first occurrence of `$value` in iterable or string, else -1.\n\n#### [intersection](https://idlephp.tech/#intersection)\n\n```php\nintersection(?iterable $record1, ?iterable $record2): array\n```\n\nReturns unique values that are included in both records\n\n#### [intersectionBy](https://idlephp.tech/#intersectionBy)\n\n```php\nintersectionBy(callable $iteratee, ?iterable $record1, ?iterable $record2): array\n```\n\nLike `intersection` but invokes `$iteratee` for each element before comparison.\n\n#### [intersectionWith](https://idlephp.tech/#intersectionWith)\n\n```php\nintersectionWith(callable $comparator, ?iterable $record1, ?iterable $record2): array\n```\n\nLike `intersection` but invokes `$comparator` to compare elements.\n\n#### [join](https://idlephp.tech/#join)\n\n```php\njoin(string $separator, ?iterable $collection): string\n```\n\nJoins iterable elements separated by `$separator`\n\n#### [last](https://idlephp.tech/#last)\n\n```php\nlast(?iterable $collecton)\n```\n\nGets the last element of iterable\n\n#### [lastIndexOf](https://idlephp.tech/#lastIndexOf)\n\n```php\nlastIndexOf($value, ?iterable|string $collection): int\n```\n\nReturns the index of the last occurrence of `$value` in iterable or string, else -1.\n\n#### [nth](https://idlephp.tech/#nth)\n\n```php\nnth(int $offset, ?iterable $collection)\n```\n\nReturns the `$offset` element. If `$offset` is negative the element at index length + `$offset` is returned.\n\n#### [remove](https://idlephp.tech/#remove)\n\n```php\nremove(int $start, int $count, ?iterable $iterable): array\n```\n\nRemoves items from `$iterable` starting at `$start` and containing `$count` elements.\n\n#### [slice](https://idlephp.tech/#slice)\n\n```php\nslice(int $start, int ?$end, ?iterable $collection): iterable\n```\n\nRetruns a slice of `$iterable` from `$start` up to, but not including, `$end`.\n\n#### [splitAt](https://idlephp.tech/#splitAt)\n\n```php\nsplitAt(int $index, array|string $array): array\n```\n\nSplits a given array or string at a given index.\n\n#### [splitEvery](https://idlephp.tech/#splitEvery)\n\n```php\nsplitEvery(int $length, array|string $array): array\n```\n\nSplits an array or string into slices of the specified length\n\n#### [splitWhen](https://idlephp.tech/#splitWhen)\n\n```php\nsplitWhen(callable $predicate, array $array): array\n```\n\nSplits an array by predicate.\n\n#### [splitWhenever](https://idlephp.tech/#splitWhenever)\n\n```php\nsplitWhenever(callable $predicate, array $array): array\n```\n\nSplits an array into slices on every occurrence of a value.\n\n#### [take](https://idlephp.tech/#take)\n\n```php\ntake(int $n, ?iterable $collection): iterable\n```\n\nTakes n first elements from iterable\n\n#### [takeRight](https://idlephp.tech/#takeRight)\n\n```php\ntakeRight(int $n, ?iterable $collection): array\n```\n\nReturns a slice of iterable with n elements taken from the end.\n\n#### [uniq](https://idlephp.tech/#uniq)\n\n```php\nuniq(?iterable $collection): array\n```\n\nRemoves duplicates using `===`\n\n#### [uniqueBy](https://idlephp.tech/#uniqueBy)\n\n```php\nuniqBy(callable $iteratee, ?iterable $collection): array\n```\n\nLike `uniq` but apply `$iteratee` fist\n\n#### [uniqWith](https://idlephp.tech/#uniqWith)\n\n```php\nuniqWith(callable $predicate, ?iterable $collection): array\n```\n\nLike `uniq` but uses `$predicate` to compare elements\n\n#### [without](https://idlephp.tech/#without)\n\n```php\nwithout(array $values, ?iterable $collection): iterable\n```\n\nReturns `$iterable` without `$values`\n\n#### [zip](https://idlephp.tech/#zip)\n\n```php\nzip(iterable $a, iterable $b): iterable\n```\n\nCreates an iterable of grouped elements, the first of which contains the first elements of the given iterables, the second of which contains the second elements, and so on.\n\n#### [zipWith](https://idlephp.tech/#zipWith)\n\n```php\nzipWith(callable $iteratee, iterable $a, iterable $b): iterable\n```\n\nLike `zip` except that it accepts `$iteratee` to specify how grouped values should be combined.\n\n    \n### Collection\n#### [all](https://idlephp.tech/#all)\n\n```php\nall(?callable $predicate, ?iterable $collection): bool\n```\n\nChecks if `$predicate` returns `truthy` for all elements of `$collection`. Stop once it returns `falsey`\n\n#### [any](https://idlephp.tech/#any)\n\n```php\nany(callable $predicate, ?iterable $collection): bool\n```\n\nChecks if `$predicate` returns truthy for any element of `$collection`. Stops on first found.\n\n#### [each](https://idlephp.tech/#each)\n\n```php\neach(callable $iteratee, ?iterable $collection): iterable\n```\n\nIterates over elements of `$collection`. Iteratee may exit iteration early by returning `false`.\n\n#### [filter](https://idlephp.tech/#filter)\n\n```php\nfilter(callable $predicate, ?iterable $collection): iterable\n```\n\nReturns elements `$predicate` returns truthy for.\n\n#### [find](https://idlephp.tech/#find)\n\n```php\nfind(?callable $predicate, ?iterable $collection)\n```\n\nReturns the first element `$predicate` returns truthy for.\n\n#### [flatMap](https://idlephp.tech/#flatMap)\n\n```php\nflatMap(callable $iteratee, ?iterable $collection): iterable\n```\n\nMaps then flatten\n\n#### [flatMapDeep](https://idlephp.tech/#flatMapDeep)\n\n```php\nflatMapDeep(callable $iteratee, ?iterable $collection): iterable\n```\n\nLike `flatMap` but recursively flattens the results.\n\n#### [flatMapDepth](https://idlephp.tech/#flatMapDepth)\n\n```php\nflatMapDepth(callable $iteratee, int $depth, ?iterable $collection): iterable\n```\n\nLike `flatMap` but flattens the mapped results up to `$depth` times\n\n#### [groupBy](https://idlephp.tech/#groupBy)\n\n```php\ngroupBy(callable $iteratee, ?iterable $collection): array\n```\n\nCreates an array composed of keys generated from running each value through `$iteratee`.\n\n#### [includes](https://idlephp.tech/#includes)\n\n```php\nincludes($value, ?iterable $collection): bool\n```\n\nChecks if `$value` is in `$collection`.\n\n#### [indexBy](https://idlephp.tech/#indexBy)\n\n```php\nindexBy(callable $iteratee, ?iterable $collection): iterable\n```\n\nCreates a record composed of keys generated from the results of running each element of `$collection` through `$iteratee`.\n\n#### [map](https://idlephp.tech/#map)\n\n```php\nmap(callable $iteratee, ?iterable $collection)\n```\n\nRun each element in `$collection` through `$iteratee`.\n\n#### [orderBy](https://idlephp.tech/#orderBy)\n\n```php\norderBy(array $iteratees, array $orders, ?iterable $collection)\n```\n\nLike `sortBy` but allows specifying the sort orders\n\n#### [partition](https://idlephp.tech/#partition)\n\n```php\npartition(callable $predicate, ?iterable $collection): array\n```\n\nSplit `$collection` into two groups, the first of which contains elements `$predicate` returns truthy for, the second of which contains elements `$predicate` returns falsey for.\n\n#### [reduce](https://idlephp.tech/#reduce)\n\n```php\nreduce(callable $iteratee, $accumulator, ?iterable $collection)\n```\n\nReduces `$collection` to a value which is the accumulated result of running each element in collection through `$iteratee`\n\n#### [resolve](https://idlephp.tech/#resolve)\n\n```php\nresolve(array $resolvers, array $record): array\n```\n\nAdds new properties to `$record` using `$resolvers`.\n\n#### [sort](https://idlephp.tech/#sort)\n\n```php\nsort(array $comparator, ?iterable $collection): array\n```\n\nSorts `$collection` using `$comparator` comparison (`$a \u003c=\u003e $b`) function\n\n#### [sortBy](https://idlephp.tech/#sortBy)\n\n```php\nsortBy(array $comparators, ?iterable $collection): array\n```\n\nSorts `$collection` in ascending order according to `$comparators`.\n\n#### [sortWith](https://idlephp.tech/#sortWith)\n\n```php\nsortWith(array $comparators, ?iterable $collection): array\n```\n\nSorts a `$collection` according to an array of comparison (`$a \u003c=\u003e $b`) functions\n\n#### [values](https://idlephp.tech/#values)\n\n```php\nvalues(?iterable $collection): iterable\n```\n\nReturns an indexed iterable of values in `$collection`.\n\n    \n### Function\n#### [always](https://idlephp.tech/#always)\n\n```php\nalways($value)\n```\n\nReturns a function that always returns the given value.\n\n#### [apply](https://idlephp.tech/#apply)\n\n```php\napply(callable $fn, ?iterable $args)\n```\n\nCalls `$fn(...$args)`\n\n#### [applyTo](https://idlephp.tech/#applyTo)\n\n```php\napplyTo($value, callable $interceptor)\n```\n\nReturns `$interceptor($value)`.\n\n#### [ary](https://idlephp.tech/#ary)\n\n```php\nary(int $n, callable $fn): callable\n```\n\nCreates a function that invokes `$fn`, with up to `$n` arguments, ignoring any additional arguments.\n\n#### [ascend](https://idlephp.tech/#ascend)\n\n```php\nascend(callable $func, $a, $b): callable\n```\n\nMakes an ascending comparator function out of a function that returns a value that can be compared with `\u003c=\u003e`\n\n#### [attempt](https://idlephp.tech/#attempt)\n\n```php\nattempt(callable $fn)\n```\n\nCalls `$fn`, returning either the result or the caught exception.\n\n#### [compose](https://idlephp.tech/#compose)\n\n```php\ncompose(callable ...$funcs): callable\n```\n\nLike `pipe` but invokes the functions from right to left.\n\n#### [curry](https://idlephp.tech/#curry)\n\n```php\ncurry(callable $f): callable\n```\n\n`\\Idles\\_` const may be used as a placeholder.\n\n#### [curryRight](https://idlephp.tech/#curryRight)\n\n```php\ncurryRight(callable $f): callable\n```\n\nLike `curry` but arguments are prepended.\n\n#### [descend](https://idlephp.tech/#descend)\n\n```php\ndescend(callable $func, $a, $b): callable\n```\n\nMakes an descending comparator function out of a function that returns a value that can be compared with `\u003c=\u003e`\n\n#### [flip](https://idlephp.tech/#flip)\n\n```php\nflip(callable $fn): callable\n```\n\nReturns a new curried function with the first two arguments reversed\n\n#### [juxt](https://idlephp.tech/#juxt)\n\n```php\njuxt(array $funcs): callable\n```\n\nApplies a list of functions to a list of values.\n\n#### [memoize](https://idlephp.tech/#memoize)\n\n```php\nmemoize(callable $func): callable\n```\n\nCreates a function that memoizes the result of `$func`. `$resolver` returns map cache key, args[0] by default.\n\n#### [negate](https://idlephp.tech/#negate)\n\n```php\nnegate(callable $predicate): callable\n```\n\nCreates a function that negates the result of the `$predicate` function.\n\n#### [nthArg](https://idlephp.tech/#nthArg)\n\n```php\nnthArg(int $n): callable\n```\n\nReturns a function which returns its `$n`th argument.\n\n#### [once](https://idlephp.tech/#once)\n\n```php\nonce(callable $fn): callable\n```\n\n`$fn` is only called once, the first value is returned in subsequent invocations.\n\n#### [partial](https://idlephp.tech/#partial)\n\n```php\npartial(callable $fn, array $partials): callable\n```\n\nCreates a function that invokes `$fn` with `$partials` prepended to the arguments. `\\Idles\\_` const may be used as a placeholder.\n\n#### [partialRight](https://idlephp.tech/#partialRight)\n\n```php\npartialRight(callable $fn, array $partials): callable\n```\n\nLike `partial` but `$partials` are appended.\n\n#### [pipe](https://idlephp.tech/#pipe)\n\n```php\npipe(callable ...$funcs): callable\n```\n\nLeft-to-right function composition. The first argument may have any arity; the remaining arguments must be unary.\n\n#### [rearg](https://idlephp.tech/#rearg)\n\n```php\nrearg(array $indexes, callable $f): callable\n```\n\nReturns a function that invokes `$f` with arguments rearranged by `props($indexes)`\n\n#### [tap](https://idlephp.tech/#tap)\n\n```php\ntap(callable $interceptor, $value)\n```\n\nCalls `$interceptor($value)` then returns the original `$value`\n\n#### [times](https://idlephp.tech/#times)\n\n```php\ntimes(callable $iteratee, int $n): array\n```\n\nCalls the iteratee `$n` times, returning an array of the results of each invocation.\n\n#### [tryCatch](https://idlephp.tech/#tryCatch)\n\n```php\ntryCatch(callable $tryer, callable $catcher, $value)\n```\n\nCalls `$tryer`, if it throws, calls `$catcher`\n\n#### [unapply](https://idlephp.tech/#unapply)\n\n```php\nunapply(callable $fn)\n```\n\nReturns `fn (...$args) =\u003e $fn($args)`\n\n#### [unary](https://idlephp.tech/#unary)\n\n```php\nunary(callable $fn): callable\n```\n\n`ary(1, $fn)`\n\n#### [useWith](https://idlephp.tech/#useWith)\n\n```php\nuseWith(callable $fn, array $transformers)\n```\n\nApplies each transformer function to each argument.\n\n    \n### Logic\n#### [allPass](https://idlephp.tech/#allPass)\n\n```php\nallPass(array $predicates): callable\n```\n\nReturns a function that checks if its arguments pass all `$predicates`.\n\n#### [anyPass](https://idlephp.tech/#anyPass)\n\n```php\nanyPass(array $predicates): callable\n```\n\nReturns a function that checks if its arguments pass any of the `$predicates`.\n\n#### [both](https://idlephp.tech/#both)\n\n```php\nboth(callable $func1, callable $func2): callable\n```\n\nResulting function returns `$func1(...$args)` if it is falsy or `$func2(...$args)` otherwise, short-circuited\n\n#### [cond](https://idlephp.tech/#cond)\n\n```php\ncond(array $pairs): callable\n```\n\nIterates over `$pairs` and invokes the corresponding function of the first predicate to return truthy.\n\n#### [defaultTo](https://idlephp.tech/#defaultTo)\n\n```php\ndefaultTo($default)($value)\n```\n\nReturns `$value` ?? `$default`\n\n#### [either](https://idlephp.tech/#either)\n\n```php\neither(callable $func1, callable $func2): callable\n```\n\nResulting function returns `$func1(...$args)` if it is truthy or `$func2(...$args)` otherwise, short-circuited.\n\n#### [ifElse](https://idlephp.tech/#ifElse)\n\n```php\nifElse(callable $predicate, callable $onTrue, callable $onFalse): callable\n```\n\nResulting function returns `$onTrue(...$args)` if `$predicate(...$args)` is truthy or `$onFalse(...$args)` otherwise.\n\n#### [not](https://idlephp.tech/#not)\n\n```php\nnot($a): bool\n```\n\nreturns `!$a`\n\n#### [unless](https://idlephp.tech/#unless)\n\n```php\nunless(callable $predicate, callable $whenFalse, mixed $value)\n```\n\nReturns `$predicate($value) ? $value : $whenFalse($value)`\n\n#### [when](https://idlephp.tech/#when)\n\n```php\nwhen(callable $predicate, callable $whenTrue, mixed $value)\n```\n\nReturns `$predicate($value) ? $whenTrue($value) : $value`\n\n    \n### Math\n#### [add](https://idlephp.tech/#add)\n\n```php\nadd(int|float $a, int|float $b): int|float\n```\n\n$a + $b\n\n#### [dec](https://idlephp.tech/#dec)\n\n```php\ndec(int $number): int\n```\n\nReturns $number - 1\n\n#### [divide](https://idlephp.tech/#divide)\n\n```php\ndivide(int|float $a, int|float $b): int|float\n```\n\n$a / $b\n\n#### [gt](https://idlephp.tech/#gt)\n\n```php\ngt($a, $b): bool\n```\n\n$a \u003e $b\n\n#### [gte](https://idlephp.tech/#gte)\n\n```php\ngte($a, $b): bool\n```\n\n$a \u003e= $b\n\n#### [inc](https://idlephp.tech/#inc)\n\n```php\ninc(int $number): int\n```\n\nReturns $number + 1\n\n#### [lt](https://idlephp.tech/#lt)\n\n```php\nlt($a, $b): bool\n```\n\n$a \u003c $b\n\n#### [lte](https://idlephp.tech/#lte)\n\n```php\nlte($a, $b): bool\n```\n\n$a \u003c= $b\n\n#### [modulo](https://idlephp.tech/#modulo)\n\n```php\nmodulo(int|float $a, int|float $b): int\n```\n\n$a % $b\n\n#### [multiply](https://idlephp.tech/#multiply)\n\n```php\nmultiply(int|float $a, int|float $b): int|float\n```\n\n$a * $b\n\n#### [round](https://idlephp.tech/#round)\n\n```php\nround(int $precision, int|float $number): float\n```\n\nRounds `$number`to specified `$precision`\n\n#### [subtract](https://idlephp.tech/#subtract)\n\n```php\nsubtract(int|float $a, int|float $b): int|float\n```\n\n$a - $b\n\n#### [sum](https://idlephp.tech/#sum)\n\n```php\nsum(?iterable $collection): int|float\n```\n\nSums elements in iterable\n\n#### [sumBy](https://idlephp.tech/#sumBy)\n\n```php\nsumBy(?callable $iteratee, ?iterable $collection): int|float\n```\n\nLike `sum` but `$iteratee` is invoked for each element in iterable to generate the value to be summed.\n\n    \n### Record\n#### [assignDeep](https://idlephp.tech/#assignDeep)\n\n```php\nassignDeep(array $iterables): array\n```\n\nMerges properties recursively, numeric keys are overwritten.\n\n#### [defaults](https://idlephp.tech/#defaults)\n\n```php\ndefaults(?iterable $record1, ?iterable $record2): array\n```\n\nMerges properties from right to left, numeric keys are overwritten.\n\n#### [evolve](https://idlephp.tech/#evolve)\n\n```php\nevolve(array $transformations, ?iterable $record): array\n```\n\nCreates a new record by recursively calling transformation functions with `$record` properties.\n\n#### [extend](https://idlephp.tech/#extend)\n\n```php\nextend(?iterable $source1, ?iterable $source2): array\n```\n\nMerges properties, numeric keys are overwritten.\n\n#### [has](https://idlephp.tech/#has)\n\n```php\nhas(string|int $key, ?iterable $record): bool\n```\n\nChecks if `$record` has `$key`\n\n#### [hasPath](https://idlephp.tech/#hasPath)\n\n```php\nhasPath(string|int|array $path, ?iterable $record): bool\n```\n\nChecks if `$path` exists in `$record`\n\n#### [invert](https://idlephp.tech/#invert)\n\n```php\ninvert(?iterable $collection): array\n```\n\nReplaces keys with values. Duplicate keys are overwritten.\n\n#### [keys](https://idlephp.tech/#keys)\n\n```php\nkeys(?iterable $record): iterable\n```\n\nReturns an indexed iterable of keys in `$record`.\n\n#### [merge](https://idlephp.tech/#merge)\n\n```php\nmerge(?iterable $source1, ?iterable $source2): array\n```\n\nMerges properties, numeric keys are appended.\n\n#### [mergeDeep](https://idlephp.tech/#mergeDeep)\n\n```php\nmergeDeep(array $iterables): array\n```\n\nMerges properties recursively, numeric keys are appended.\n\n#### [mergeLeft](https://idlephp.tech/#mergeLeft)\n\n```php\nmergeLeft(?iterable $left, ?iterable $right): array\n```\n\ncalls `merge($right, $left)`\n\n#### [mergeWith](https://idlephp.tech/#mergeWith)\n\n```php\nmergeWith(callable $customizer, ?iterable $left, ?iterable $right): array\n```\n\nLike `merge` but if a key exists in both records, `$customizer` is called to the values associated with the key\n\n#### [modifyPath](https://idlephp.tech/#modifyPath)\n\n```php\nmodifyPath(array|string|int $path, callable $updater, ?iterable $record)\n```\n\nCreates new record by applying an `$updater` function to the value at the given `$path`.\n\n#### [objOf](https://idlephp.tech/#objOf)\n\n```php\nobjOf(string $key, $value): array\n```\n\nCreates an `array` containing a single key =\u003e value pair.\n\n#### [omit](https://idlephp.tech/#omit)\n\n```php\nomit(array $keys, ?iterable $collection): iterable\n```\n\nThe opposite of `pick`. Returns record without `$keys`.\n\n#### [omitBy](https://idlephp.tech/#omitBy)\n\n```php\nomitBy(callable $predicate, ?iterable $record): iterable\n```\n\nThe opposite of `pickBy`. Returns properties of `$record` that `$predicate` returns falsey for.\n\n#### [path](https://idlephp.tech/#path)\n\n```php\npath(array|string $path, ?iterable $collection)\n```\n\nRetrieve the value at a given path.\n\n#### [paths](https://idlephp.tech/#paths)\n\n```php\npaths(array $paths, ?iterable $collection): array\n```\n\nKeys in, values out. Order is preserved.\n\n#### [pick](https://idlephp.tech/#pick)\n\n```php\npick(array $keys, ?iterable $collection): iterable\n```\n\nReturns record containing only `$keys`\n\n#### [pickBy](https://idlephp.tech/#pickBy)\n\n```php\npickBy(callable $predicate, ?iterable $record): iterable\n```\n\nReturns record containing only keys `$predicate` returns truthy for.\n\n#### [pluck](https://idlephp.tech/#pluck)\n\n```php\npluck(string|int $key, ?iterable $collection)\n```\n\nReturns a new array by plucking the same named property off all records in the array supplied.\n\n#### [project](https://idlephp.tech/#project)\n\n```php\nproject(array $props, ?iterable $collection)\n```\n\nLike SQL `select` statement.\n\n#### [prop](https://idlephp.tech/#prop)\n\n```php\nprop(string|int $key, ?iterable $record)\n```\n\nReturn the specified property.\n\n#### [propEq](https://idlephp.tech/#propEq)\n\n```php\npropEq(string|int $key, $value, ?iterable $record): bool\n```\n\nReturns $record[$key] == $value\n\n#### [setPath](https://idlephp.tech/#setPath)\n\n```php\nsetPath($path, $value, ?iterable $record)\n```\n\nReturn copy `$record` with `$path` set  with `$value`\n\n#### [toPairs](https://idlephp.tech/#toPairs)\n\n```php\ntoPairs(?iterable $record): iterable\n```\n\nConverts a record into an array of `[$key, $value]`\n\n#### [where](https://idlephp.tech/#where)\n\n```php\nwhere(array $spec, ?iterable $record): bool\n```\n\nChecks if `$record` satisfies the spec by invoking the `$spec` properties with the corresponding properties of `$record`.\n\n#### [whereAny](https://idlephp.tech/#whereAny)\n\n```php\nwhereAny(array $spec, ?iterable $record): bool\n```\n\nChecks if `$record` satisfies the spec by invoking the `$spec` properties with the corresponding properties of `$record`. Returns `true` if at least one of the predicates returns `true`.\n\n#### [whereEq](https://idlephp.tech/#whereEq)\n\n```php\nwhereEq(array $spec, ?iterable $test): bool\n```\n\nCheck if the `$test` satisfies the `$spec`\n\n    \n### String\n#### [camelCase](https://idlephp.tech/#camelCase)\n\n```php\ncamelCase(string $s): string\n```\n\nConverts string to camel case.\n\n#### [capitalize](https://idlephp.tech/#capitalize)\n\n```php\ncapitalize(string $s): string\n```\n\nConverts the first character of string to upper case and the remaining to lower case.\n\n#### [escape](https://idlephp.tech/#escape)\n\n```php\nescape(string $s): string\n```\n\nConverts the characters \"\u0026\", \"\u003c\", \"\u003e\", '\"', and \"'\" to their corresponding HTML entities.\n\n#### [escapeRegExp](https://idlephp.tech/#escapeRegExp)\n\n```php\nescapeRegExp(string $regexp): string\n```\n\nEscapes regular expression\n\n#### [split](https://idlephp.tech/#split)\n\n```php\nsplit(string $separator, string $s): array\n```\n\nSplits string by `$separator` regular expression.\n\n#### [startsWith](https://idlephp.tech/#startsWith)\n\n```php\nstartsWith(string $target, string $s): bool\n```\n\nIf string starts with `$target`.\n\n#### [toLower](https://idlephp.tech/#toLower)\n\n```php\ntoLower(string $s): string\n```\n\nConverts string to lower case\n\n#### [toUpper](https://idlephp.tech/#toUpper)\n\n```php\ntoUpper(string $s): string\n```\n\nConverts string to upper case\n\n#### [trim](https://idlephp.tech/#trim)\n\n```php\ntrim(string $characters, string $string): string\n```\n\nStrip characters from the beginning and end of a string.\n\n#### [trimEnd](https://idlephp.tech/#trimEnd)\n\n```php\ntrimEnd(string $characters, string $string): string\n```\n\nStrip characters from the end of a string.\n\n#### [trimStart](https://idlephp.tech/#trimStart)\n\n```php\ntrimStart(string $characters, string $string): string\n```\n\nStrip characters from the beginning of a string.\n\n#### [words](https://idlephp.tech/#words)\n\n```php\nwords(string $pattern, string $string): array\n```\n\nSplits string into an array of its words.\n\n    \n### Util\n#### [collect](https://idlephp.tech/#collect)\n\n```php\ncollect(?iterable $iterable): array\n```\n\nCollects any iterable into `array`\n\n#### [eq](https://idlephp.tech/#eq)\n\n```php\neq($a, $b): bool\n```\n\n`$a` == `$b`\n\n#### [equals](https://idlephp.tech/#equals)\n\n```php\nequals($a, $b): bool\n```\n\n`$a` === `$b`\n\n#### [F](https://idlephp.tech/#F)\n\n```php\nF(...$args): bool\n```\n\nAlways returns `false`\n\n#### [identity](https://idlephp.tech/#identity)\n\n```php\nidentity($value)\n```\n\nReturns the first argument it receives.\n\n#### [iterate](https://idlephp.tech/#iterate)\n\n```php\niterate(callable $f, $value): iterable\n```\n\nReturns a generator of `$value`, `$f($value)`, `$f($f($value))` etc.\n\n#### [just](https://idlephp.tech/#just)\n\n```php\njust($value): Optional\n```\n\nReturns an Optional with the specified non-null value\n\n#### [nothing](https://idlephp.tech/#nothing)\n\n```php\nnothing(): Optional\n```\n\nReturns an empty Optional\n\n#### [now](https://idlephp.tech/#now)\n\n```php\nnow(): int\n```\n\nReturns the timestamp of the number of seconds\n\n#### [Optional](https://idlephp.tech/#Optional)\n\n```php\njust(mixed $value): Optional\n```\n\nMaybe/Option monad (container) which may or may not contain a non-null value. Has methods:\n\n`isPresent(): bool` - `true` if not empty              \n`isEmpty(): bool` - `true` if empty        \n`get(): mixed` - returns value, throw exception if empty         \n`orElse(mixed $default): mixed` - returns the contained value if the optional is nonempty or `$default`        \n`orElseThrow(Exception $e)` - returns the contained value, if present, otherwise throw an exception        \n`map(callable $f): Optional` - If a value is present, apply the `$f` to it, and if the result is non-null, return an Optional describing the result       \n`flatMap(callable $f): Optional` - use instead of `map` if `$f` returns Optional          \n`filter(callable $predicate): Optional` - if a value is present and matches the `$predicate`, return an Optional with the value, otherwise an empty Optional.  \n\n#### [size](https://idlephp.tech/#size)\n\n```php\nsize(array|Countable|object|string|callable $value): int\n```\n\nReturns size of a countable, number of parameters of a function, lenght of string or number of properties of an object\n\n#### [T](https://idlephp.tech/#T)\n\n```php\nT(...$args): bool\n```\n\nAlways returns `true`\n\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiroshnikov%2Fidles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiroshnikov%2Fidles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiroshnikov%2Fidles/lists"}