Skip to content

Commit 656e27b

Browse files
authored
Merge pull request #638 from mrpavlikov/feature/symfony-5-support
#637 symfony 5 support added
2 parents 56bfd42 + 6c64188 commit 656e27b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"guzzlehttp/psr7": "^1.2",
1212
"monolog/monolog": "^1.17.1 || ^2.0.0",
1313
"phpdocumentor/reflection-docblock": "^4.0.0 || ^3.0.3",
14-
"symfony/serializer": "^4.4.0"
14+
"symfony/serializer": "^4.4.0 || ^5.0.0"
1515
},
1616
"require-dev": {
1717
"phpunit/phpunit": "^7.5",

src/Google/AdsApi/AdWords/AdWordsNormalizer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ final class AdWordsNormalizer extends GetSetMethodNormalizer
7373
{
7474

7575
private $docBlockFactory;
76+
protected $callbacks = []; // not private for symfony 4 compatibility
7677

7778
/**
7879
* @see GetSetMethodNormalizer::__construct()
@@ -110,7 +111,7 @@ public function normalize($object, $format = null, array $context = [])
110111
$attributeValue = $reflMethod->invoke($object);
111112

112113
if ($attributeValue !== null) {
113-
if (array_key_exists('normalize', $this->callbacks)) {
114+
if (isset($this->callbacks['normalize'])) {
114115
$attributeValue = call_user_func(
115116
$this->callbacks['normalize'],
116117
$attributeValue,
@@ -207,7 +208,7 @@ public function denormalize(
207208
$this->docBlockFactory->create($getter->getDocComment())
208209
);
209210

210-
if (array_key_exists('denormalize', $this->callbacks)) {
211+
if (isset($this->callbacks['denormalize'])) {
211212
$value = call_user_func(
212213
$this->callbacks['denormalize'],
213214
$value,

src/Google/AdsApi/AdWords/BatchJobs/v201809/BatchJobsDelegate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function __construct(
120120
);
121121
$this->batchJobSerializer = new Serializer(
122122
[$adWordsNormalizer, new ArrayDenormalizer()],
123-
[new XmlEncoder('ns1:mutate')]
123+
[new XmlEncoder([XmlEncoder::ROOT_NODE_NAME => 'ns1:mutate'])]
124124
);
125125
}
126126

0 commit comments

Comments
 (0)