public function newFromArray( array $diffOp ) {
		$this->assertHasKey( 'type', $diffOp );

		if ( $diffOp['type'] === 'add' ) {
			$this->assertHasKey( 'newvalue', $diffOp );
			return new DiffOpAdd( $this->arrayToObject( $diffOp['newvalue'] ) );
		}

		if ( $diffOp['type'] === 'remove' ) {
			$this->assertHasKey( 'oldvalue', $diffOp );
			return new DiffOpRemove( $this->arrayToObject( $diffOp['oldvalue'] ) );
		}

		if ( $diffOp['type'] === 'change' ) {
			$this->assertHasKey( 'newvalue', $diffOp );
			$this->assertHasKey( 'oldvalue', $diffOp );
			return new DiffOpChange(
				$this->arrayToObject( $diffOp['oldvalue'] ),
				$this->arrayToObject( $diffOp['newvalue'] ) );
		}

		if ( $diffOp['type'] === 'diff' ) {
			$this->assertHasKey( 'operations', $diffOp );
			$this->assertHasKey( 'isassoc', $diffOp );

			$operations = [];

			foreach ( $diffOp['operations'] as $key => $operation ) {
				$operations[$key] = $this->newFromArray( $operation );
			}

			return new Diff( $operations, $diffOp['isassoc'] );
		}

		throw new InvalidArgumentException( 'Invalid array provided. Unknown type' );
	}