Skip to content

Commit

Permalink
hotfix: make the filename mandatory on scan strings
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Nov 4, 2019
1 parent 817ab56 commit 20059a7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Scanner/CodeScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Scanner/FunctionsScannerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion src/Scanner/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/Scanner/ScannerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 20059a7

Please sign in to comment.