Skip to content

Commit cc3502a

Browse files
committed
Refactor.
1 parent d0d320e commit cc3502a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Loader.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: The loader (last modified: 2022.06.16).
11+
* This file: The loader (last modified: 2022.06.19).
1212
*/
1313

1414
namespace phpMussel\Core;
@@ -751,7 +751,7 @@ public function pseudonymiseIP(string $IP): string
751751
public function buildPath(string $Path, bool $PointsToFile = true): string
752752
{
753753
/** Input guard. */
754-
if (!strlen($Path)) {
754+
if ($Path === '') {
755755
return '';
756756
}
757757

@@ -810,7 +810,7 @@ public function buildPath(string $Path, bool $PointsToFile = true): string
810810
*/
811811
public function substrBeforeFirst(string $Haystack, string $Needle): string
812812
{
813-
return !strlen($Needle) ? '' : substr($Haystack, 0, strpos($Haystack, $Needle));
813+
return $Needle === '' ? '' : substr($Haystack, 0, strpos($Haystack, $Needle));
814814
}
815815

816816
/**
@@ -834,7 +834,7 @@ public function substrAfterFirst(string $Haystack, string $Needle): string
834834
*/
835835
public function substrBeforeLast(string $Haystack, string $Needle): string
836836
{
837-
return !strlen($Needle) ? '' : substr($Haystack, 0, strrpos($Haystack, $Needle));
837+
return $Needle === '' ? '' : substr($Haystack, 0, strrpos($Haystack, $Needle));
838838
}
839839

840840
/**
@@ -858,7 +858,7 @@ public function substrAfterLast(string $Haystack, string $Needle): string
858858
public function readFileContent(string $File): string
859859
{
860860
/** Guard. */
861-
if (!strlen($File) || !is_file($File) || !is_readable($File)) {
861+
if ($File === '' || !is_file($File) || !is_readable($File)) {
862862
return '';
863863
}
864864

@@ -875,7 +875,7 @@ public function readFileContent(string $File): string
875875
public function readFileContentGZ(string $File): string
876876
{
877877
/** Guard. */
878-
if (!strlen($File) || !is_file($File) || !is_readable($File) || !$Filesize = filesize($File)) {
878+
if ($File === '' || !is_file($File) || !is_readable($File) || !$Filesize = filesize($File)) {
879879
return '';
880880
}
881881

@@ -961,7 +961,7 @@ public function arrayify(&$Input): void
961961
public function gZCompressFile(string $File): bool
962962
{
963963
/** Guard. */
964-
if (!strlen($File) || !is_file($File) || !is_readable($File)) {
964+
if ($File === '' || !is_file($File) || !is_readable($File)) {
965965
return false;
966966
}
967967

src/Scanner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: The scanner (last modified: 2022.03.24).
11+
* This file: The scanner (last modified: 2022.06.19).
1212
*/
1313

1414
namespace phpMussel\Core;
@@ -2235,7 +2235,7 @@ private function dataHandler(string $str = '', int $Depth = 0, string $OriginalF
22352235
}
22362236
if (strpos($ThisSig, ':') !== false) {
22372237
$VN = $this->splitSigParts($ThisSig);
2238-
if (!isset($VN[1]) || !strlen($VN[1])) {
2238+
if (!isset($VN[1]) || $VN[1] === '') {
22392239
continue;
22402240
}
22412241
if ($ThisConf[3] === 2) {

0 commit comments

Comments
 (0)