diff --git a/composer.json b/composer.json index 94f04e95f..69f5e6b0c 100755 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "guzzlehttp/psr7": "^1.2", "monolog/monolog": "^1.17.1 || ^2.0.0", "phpdocumentor/reflection-docblock": "^4.0.0 || ^3.0.3", - "symfony/serializer": "^4.4.0" + "symfony/serializer": "^4.4.0 || ^5.0.0" }, "require-dev": { "phpunit/phpunit": "^7.5", diff --git a/src/Google/AdsApi/AdWords/AdWordsNormalizer.php b/src/Google/AdsApi/AdWords/AdWordsNormalizer.php index d6275c624..7970503ae 100755 --- a/src/Google/AdsApi/AdWords/AdWordsNormalizer.php +++ b/src/Google/AdsApi/AdWords/AdWordsNormalizer.php @@ -73,6 +73,7 @@ final class AdWordsNormalizer extends GetSetMethodNormalizer { private $docBlockFactory; + protected $callbacks = []; // not private for symfony 4 compatibility /** * @see GetSetMethodNormalizer::__construct() @@ -110,7 +111,7 @@ public function normalize($object, $format = null, array $context = []) $attributeValue = $reflMethod->invoke($object); if ($attributeValue !== null) { - if (array_key_exists('normalize', $this->callbacks)) { + if (isset($this->callbacks['normalize'])) { $attributeValue = call_user_func( $this->callbacks['normalize'], $attributeValue, @@ -207,7 +208,7 @@ public function denormalize( $this->docBlockFactory->create($getter->getDocComment()) ); - if (array_key_exists('denormalize', $this->callbacks)) { + if (isset($this->callbacks['denormalize'])) { $value = call_user_func( $this->callbacks['denormalize'], $value, diff --git a/src/Google/AdsApi/AdWords/BatchJobs/v201809/BatchJobsDelegate.php b/src/Google/AdsApi/AdWords/BatchJobs/v201809/BatchJobsDelegate.php index 53be0823a..51095f6c8 100755 --- a/src/Google/AdsApi/AdWords/BatchJobs/v201809/BatchJobsDelegate.php +++ b/src/Google/AdsApi/AdWords/BatchJobs/v201809/BatchJobsDelegate.php @@ -120,7 +120,7 @@ public function __construct( ); $this->batchJobSerializer = new Serializer( [$adWordsNormalizer, new ArrayDenormalizer()], - [new XmlEncoder('ns1:mutate')] + [new XmlEncoder([XmlEncoder::ROOT_NODE_NAME => 'ns1:mutate'])] ); }