Skip to content

Commit cc1f2b8

Browse files
committed
Fix NullMetadata performance issue
1 parent f44eefc commit cc1f2b8

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/Metadata/MetadataFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ public function getMetadataForClass($className)
112112
}
113113

114114
if (null !== $this->cache && !$this->debug) {
115-
$this->cache->putClassMetadataInCache(new NullMetadata());
115+
$this->cache->putClassMetadataInCache(new NullMetadata($class->getName()));
116116
}
117117
}
118118

119119
if (null === $metadata) {
120-
$metadata = new NullMetadata();
120+
$metadata = new NullMetadata($className);
121121
}
122122

123123
return $this->filterNullMetadata($this->loadedMetadata[$className] = $metadata);

src/Metadata/NullMetadata.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,5 @@
99
*/
1010
class NullMetadata extends ClassMetadata
1111
{
12-
public function __construct()
13-
{
1412

15-
}
16-
17-
public function serialize()
18-
{
19-
return '';
20-
}
21-
22-
public function unserialize($str)
23-
{
24-
25-
}
2613
}

0 commit comments

Comments
 (0)