Skip to content

Commit

Permalink
Merge pull request #219 from AlexandruGG/feature/new-spread-mutators
Browse files Browse the repository at this point in the history
Add Docs for New Spread Mutators
  • Loading branch information
maks-rafalko committed Jul 4, 2021
2 parents 0094a4f + 55f9e4a commit 2787501
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/guide/mutators.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,14 @@ infection.json:

| Name | Original | Mutated |
| :------: | :------: |:-------:|
| Spread | [...$collection, 2, 3] | [[...$collection][0], 2, 3] |
| Coalesce | $foo ?? $bar | $bar ?? $foo |
| Concat | $foo . $bar | $bar . $foo |
| Ternary | isset($b) ? 'B' : 'C' | isset($b) ? 'C' : 'B' |
| NullSafeMethodCall | $object?->getObject() | $object->getObject() |
| NullSafePropertyCall | $object?->property | $object->property |
| Coalesce | `$foo ?? $bar` | `$bar ?? $foo` |
| Concat | `$foo . $bar` | `$bar . $foo` |
| NullSafeMethodCall | `$object?->getObject()` | `$object->getObject()` |
| NullSafePropertyCall | `$object?->property` | `$object->property` |
| SpreadAssignment | `$array = [...$collection]` | `$array = $collection` |
| SpreadOneItem | `[...$collection, 2, 3]` | `[[...$collection][0], 2, 3]` |
| SpreadRemoval | `[...$collection, 2, 3]` | `[$collection, 2, 3]` |
| Ternary | `isset($b) ? 'B' : 'C'` | `isset($b) ? 'C' : 'B'` |


### Increments
Expand Down
4 changes: 3 additions & 1 deletion src/guide/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ Contains the following mutators:
* [Coalesce](/guide/mutators.html#Boolean-Substitution)
* [Continue_](/guide/mutators.html#Loop)
* [Finally_](/guide/mutators.html#Exceptions)
* [Spread](/guide/mutators.html#Operator)
* [SpreadAssignment](/guide/mutators.html#Operator)
* [SpreadOneItem](/guide/mutators.html#Operator)
* [SpreadRemoval](/guide/mutators.html#Operator)
* [Throw_](/guide/mutators.html#Exceptions)

### `@regex`
Expand Down

0 comments on commit 2787501

Please sign in to comment.