@@ -804,49 +804,49 @@ public function buildPath(string $Path, bool $PointsToFile = true): string
804
804
/**
805
805
* Gets substring from haystack prior to the first occurrence of needle.
806
806
*
807
- * @param string $h The haystack.
808
- * @param string $n The needle.
807
+ * @param string $Haystack The haystack.
808
+ * @param string $Needle The needle.
809
809
* @return string The substring.
810
810
*/
811
811
public function substrBeforeFirst (string $ h , string $ n ): string
812
812
{
813
- return !$ n ? '' : substr ($ h , 0 , strpos ($ h , $ n ));
813
+ return !strlen ( $ Needle ) ? '' : substr ($ Haystack , 0 , strpos ($ Haystack , $ Needle ));
814
814
}
815
815
816
816
/**
817
817
* Gets substring from haystack after the first occurrence of needle.
818
818
*
819
- * @param string $h The haystack.
820
- * @param string $n The needle.
819
+ * @param string $Haystack The haystack.
820
+ * @param string $Needle The needle.
821
821
* @return string The substring.
822
822
*/
823
823
public function substrAfterFirst (string $ h , string $ n ): string
824
824
{
825
- return !$ n ? '' : substr ($ h , strpos ($ h , $ n ) + strlen ( $ n ) );
825
+ return !( $ Length = strlen ( $ Needle )) ? '' : substr ($ Haystack , strpos ($ Haystack , $ Needle ) + $ Length );
826
826
}
827
827
828
828
/**
829
829
* Gets substring from haystack prior to the last occurrence of needle.
830
830
*
831
- * @param string $h The haystack.
832
- * @param string $n The needle.
831
+ * @param string $Haystack The haystack.
832
+ * @param string $Needle The needle.
833
833
* @return string The substring.
834
834
*/
835
835
public function substrBeforeLast (string $ h , string $ n ): string
836
836
{
837
- return !$ n ? '' : substr ($ h , 0 , strrpos ($ h , $ n ));
837
+ return !strlen ( $ Needle ) ? '' : substr ($ Haystack , 0 , strrpos ($ Haystack , $ Needle ));
838
838
}
839
839
840
840
/**
841
841
* Gets substring from haystack after the last occurrence of needle.
842
842
*
843
- * @param string $h The haystack.
844
- * @param string $n The needle.
843
+ * @param string $Haystack The haystack.
844
+ * @param string $Needle The needle.
845
845
* @return string The substring.
846
846
*/
847
- public function substrAfterLast (string $ h , string $ n ): string
847
+ public function substrAfterLast (string $ Haystack , string $ Needle ): string
848
848
{
849
- return !$ n ? '' : substr ($ h , strrpos ($ h , $ n ) + strlen ( $ n ) );
849
+ return !( $ Length = strlen ( $ Needle )) ? '' : substr ($ Haystack , strrpos ($ Haystack , $ Needle ) + $ Length );
850
850
}
851
851
852
852
/**
0 commit comments