Skip to content

fix: remove usage of deprecated string offset access syntax #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TestCase/SetupTargetTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private function setupTarget(): void
$nameParts = explode(' ', $this->getName());
$name = reset($nameParts);
$set = end($nameParts);
$set = '#' == $set{0} || '"' == $set{0} ? trim($set, '"') : '';
$set = '#' == $set[0] || '"' == $set[0] ? trim($set, '"') : '';

foreach ($specs as $spec) {
$for = isset($spec['for']) ? (array) $spec['for'] : ['*'];
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/Instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static function create($fqcn, ...$arguments): object
);
}

if ('!' == $fqcn{0}) {
if ('!' == $fqcn[0]) {
return self::reflection(substr($fqcn, 1));
}

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

// '@function'
case is_string($value) && '@' == $value{0}:
case is_string($value) && '@' == $value[0]:
$callback = ltrim($value, '@');
break;

Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function get(
return $target;
}

if (!$forceObject && is_string($target) && '!' != $target{0}) {
if (!$forceObject && is_string($target) && '!' != $target[0]) {
return $target;
}

Expand Down