/** * @param array $diffOp * * @return DiffOp * @throws InvalidArgumentException */ public function newFromArray(array $diffOp) { $this->assertHasKey('type', $diffOp); // see EntityDiff::getType() and ItemDiff::getType() if (preg_match('!^diff/(.*)$!', $diffOp['type'], $matches)) { $itemType = $matches[1]; $this->assertHasKey('operations', $diffOp); $operations = $this->createOperations($diffOp['operations']); $diff = EntityDiff::newForType($itemType, $operations); return $diff; } return parent::newFromArray($diffOp); }