Skip to content

Commit 9d37428

Browse files
committed
Prepare for version bump to 0.2.3
1 parent 5058f63 commit 9d37428

7 files changed

Lines changed: 35 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Changelog
22

3-
## v0.2.3-dev
3+
## v0.2.3
44

5-
**2022-??-??[Diff](https://github.com/maciejczyzewski/bottomline/compare/0.2.2...0.2.3)[Docs](https://maciejczyzewski.github.io/bottomline/)**
5+
**2022-03-01[Diff](https://github.com/maciejczyzewski/bottomline/compare/0.2.2...0.2.3)[Docs](https://maciejczyzewski.github.io/bottomline/)**
66

77
* Updates to the `__::slug()` function,
88
- Optimized to be more performant when given plain, old ASCII text
99
- Has a workaround for [a bug in PHP 8.1](https://github.com/php/php-src/issues/7898) that would return an empty string
10-
* Added `__::dropWhile`, `__::dropRight`, and `dropRightWhile`
10+
* Added `__::dropWhile`, `__::dropRight`, and `__::dropRightWhile`
11+
* Fix error in `__::mapKeys` that affected PHP 5.5
1112

1213
## v0.2.2
1314

docs/_data/fxn_registry.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,12 @@
182182
"type": "int"
183183
}
184184
],
185-
"changelog": [],
185+
"changelog": [
186+
{
187+
"version": "0.2.3",
188+
"message": "added to Bottomline"
189+
}
190+
],
186191
"exceptions": [],
187192
"return": {
188193
"type": "array|\\Generator",
@@ -214,7 +219,12 @@
214219
"type": "\\Closure|float|int|string|bool"
215220
}
216221
],
217-
"changelog": [],
222+
"changelog": [
223+
{
224+
"version": "0.2.3",
225+
"message": "added to Bottomline"
226+
}
227+
],
218228
"exceptions": [],
219229
"return": {
220230
"type": "array|\\Generator",
@@ -246,7 +256,12 @@
246256
"type": "\\Closure|float|int|string|bool"
247257
}
248258
],
249-
"changelog": [],
259+
"changelog": [
260+
{
261+
"version": "0.2.3",
262+
"message": "added to Bottomline"
263+
}
264+
],
250265
"exceptions": [],
251266
"return": {
252267
"type": "array|\\Generator",

src/__/__.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
** Sequences [1]
1919
2020
*****************************************************************
21-
* bottomline v0.2.1 *
21+
* bottomline v0.2.3 *
2222
* bottomline is licensed under the MIT license *
2323
* Copyright (c) 2014 Maciej A. Czyzewski *
2424
*****************************************************************/
@@ -33,9 +33,9 @@
3333
* @method static array|\Generator chunk(iterable $iterable, int $size = 1, bool $preserveKeys = false) <p>Creates an array of elements split into groups the length of <code>$size</code>.</p><br><p>If array can't be split evenly, the final chunk will be the remaining elements. When <code>$preserveKeys</code> is set to TRUE, keys will be preserved. Default is FALSE, which will reindex the chunk numerically.</p> <p><strong>Usage</strong></p> <pre><code class="language-php">__::chunk([1, 2, 3, 4, 5], 3);</code></pre> <p><strong>Result</strong></p> <pre><code>[[1, 2, 3], [4, 5]]</code></pre><h2>Changelog</h2><ul><li><p><code>0.2.0</code> - iterable objects are now supported</p></li></ul><h2>Exceptions</h2><ul><li><p><code>\InvalidArgumentException</code> - when an non-array or non-traversable object is given for $iterable.</p></li><li><p><code>\Exception</code> - when an <code>\IteratorAggregate</code> is given and <code>getIterator()</code> throws an exception.</p></li></ul><h2>Returns</h2><p>When given a <code>\Traversable</code> object for <code>$iterable</code>, a generator will be returned. Otherwise, an array will be returned.</p>
3434
* @method static array|\Generator compact(iterable $iterable) <p>Creates an array with all falsey values removed.</p><br><p>The following values are considered falsey:</p> <ul> <li><code>false</code></li> <li><code>null</code></li> <li><code>0</code></li> <li><code>""</code></li> <li><code>undefined</code></li> <li><code>NaN</code></li> </ul> <p><strong>Usage</strong></p> <pre><code class="language-php">__::compact([0, 1, false, 2, '', 3]);</code></pre> <p><strong>Result</strong></p> <pre><code>[1, 2, 3]</code></pre><h2>Changelog</h2><ul><li><p><code>0.2.0</code> - iterable objects are now supported</p></li></ul>
3535
* @method static array|\Generator drop(iterable $input, int $number = 1) <p>Creates a slice of array with n elements dropped from the beginning.</p><br><p><strong>Usage</strong></p> <pre><code class="language-php">__::drop([0, 1, 3, 5], 2);</code></pre> <p><strong>Result</strong></p> <pre><code>[3, 5]</code></pre><h2>Changelog</h2><ul><li><p><code>0.2.0</code> - iterable objects are now supported</p></li></ul>
36-
* @method static array|\Generator dropRight(iterable $input, int $number = 1) <p>Creates a slice of an array with n elements dropped from the end.</p><br><p>If the provided iterator is an array, then an array will be returned. Otherwise, a Generator will be returned. In this latter case, the entire iterable will be buffered in memory. If the iterable contains many elements, then this could cause memory issues.</p> <p><strong>Usage</strong></p> <pre><code class="language-php">__::dropRight([0, 1, 3, 5], 2);</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[0, 1]</code></pre><h2>Returns</h2><p>An array containing a subset of the input array with front items matching the condition removed. If the provided iterable is not an array, then a Generator will be returned.</p>
37-
* @method static array|\Generator dropRightWhile(iterable $input, \Closure|float|int|string|bool $condition) <p>Creates a slice of the provided array with all elements matching the condition removed from the end.</p><br><p>If the provided iterator is an array, then an array will be returned. Otherwise, a Generator will be returned. In this latter case, the entire iterable will be buffered in memory. If the iterable contains many elements, then this could cause memory issues.</p> <p><strong>Drop by Primitive Condition</strong></p> <pre><code class="language-php">__::dropRightWhile([1, 2, 3, 3], 3);</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[1, 2]</code></pre> <p><strong>Drop by Callback</strong></p> <pre><code class="language-php">__::dropRightWhile([1, 2, 3, 4, 5], static function ($item) {<br /> return $item &gt; 3;<br /> });</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[1, 2, 3]</code></pre><h2>Returns</h2><p>An array containing a subset of the input array with front items matching the condition removed. If the provided iterable is not an array, then a Generator will be returned.</p>
38-
* @method static array|\Generator dropWhile(array|iterable $input, \Closure|float|int|string|bool $condition) <p>Creates a slice of the provided array with all elements matching the condition removed from the front.</p><br><p><strong>Drop by Primitive Condition</strong></p> <pre><code class="language-php">__::dropWhile([1, 1, 2, 3, 4], 1);</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[2, 3, 4]</code></pre> <p><strong>Drop by Callback</strong></p> <pre><code class="language-php">__::dropWhile([1, 2, 3, 4, 5], static function ($item) {<br /> return $item &lt; 3;<br /> });</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[3, 4, 5]</code></pre><h2>Returns</h2><p>An array containing a subset of the input array with front items matching the condition removed. If the input was not an array, then a \Generator will be returned.</p>
36+
* @method static array|\Generator dropRight(iterable $input, int $number = 1) <p>Creates a slice of an array with n elements dropped from the end.</p><br><p>If the provided iterator is an array, then an array will be returned. Otherwise, a Generator will be returned. In this latter case, the entire iterable will be buffered in memory. If the iterable contains many elements, then this could cause memory issues.</p> <p><strong>Usage</strong></p> <pre><code class="language-php">__::dropRight([0, 1, 3, 5], 2);</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[0, 1]</code></pre><h2>Changelog</h2><ul><li><p><code>0.2.3</code> - added to Bottomline</p></li></ul><h2>Returns</h2><p>An array containing a subset of the input array with front items matching the condition removed. If the provided iterable is not an array, then a Generator will be returned.</p>
37+
* @method static array|\Generator dropRightWhile(iterable $input, \Closure|float|int|string|bool $condition) <p>Creates a slice of the provided array with all elements matching the condition removed from the end.</p><br><p>If the provided iterator is an array, then an array will be returned. Otherwise, a Generator will be returned. In this latter case, the entire iterable will be buffered in memory. If the iterable contains many elements, then this could cause memory issues.</p> <p><strong>Drop by Primitive Condition</strong></p> <pre><code class="language-php">__::dropRightWhile([1, 2, 3, 3], 3);</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[1, 2]</code></pre> <p><strong>Drop by Callback</strong></p> <pre><code class="language-php">__::dropRightWhile([1, 2, 3, 4, 5], static function ($item) {<br /> return $item &gt; 3;<br /> });</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[1, 2, 3]</code></pre><h2>Changelog</h2><ul><li><p><code>0.2.3</code> - added to Bottomline</p></li></ul><h2>Returns</h2><p>An array containing a subset of the input array with front items matching the condition removed. If the provided iterable is not an array, then a Generator will be returned.</p>
38+
* @method static array|\Generator dropWhile(array|iterable $input, \Closure|float|int|string|bool $condition) <p>Creates a slice of the provided array with all elements matching the condition removed from the front.</p><br><p><strong>Drop by Primitive Condition</strong></p> <pre><code class="language-php">__::dropWhile([1, 1, 2, 3, 4], 1);</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[2, 3, 4]</code></pre> <p><strong>Drop by Callback</strong></p> <pre><code class="language-php">__::dropWhile([1, 2, 3, 4, 5], static function ($item) {<br /> return $item &lt; 3;<br /> });</code></pre> <p><strong>Result</strong></p> <pre><code class="language-php">[3, 4, 5]</code></pre><h2>Changelog</h2><ul><li><p><code>0.2.3</code> - added to Bottomline</p></li></ul><h2>Returns</h2><p>An array containing a subset of the input array with front items matching the condition removed. If the input was not an array, then a \Generator will be returned.</p>
3939
* @method static array|\Generator flatten(iterable $iterable, bool $shallow = false) <p>Flattens a multidimensional array or iterable.</p><br><p>If <code>$shallow</code> is set to TRUE, the array will only be flattened a single level.</p> <p><strong>Usage</strong></p> <pre><code class="language-php">__::flatten([1, 2, [3, [4]]], false);</code></pre> <p><strong>Result</strong></p> <pre><code>[1, 2, 3, 4]</code></pre><h2>Changelog</h2><ul><li><p><code>0.2.0</code> - iterable objects are now supported</p></li></ul>
4040
* @method static array patch(array $array, array $patches, string $parent = '') <p>Patches array by xpath.</p><br><p><strong>Usage</strong></p> <pre><code class="language-php">__::patch(<br /> [<br /> 'addr' =&gt; [<br /> 'country' =&gt; 'US',<br /> 'zip' =&gt; 12345<br /> ]<br /> ],<br /> [<br /> '/addr/country' =&gt; 'CA',<br /> '/addr/zip' =&gt; 54321<br /> ]<br /> );</code></pre> <p><strong>Result</strong></p> <pre><code>['addr' =&gt; ['country' =&gt; 'CA', 'zip' =&gt; 54321]]</code></pre><h2>Returns</h2><p>Returns patched array</p>
4141
* @method static array prepend(array $array, mixed $value = null) <p>Prepend item or value to an array.</p><br><p><strong>Usage</strong></p> <pre><code class="language-php">__::prepend([1, 2, 3], 4);</code></pre> <p><strong>Result</strong></p> <pre><code>[4, 1, 2, 3]</code></pre>

src/__/arrays/dropRight.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ function dropRightArray($input, $number)
6464
* @see dropWhile
6565
* @see dropRightWhile
6666
*
67+
* @since 0.2.3 added to Bottomline
68+
*
6769
* @return array|\Generator An array containing a subset of the input array with front items matching the condition
6870
* removed. If the provided iterable is not an array, then a Generator will be returned.
6971
*/

src/__/arrays/dropRightWhile.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ function dropArrayRightWhile($input, $comparison)
8787
* @see dropRight
8888
* @see dropRightWhile
8989
*
90+
* @since 0.2.3 added to Bottomline
91+
*
9092
* @return array|\Generator An array containing a subset of the input array with front items matching the condition
9193
* removed. If the provided iterable is not an array, then a Generator will be returned.
9294
*/

src/__/arrays/dropWhile.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ function dropArrayWhile($input, $comparison)
9191
* @see dropRight
9292
* @see dropRightWhile
9393
*
94+
* @since 0.2.3 added to Bottomline
95+
*
9496
* @return array|\Generator An array containing a subset of the input array with front
9597
* items matching the condition removed. If the input was not an array, then a \Generator
9698
* will be returned.

0 commit comments

Comments
 (0)