Skip to content

Commit

Permalink
Task: Remove deprecated curly brace syntax for accessing string offsets
Browse files Browse the repository at this point in the history
This syntax is deprecated as of php 7.4 in favor of the use of square brackets.
  • Loading branch information
mficzel committed Jan 24, 2020
1 parent 92dfc63 commit ec7e895
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Classes/Parser/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Lexer
public function __construct($string)
{
$this->string = $string;
$this->currentCharacter = ($string !== '') ? $string{0} : null;
$this->currentCharacter = ($string !== '') ? $string[0] : null;
$this->characterPosition = 0;
}

Expand Down Expand Up @@ -250,7 +250,7 @@ public function isEnd(): bool
*/
public function rewind(): void
{
$this->currentCharacter = $this->string{--$this->characterPosition};
$this->currentCharacter = $this->string[--$this->characterPosition];
}

/**
Expand All @@ -277,7 +277,7 @@ public function consume(): ?string
{
$c = $this->currentCharacter;
if ($this->characterPosition < strlen($this->string) - 1) {
$this->currentCharacter = $this->string{++$this->characterPosition};
$this->currentCharacter = $this->string[++$this->characterPosition];
} else {
$this->currentCharacter = null;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/AfxService.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ protected static function astNodeToFusion($payload, $indentation = '')
// seperate between attributes (before the first spread), meta attributes
// spreads and attributes lists between and after spreads
foreach ($attributes as $attribute) {
if ($attribute['type'] === 'prop' && $attribute['payload']['identifier']{0} === '@') {
if ($attribute['type'] === 'prop' && $attribute['payload']['identifier'][0] === '@') {
$metaAttributes[] = $attribute;
} elseif ($attribute['type'] === 'prop' && $spreadIsPresent === false) {
$fusionAttributes[] = $attribute;
Expand Down

0 comments on commit ec7e895

Please sign in to comment.