diff options
author | Vitor Mattos <vitor@php.rio> | 2021-12-06 20:17:04 +0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2021-12-06 20:17:09 +0300 |
commit | 7b36db07a31bbf6821551f95dff317923c9e0770 (patch) | |
tree | c2bed9908140beedaa0d07c3914e09fa87030477 /lib | |
parent | 7d9aa7712e0323d388215fd76bbede18ff9f6881 (diff) |
Reduce PossiblyFalseArgument
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Chat/Command/Executor.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Chat/Command/Executor.php b/lib/Chat/Command/Executor.php index 0862936c4..121f53fe2 100644 --- a/lib/Chat/Command/Executor.php +++ b/lib/Chat/Command/Executor.php @@ -140,8 +140,9 @@ class Executor { } $response = trim($response); - if (strpos($response, "\n")) { - $tempHelp = substr($response, 0, strpos($response, "\n")); + $newLinePosition = strpos($response, "\n"); + if ($newLinePosition !== false) { + $tempHelp = substr($response, 0, $newLinePosition); if ($tempHelp === 'Description:') { $hasHelpSection = strpos($response, "\nHelp:\n"); if ($hasHelpSection !== false) { |