adyen-php-api-library icon indicating copy to clipboard operation
adyen-php-api-library copied to clipboard

Wrong parameter type in metadata functions

Open GunniBusch opened this issue 1 year ago • 0 comments

In this function, the parameter type also includes null. but it should not be null.

Could there be just no action if it is null?

    /**
     * Sets metadata
     *
     * @param array<string,string>|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value.
     *
     * @return self
     */
    public function setMetadata($metadata)
    {
        if (is_null($metadata)) {
            throw new \InvalidArgumentException('non-nullable metadata cannot be null');
        }
        $this->container['metadata'] = $metadata;

        return $this;
    }

PS: it is in all setMetadata functions.

GunniBusch avatar Apr 30 '24 12:04 GunniBusch