Skip to content

Commit 7aaded9

Browse files
Merge branch '7.4' into 8.0
* 7.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 [ObjectMapper] map to embedded object with property access [FrameworkBundle] Make `APP_*_DIR` relative to the project directory [Console] Fix completion for global options values
2 parents ff5a718 + 9f309bd commit 7aaded9

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->getters[$subject::class] ??= $this->getGetter($subject))($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
@@ -125,6 +125,16 @@ public function testGetMarkingWithUninitializedProperty2()
125125
$markingStore->getMarking($subject);
126126
}
127127

128+
public function testGetMarkingWithUninitializedPropertyInheritance()
129+
{
130+
$subject = new ChildInheritingProperty();
131+
132+
$markingStore = new MethodMarkingStore(true, 'place');
133+
$marking = $markingStore->getMarking($subject);
134+
135+
$this->assertCount(0, $marking->getPlaces());
136+
}
137+
128138
public function testGetMarkingWithSameSubjectMultipleTimes()
129139
{
130140
$subject1 = new Subject('first_place');
@@ -218,3 +228,12 @@ public function __toString(): string
218228
};
219229
}
220230
}
231+
232+
class ParentWithProperty
233+
{
234+
public string $place;
235+
}
236+
237+
class ChildInheritingProperty extends ParentWithProperty
238+
{
239+
}

0 commit comments

Comments
 (0)