From c7d9f0096547c17aae31f76c6582e7d606c8f8ca Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Tue, 5 Nov 2019 12:37:25 -0500 Subject: [PATCH] Replace foreachs with for loops --- src/Editor.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Editor.php b/src/Editor.php index 0e5a942..6bc2cf3 100644 --- a/src/Editor.php +++ b/src/Editor.php @@ -127,9 +127,9 @@ class Editor { } // Update the syntax highlighting for all the rows of the file - foreach ($this->rows as $row) + for ($i = 0; $i < $this->numRows; $i++) { - $row->updateSyntax(); + $this->rows[$i]->updateSyntax(); } return; @@ -926,9 +926,9 @@ class Editor { private function refreshPHPSyntax(): void { $this->syntax->tokens = get_php_tokens($this->rowsToString()); - foreach($this->rows as $row) + for ($i = 0; $i < $this->numRows; $i++) { - $row->updateSyntax(); + $this->rows[$i]->updateSyntax(); } } }