8000 [PropertyInfo] Fix array caching · symfony/symfony@7bc58bf · GitHub
[go: up one dir, main page]

Skip to content

Commit 7bc58bf

Browse files
committed
[PropertyInfo] Fix array caching
`null` values aren't cached because of the use of `isset`
1 parent 0fe4be9 commit 7bc58bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private function extract($method, array $arguments)
108108

109109
$key = $this->escape($method.'.'.$serializedArguments);
110110

111-
if (isset($this->arrayCache[$key])) {
111+
if (array_key_exists($key, $this->arrayCache)) {
112112
return $this->arrayCache[$key];
113113
}
114114

src/Symfony/Component/PropertyInfo/Tests/Fixtures/NullExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function getProperties($class, array $context = array())
7979
private function assertIsString($string)
8080
{
8181
if (!is_string($string)) {
82-
throw new \Exception(sprintf('"%s" expects strings, given "%s".', __CLASS__, gettype($string)));
82+
throw new \InvalidArgumentException(sprintf('"%s" expects strings, given "%s".', __CLASS__, gettype($string)));
8383
}
8484
}
8585
}

0 commit comments

Comments
 (0)
0