Skip to content

Commit 16ee1b4

Browse files
Merge branch '6.4' into 7.3
* 6.4: [Routing] Fix case sensitivity for static host matching in compiled routes [Routing] Fix localized prefix updates breaking aliases [Routing] Fix addNamePrefix breaking aliases to external routes [Workflow] Fix MethodMarkingStore crash with inherited uninitialized properties [AssetMapper] Fix entrypoint status lost during update [Console] Fix completion for global options values
2 parents 5276a31 + b08c5ad commit 16ee1b4

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

MarkingStore/MethodMarkingStore.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ public function getMarking(object $subject): Marking
5353
try {
5454
$marking = ($this->getGetter($subject))();
5555
} catch (\Error $e) {
56-
$unInitializedPropertyMessage = \sprintf('Typed property %s::$%s must not be accessed before initialization', get_debug_type($subject), $this->property);
57-
if ($e->getMessage() !== $unInitializedPropertyMessage) {
56+
if (!str_starts_with($e->getMessage(), 'Typed property ') || !str_ends_with($e->getMessage(), '::$'.$this->property.' must not be accessed before initialization')) {
5857
throw $e;
5958
}
6059
}

Tests/MarkingStore/MethodMarkingStoreTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ public function testGetMarkingWithUninitializedProperty2()
107107
$markingStore->getMarking($subject);
108108
}
109109

110+
public function testGetMarkingWithUninitializedPropertyInheritance()
111+
{
112+
$subject = new ChildInheritingProperty();
113+
114+
$markingStore = new MethodMarkingStore(true, 'place');
115+
$marking = $markingStore->getMarking($subject);
116+
117+
$this->assertCount(0, $marking->getPlaces());
118+
}
119+
110120
private function createValueObject(string $markingValue): object
111121
{
112122
return new class($markingValue) {
@@ -124,3 +134,12 @@ public function __toString(): string
124134
};
125135
}
126136
}
137+
138+
class ParentWithProperty
139+
{
140+
public string $place;
141+
}
142+
143+
class ChildInheritingProperty extends ParentWithProperty
144+
{
145+
}

0 commit comments

Comments
 (0)