private function preSetElement( $index, DiffOp $value ): bool {
		if ( $this->isAssociative === false && ( $value->getType() !== 'add' && $value->getType() !== 'remove' ) ) {
			throw new InvalidArgumentException( 'Diff operation with invalid type "' . $value->getType() . '" provided.' );
		}

		if ( array_key_exists( $value->getType(), $this->typePointers ) ) {
			$this->typePointers[$value->getType()][] = $index;
		}
		else {
			throw new InvalidArgumentException( 'Diff operation with invalid type "' . $value->getType() . '" provided.' );
		}

		return true;
	}
private function preSetElement( $index, DiffOp $value ): bool {
		if ( $this->isAssociative === false && ( $value->getType() !== 'add' && $value->getType() !== 'remove' ) ) {
			throw new InvalidArgumentException( 'Diff operation with invalid type "' . $value->getType() . '" provided.' );
		}

		if ( array_key_exists( $value->getType(), $this->typePointers ) ) {
			$this->typePointers[$value->getType()][] = $index;
		}
		else {
			throw new InvalidArgumentException( 'Diff operation with invalid type "' . $value->getType() . '" provided.' );
		}

		return true;
	}
private function preSetElement ( $ index , DiffOp $ value ) : bool { if ( $ this -> isAssociative === false && ( $ value -> getType ( ) !== 'add' && $ value -> getType ( ) !== 'remove' ) ) { throw new InvalidArgumentException ( 'Diff operation with invalid type "' . $ value -> getType ( ) . '" provided.' ) ; } if ( array_key_exists ( $ value -> getType ( ) , $ this -> typePointers ) ) { $ this -> typePointers [ $ value -> getType ( ) ] [ ] = $ index ; } else { throw new InvalidArgumentException ( 'Diff operation with invalid type "' . $ value -> getType ( ) . '" provided.' ) ; } return true ; }
Gets called before a new element is added to the ArrayObject.

At this point the index is always set (ie not null) and the
value is always of the type returned by @see getObjectType.

Should return a boolean. When false is returned the element
does not get added to the ArrayObject.

@param int|string $index
@param DiffOp $value

@return bool
@throws InvalidArgumentException
Gets called before a new element is added to the ArrayObject .