Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
odan authored Feb 11, 2021
1 parent bbaa461 commit b4f4e2a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,22 @@ composer require selective/transformer

## Introduction

This Transformer component provides functionality to map, cast and loop array values from one array to another array.

Converting complex data with simple PHP works by using a lot of type casting, `if` conditions and looping through the
data with `foreach()`. This leads to very high cyclomatic complexity and nesting depth, and thus poor "code rating".

This Transformer component provides functionality to map, cast and loop array values from one array to another array.
**Before**: Conditions: 9, Paths: 256, CRAP Score: 9
<details>
<summary>Click to expand!</summary>
<img src="https://user-images.githubusercontent.com/781074/107609324-e3c45880-6c3e-11eb-9ca0-ed27e420ec13.png">
</details>

**After**: Conditions: 1, Paths: 1, CRAP Score: 1
<details>
<summary>Click to expand!</summary>
<img src="https://user-images.githubusercontent.com/781074/107609468-4584c280-6c3f-11eb-8f10-3cd42bc27b74.png">
</details>

### Use Cases

Expand Down

0 comments on commit b4f4e2a

Please sign in to comment.