From 20059a7495e0202b0fadd14e0cac237b3ca80ca3 Mon Sep 17 00:00:00 2001 From: Oscar Otero Date: Mon, 4 Nov 2019 23:54:56 +0100 Subject: [PATCH] hotfix: make the filename mandatory on scan strings --- src/Scanner/CodeScanner.php | 2 +- src/Scanner/FunctionsScannerInterface.php | 2 +- src/Scanner/Scanner.php | 2 +- src/Scanner/ScannerInterface.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Scanner/CodeScanner.php b/src/Scanner/CodeScanner.php index 5415f7a9..84fee6aa 100644 --- a/src/Scanner/CodeScanner.php +++ b/src/Scanner/CodeScanner.php @@ -51,7 +51,7 @@ public function getFunctions(): array return $this->functions; } - public function scanString(string $string, string $filename = null): void + public function scanString(string $string, string $filename): void { $functionsScanner = $this->getFunctionsScanner(); $functions = $functionsScanner->scan($string, $filename); diff --git a/src/Scanner/FunctionsScannerInterface.php b/src/Scanner/FunctionsScannerInterface.php index ae4d9844..0386b722 100644 --- a/src/Scanner/FunctionsScannerInterface.php +++ b/src/Scanner/FunctionsScannerInterface.php @@ -8,5 +8,5 @@ interface FunctionsScannerInterface /** * @return ParsedFunction[] */ - public function scan(string $code, string $filename = null): array; + public function scan(string $code, string $filename): array; } diff --git a/src/Scanner/Scanner.php b/src/Scanner/Scanner.php index 9d068c09..91a5ed0d 100644 --- a/src/Scanner/Scanner.php +++ b/src/Scanner/Scanner.php @@ -45,7 +45,7 @@ public function scanFile(string $filename): void $this->scanString($string, $filename); } - abstract public function scanString(string $string, string $filename = null): void; + abstract public function scanString(string $string, string $filename): void; protected function saveTranslation( ?string $domain, diff --git a/src/Scanner/ScannerInterface.php b/src/Scanner/ScannerInterface.php index f4833426..b93db2a8 100644 --- a/src/Scanner/ScannerInterface.php +++ b/src/Scanner/ScannerInterface.php @@ -18,5 +18,5 @@ public function getTranslations(): array; public function scanFile(string $filename): void; - public function scanString(string $string, string $filename = null): void; + public function scanString(string $string, string $filename): void; }