MAPG-199 fix issues found by PHPStan

This commit is contained in:
bence committed 2020-07-05 23:18:56 +02:00
1 parent 39d691fd7f
commit af98d71924
34 files changed
+89 -68

No files matched your search

+7 -7
View File
@@ -108,7 +108,7 @@ class Parser
private function matchCss(string $line): ?string
{
if (preg_match('/^\s*@css\((.*)\)\s*$/', $line, $matches)) {
if (preg_match('/^\s*@css\((.*)\)\s*$/', $line, $matches) === 1) {
return $matches[1];
}
@@ -117,7 +117,7 @@ class Parser
private function matchJs(string $line): ?string
{
if (preg_match('/^\s*@js\((.*)\)\s*$/', $line, $matches)) {
if (preg_match('/^\s*@js\((.*)\)\s*$/', $line, $matches) === 1) {
return $matches[1];
}
@@ -126,7 +126,7 @@ class Parser
private function matchExtends(string $line): ?string
{
if (preg_match('/^\s*@extends\(([\w\/]+)\)\s*$/', $line, $matches)) {
if (preg_match('/^\s*@extends\(([\w\/]+)\)\s*$/', $line, $matches) === 1) {
return $matches[1];
}
@@ -135,7 +135,7 @@ class Parser
private function matchSection(string $line): ?string
{
if (preg_match('/^\s*@section\((\w+)\)\s*$/', $line, $matches)) {
if (preg_match('/^\s*@section\((\w+)\)\s*$/', $line, $matches) === 1) {
return $matches[1];
}
@@ -144,16 +144,16 @@ class Parser
private function matchEndSection(string $line): bool
{
return preg_match('/^\s*@endsection(?:\(\))?\s*$/', $line);
return preg_match('/^\s*@endsection(?:\(\))?\s*$/', $line) === 1;
}
private function matchExtra(string $line): bool
{
return preg_match('/^\s*@extra(?:\(\))?\s*$/', $line);
return preg_match('/^\s*@extra(?:\(\))?\s*$/', $line) === 1;
}
private function matchEndExtra(string $line): bool
{
return preg_match('/^\s*@endextra(?:\(\))?\s*$/', $line);
return preg_match('/^\s*@endextra(?:\(\))?\s*$/', $line) === 1;
}
}