| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 3 | public function newFromArray( array $diffOp ) { |
|
| 26 | 3 | $this->assertHasKey( 'type', $diffOp ); |
|
| 27 | |||
| 28 | // see EntityDiff::getType() and ItemDiff::getType() |
||
| 29 | 2 | if ( preg_match( '!^diff/(.*)$!', $diffOp['type'], $matches ) ) { |
|
| 30 | 1 | $itemType = $matches[1]; |
|
| 31 | 1 | $this->assertHasKey( 'operations', $diffOp ); |
|
| 32 | |||
| 33 | 1 | $operations = $this->createOperations( $diffOp['operations'] ); |
|
| 34 | 1 | $diff = EntityDiff::newForType( $itemType, $operations ); |
|
| 35 | |||
| 36 | 1 | return $diff; |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | return parent::newFromArray( $diffOp ); |
|
| 40 | } |
||
| 60 |