public function addIgnoredProperty(string $type, $propertyNames): void
    {
        if (!is_string($propertyNames) && !is_array($propertyNames)) {
            throw new InvalidArgumentException('Property name must be a string or array of strings');
        }

        if (!isset($this->ignoredEncodedPropertyNamesByType[$type])) {
            $this->ignoredEncodedPropertyNamesByType[$type] = [];
        }

        foreach ((array)$propertyNames as $propertyName) {
            $this->ignoredEncodedPropertyNamesByType[$type][$this->normalizePropertyName($propertyName)] = true;
        }
    }
public function addIgnoredProperty(string $type, $propertyNames): void
    {
        if (!is_string($propertyNames) && !is_array($propertyNames)) {
            throw new InvalidArgumentException('Property name must be a string or array of strings');
        }

        if (!isset($this->ignoredEncodedPropertyNamesByType[$type])) {
            $this->ignoredEncodedPropertyNamesByType[$type] = [];
        }

        foreach ((array)$propertyNames as $propertyName) {
            $this->ignoredEncodedPropertyNamesByType[$type][$this->normalizePropertyName($propertyName)] = true;
        }
    }
public function addIgnoredProperty ( string $ type , $ propertyNames ) : void { if ( ! is_string ( $ propertyNames ) && ! is_array ( $ propertyNames ) ) { throw new InvalidArgumentException ( 'Property name must be a string or array of strings' ) ; } if ( ! isset ( $ this -> ignoredEncodedPropertyNamesByType [ $ type ] ) ) { $ this -> ignoredEncodedPropertyNamesByType [ $ type ] = [ ] ; } foreach ( ( array ) $ propertyNames as $ propertyName ) { $ this -> ignoredEncodedPropertyNamesByType [ $ type ] [ $ this -> normalizePropertyName ( $ propertyName ) ] = true ; } }
Adds a property to ignore during encoding

@param string $type The type whose property we're ignoring
@param string|string[] $propertyNames The name or list of names of the properties to ignore
@throws InvalidArgumentException Thrown if the property names were not a string or array
Adds a property to ignore during encoding