Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/Google/AdsApi/AdWords/AdWordsNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ final class AdWordsNormalizer extends GetSetMethodNormalizer
{

private $docBlockFactory;
protected $callbacks = []; // not private for symfony 4 compatibility

/**
* @see GetSetMethodNormalizer::__construct()
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'])]
);
}

Expand Down