From 92dfc63663d6d4c77a35caec537bb9a2a607c929 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Fri, 24 Jan 2020 08:29:57 +0100 Subject: [PATCH 1/2] TASK: Add php 7.4 to travis tests --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 08b6a2f..1dbd714 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,5 @@ language: php php: - '7.2' - '7.3' + - '7.4' script: composer test From ec7e895fd6aa33e0d23332f1f8401f15f32dacc9 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Fri, 24 Jan 2020 08:40:03 +0100 Subject: [PATCH 2/2] Task: Remove deprecated curly brace syntax for accessing string offsets This syntax is deprecated as of php 7.4 in favor of the use of square brackets. --- Classes/Parser/Lexer.php | 6 +++--- Classes/Service/AfxService.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/Parser/Lexer.php b/Classes/Parser/Lexer.php index 059a4dd..dddf2d8 100644 --- a/Classes/Parser/Lexer.php +++ b/Classes/Parser/Lexer.php @@ -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; } @@ -250,7 +250,7 @@ public function isEnd(): bool */ public function rewind(): void { - $this->currentCharacter = $this->string{--$this->characterPosition}; + $this->currentCharacter = $this->string[--$this->characterPosition]; } /** @@ -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; } diff --git a/Classes/Service/AfxService.php b/Classes/Service/AfxService.php index b766402..2a1284f 100644 --- a/Classes/Service/AfxService.php +++ b/Classes/Service/AfxService.php @@ -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;