Skip to content

Commit

Permalink
Merge pull request #232 from azjezz/shell-exception-output
Browse files Browse the repository at this point in the history
bug(shell): include stdout/stderr output in exception message
  • Loading branch information
azjezz authored Oct 3, 2021
2 parents 3d4b50f + 9ad8118 commit 3860787
Show file tree
Hide file tree
Showing 16 changed files with 158 additions and 123 deletions.
2 changes: 1 addition & 1 deletion docs/component/collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#### `Classes`

- [Map](./../../src/Psl/Collection/Map.php#L20)
- [Map](./../../src/Psl/Collection/Map.php#L18)
- [MutableMap](./../../src/Psl/Collection/MutableMap.php#L18)
- [MutableVector](./../../src/Psl/Collection/MutableVector.php#L17)
- [Vector](./../../src/Psl/Collection/Vector.php#L17)
Expand Down
37 changes: 19 additions & 18 deletions src/Psl/Collection/AccessibleCollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function keys(): AccessibleCollectionInterface;
* `AccessibleCollectionInterface` values.
*
* @return AccessibleCollectionInterface<Tk, Tv> A `AccessibleCollectionInterface` containing the values
* after a user-specified condition is applied.
* after a user-specified condition is applied.
*/
public function filter(callable $fn): AccessibleCollectionInterface;

Expand All @@ -69,8 +69,8 @@ public function filter(callable $fn): AccessibleCollectionInterface;
* `AccessibleCollectionInterface` keys and values.
*
* @return AccessibleCollectionInterface<Tk, Tv> A `AccessibleCollectionInterface` containing the values
* after a user-specified condition is applied to the keys and values
* of the current `AccessibleCollectionInterface`.
* after a user-specified condition is applied to the keys and values
* of the current `AccessibleCollectionInterface`.
*/
public function filterWithKey(callable $fn): AccessibleCollectionInterface;

Expand All @@ -90,7 +90,7 @@ public function filterWithKey(callable $fn): AccessibleCollectionInterface;
* `AccessibleCollectionInterface` values.
*
* @return AccessibleCollectionInterface<Tk, Tu> A `AccessibleCollectionInterface` containing key/value
* pairs after a user-specified operation is applied.
* pairs after a user-specified operation is applied.
*/
public function map(callable $fn): AccessibleCollectionInterface;

Expand All @@ -111,8 +111,8 @@ public function map(callable $fn): AccessibleCollectionInterface;
* `AccessibleCollectionInterface` keys and values.
*
* @return AccessibleCollectionInterface<Tk, Tu> A `AccessibleCollectionInterface` containing the values
* after a user-specified operation on the current
* `AccessibleCollectionInterface`'s keys and values is applied.
* after a user-specified operation on the current
* `AccessibleCollectionInterface`'s keys and values is applied.
*/
public function mapWithKey(callable $fn): AccessibleCollectionInterface;

Expand Down Expand Up @@ -185,8 +185,9 @@ public function linearSearch(mixed $search_value): int|string|null;
* elements of this `AccessibleCollectionInterface`.
*
* @return AccessibleCollectionInterface<Tk, array{0: Tv, 1: Tu}> The `AccessibleCollectionInterface` that
* combines the values of the current `AccessibleCollectionInterface`
* with the provided `iterable`.
* combines the values of the current
* `AccessibleCollectionInterface`
* with the provided `iterable`.
*
* @psalm-mutation-free
*/
Expand All @@ -205,8 +206,8 @@ public function zip(iterable $iterable): AccessibleCollectionInterface;
* `AccessibleCollectionInterface`.
*
* @return AccessibleCollectionInterface<Tk, Tv> A `AccessibleCollectionInterface` that is a proper
* subset of the current `AccessibleCollectionInterface` up
* to `n` elements.
* subset of the current `AccessibleCollectionInterface` up
* to `n` elements.
*
* @psalm-mutation-free
*/
Expand All @@ -224,8 +225,8 @@ public function take(int $n): AccessibleCollectionInterface;
* condition.
*
* @return AccessibleCollectionInterface<Tk, Tv> A `AccessibleCollectionInterface` that is a proper subset
* of the current `AccessibleCollectionInterface` up until
* the callback returns `false`.
* of the current `AccessibleCollectionInterface` up until
* the callback returns `false`.
*/
public function takeWhile(callable $fn): AccessibleCollectionInterface;

Expand All @@ -242,8 +243,8 @@ public function takeWhile(callable $fn): AccessibleCollectionInterface;
* first one in the returned `AccessibleCollectionInterface`.
*
* @return AccessibleCollectionInterface<Tk, Tv> A `AccessibleCollectionInterface` that is a proper subset
* of the current `AccessibleCollectionInterface` containing values
* after the specified `n`-th element.
* of the current `AccessibleCollectionInterface` containing values
* after the specified `n`-th element.
*
* @psalm-mutation-free
*/
Expand All @@ -261,8 +262,8 @@ public function drop(int $n): AccessibleCollectionInterface;
* returned `AccessibleCollectionInterface`.
*
* @return AccessibleCollectionInterface<Tk, Tv> A `AccessibleCollectionInterface` that is a proper subset
* of the current `AccessibleCollectionInterface` starting after
* the callback returns `true`.
* of the current `AccessibleCollectionInterface` starting after
* the callback returns `true`.
*/
public function dropWhile(callable $fn): AccessibleCollectionInterface;

Expand All @@ -282,8 +283,8 @@ public function dropWhile(callable $fn): AccessibleCollectionInterface;
* @param int $length The length of the returned `AccessibleCollectionInterface`
*
* @return AccessibleCollectionInterface<Tk, Tv> A `AccessibleCollectionInterface` that is a proper subset
* of the current `AccessibleCollectionInterface` starting at `$start`
* up to but not including the element `$start + $length`.
* of the current `AccessibleCollectionInterface` starting at `$start`
* up to but not including the element `$start + $length`.
*
* @psalm-mutation-free
*/
Expand Down
24 changes: 13 additions & 11 deletions src/Psl/Collection/CollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function jsonSerialize(): array;
* `CollectionInterface` values.
*
* @return CollectionInterface<Tk, Tv> A CollectionInterface containing the values after a user-specified
* condition is applied.
* condition is applied.
*/
public function filter(callable $fn): CollectionInterface;

Expand All @@ -85,7 +85,8 @@ public function filter(callable $fn): CollectionInterface;
* `CollectionInterface` keys and values.
*
* @return CollectionInterface<Tk, Tv> A `CollectionInterface` containing the values after a user-specified
* condition is applied to the keys and values of the current `CollectionInterface`.
* condition is applied to the keys and values of
* the current `CollectionInterface`.
*/
public function filterWithKey(callable $fn): CollectionInterface;

Expand All @@ -105,7 +106,7 @@ public function filterWithKey(callable $fn): CollectionInterface;
* `CollectionInterface` values.
*
* @return CollectionInterface<Tk, Tu> A `CollectionInterface` containing key/value pairs after
* a user-specified operation is applied.
* a user-specified operation is applied.
*/
public function map(callable $fn): CollectionInterface;

Expand All @@ -126,7 +127,7 @@ public function map(callable $fn): CollectionInterface;
* `CollectionInterface` keys and values.
*
* @return CollectionInterface<Tk, Tu> A `CollectionInterface` containing the values after a user-specified
* operation on the current `CollectionInterface`'s keys and values is applied.
* operation on the current `CollectionInterface`'s keys and values is applied.
*/
public function mapWithKey(callable $fn): CollectionInterface;

Expand All @@ -145,7 +146,8 @@ public function mapWithKey(callable $fn): CollectionInterface;
* elements of this `CollectionInterface`.
*
* @return CollectionInterface<Tk, array{0: Tv, 1: Tu}> The `CollectionInterface` that combines
* the values of the current `CollectionInterface` with the provided `iterable`.
* the values of the current `CollectionInterface`
* with the provided `iterable`.
*
* @psalm-mutation-free
*/
Expand All @@ -164,7 +166,7 @@ public function zip(iterable $iterable): CollectionInterface;
* `CollectionInterface`.
*
* @return CollectionInterface<Tk, Tv> A `CollectionInterface` that is a proper subset of the current
* `CollectionInterface` up to `n` elements.
* `CollectionInterface` up to `n` elements.
*
* @psalm-mutation-free
*/
Expand All @@ -182,7 +184,7 @@ public function take(int $n): CollectionInterface;
* condition.
*
* @return CollectionInterface<Tk, Tv> A `CollectionInterface` that is a proper subset of the current
* `CollectionInterface` up until the callback returns `false`.
* `CollectionInterface` up until the callback returns `false`.
*/
public function takeWhile(callable $fn): CollectionInterface;

Expand All @@ -199,7 +201,7 @@ public function takeWhile(callable $fn): CollectionInterface;
* first one in the returned `CollectionInterface`.
*
* @return CollectionInterface<Tk, Tv> A `CollectionInterface` that is a proper subset of the current
* `CollectionInterface` containing values after the specified `n`-th element.
* `CollectionInterface` containing values after the specified `n`-th element.
*
* @psalm-mutation-free
*/
Expand All @@ -217,7 +219,7 @@ public function drop(int $n): CollectionInterface;
* returned `CollectionInterface`.
*
* @return CollectionInterface<Tk, Tv> A `CollectionInterface` that is a proper subset of the current
* `CollectionInterface` starting after the callback returns `true`.
* `CollectionInterface` starting after the callback returns `true`.
*/
public function dropWhile(callable $fn): CollectionInterface;

Expand All @@ -237,8 +239,8 @@ public function dropWhile(callable $fn): CollectionInterface;
* @param int $length The length of the returned `CollectionInterface`.
*
* @return CollectionInterface<Tk, Tv> A `CollectionInterface` that is a proper subset of the current
* `CollectionInterface` starting at `$start` up to but not including
* the element `$start + $length`.
* `CollectionInterface` starting at `$start` up to but not including
* the element `$start + $length`.
*
* @psalm-mutation-free
*/
Expand Down
24 changes: 11 additions & 13 deletions src/Psl/Collection/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
use Psl\Iter;
use Psl\Vec;

use function count;

/**
* @template Tk of array-key
* @template Tv
Expand Down Expand Up @@ -272,7 +270,7 @@ public function keys(): Vector
* `Map` values.
*
* @return Map<Tk, Tv> A Map containing the values after a user-specified condition
* is applied.
* is applied.
*/
public function filter(callable $fn): Map
{
Expand All @@ -294,7 +292,7 @@ public function filter(callable $fn): Map
* `Map` keys and values.
*
* @return Map<Tk, Tv> A `Map` containing the values after a user-specified
* condition is applied to the keys and values of the current `Map`.
* condition is applied to the keys and values of the current `Map`.
*/
public function filterWithKey(callable $fn): Map
{
Expand All @@ -317,7 +315,7 @@ public function filterWithKey(callable $fn): Map
* `Map` values.
*
* @return Map<Tk, Tu> A `Map` containing key/value pairs after a user-specified
* operation is applied.
* operation is applied.
*/
public function map(callable $fn): Map
{
Expand All @@ -341,7 +339,7 @@ public function map(callable $fn): Map
* `Map` keys and values.
*
* @return Map<Tk, Tu> A `Map` containing the values after a user-specified
* operation on the current `Map`'s keys and values is applied.
* operation on the current `Map`'s keys and values is applied.
*/
public function mapWithKey(callable $fn): Map
{
Expand All @@ -363,7 +361,7 @@ public function mapWithKey(callable $fn): Map
* elements of this `Map`.
*
* @return Map<Tk, array{0: Tv, 1: Tu}> The `Map` that combines the values of the current
* `Map` with the provided `iterable`.
* `Map` with the provided `iterable`.
*
* @psalm-mutation-free
*/
Expand Down Expand Up @@ -412,7 +410,7 @@ public function zip(iterable $iterable): Map
* @throws Psl\Exception\InvariantViolationException If $n is negative.
*
* @return Map<Tk, Tv> A `Map` that is a proper subset of the current
* `Map` up to `n` elements.
* `Map` up to `n` elements.
*
* @psalm-mutation-free
*/
Expand All @@ -433,7 +431,7 @@ public function take(int $n): Map
* condition.
*
* @return Map<Tk, Tv> A `Map` that is a proper subset of the current
* `Map` up until the callback returns `false`.
* `Map` up until the callback returns `false`.
*/
public function takeWhile(callable $fn): Map
{
Expand All @@ -455,7 +453,7 @@ public function takeWhile(callable $fn): Map
* @throws Psl\Exception\InvariantViolationException If $n is negative.
*
* @return Map<Tk, Tv> A `Map` that is a proper subset of the current
* `Map` containing values after the specified `n`-th element.
* `Map` containing values after the specified `n`-th element.
*
* @psalm-mutation-free
*/
Expand All @@ -476,7 +474,7 @@ public function drop(int $n): Map
* returned `Map`.
*
* @return Map<Tk, Tv> A `Map` that is a proper subset of the current
* `Map` starting after the callback returns `true`.
* `Map` starting after the callback returns `true`.
*/
public function dropWhile(callable $fn): Map
{
Expand All @@ -499,8 +497,8 @@ public function dropWhile(callable $fn): Map
*
* @throws Psl\Exception\InvariantViolationException If $start or $length are negative.
*
* @return Map<Tk, Tv> A `Map` that is a proper subset of the current
* `Map` starting at `$start` up to but not including the element `$start + $length`.
* @return Map<Tk, Tv> A `Map` that is a proper subset of the current
* `Map` starting at `$start` up to but not including the element `$start + $length`.
*
* @psalm-mutation-free
*/
Expand Down
Loading

0 comments on commit 3860787

Please sign in to comment.