Skip to content

Commit 98a2d1a

Browse files
committed
fix: remove usage of deprecated string offset access syntax
In three files, the string offset access syntax with curly braces was used, which causes errors when executed under PHP 7.4. [ fixes #8 ]
1 parent 7b061f9 commit 98a2d1a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/TestCase/SetupTargetTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function setupTarget(): void
127127
$nameParts = explode(' ', $this->getName());
128128
$name = reset($nameParts);
129129
$set = end($nameParts);
130-
$set = '#' == $set{0} || '"' == $set{0} ? trim($set, '"') : '';
130+
$set = '#' == $set[0] || '"' == $set[0] ? trim($set, '"') : '';
131131

132132
foreach ($specs as $spec) {
133133
$for = isset($spec['for']) ? (array) $spec['for'] : ['*'];

src/Utils/Instance.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static function create($fqcn, ...$arguments): object
7474
);
7575
}
7676

77-
if ('!' == $fqcn{0}) {
77+
if ('!' == $fqcn[0]) {
7878
return self::reflection(substr($fqcn, 1));
7979
}
8080

@@ -142,7 +142,7 @@ public static function withMappedArguments($fqcn, $arguments, ?object $context =
142142
break;
143143

144144
// '@function'
145-
case is_string($value) && '@' == $value{0}:
145+
case is_string($value) && '@' == $value[0]:
146146
$callback = ltrim($value, '@');
147147
break;
148148

src/Utils/Target.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static function get(
6868
return $target;
6969
}
7070

71-
if (!$forceObject && is_string($target) && '!' != $target{0}) {
71+
if (!$forceObject && is_string($target) && '!' != $target[0]) {
7272
return $target;
7373
}
7474

0 commit comments

Comments
 (0)