| Conditions | 6 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanedev\Support\Bases; |
||
| 29 | public function getDirty() |
||
| 30 | { |
||
| 31 | $dirty = []; |
||
| 32 | $original = $this->getCastedOriginal(); |
||
| 33 | |||
| 34 | foreach ($this->attributes as $key => $value) { |
||
| 35 | if ($this->hasCast($key, $value)) { |
||
| 36 | $value = $this->castAttribute($key, $value); |
||
| 37 | } |
||
| 38 | |||
| 39 | if ( |
||
| 40 | ! array_key_exists($key, $original) || |
||
| 41 | ($value !== $original[$key] && ! $this->originalIsNumericallyEquivalent($key)) |
||
| 42 | ) { |
||
| 43 | $dirty[$key] = $value; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | return $dirty; |
||
| 48 | } |
||
| 49 | |||
| 66 |