@@ -153,14 +153,14 @@ public function compare(string|int|float|bool|null $compare): bool
153153 }
154154
155155 /**
156- * Checks if a string ends with a given substring
156+ * Checks if a string contains a given substring
157157 *
158158 * @param string $needle
159159 * @return bool
160160 */
161- public function endsWith (string $ needle ): bool
161+ public function contains (string $ needle ): bool
162162 {
163- return str_ends_with ($ this ->raw , $ needle );
163+ return str_contains ($ this ->raw , $ needle );
164164 }
165165
166166 /**
@@ -173,6 +173,17 @@ public function startsWith(string $needle): bool
173173 {
174174 return str_starts_with ($ this ->raw , $ needle );
175175 }
176+
177+ /**
178+ * Checks if a string ends with a given substring
179+ *
180+ * @param string $needle
181+ * @return bool
182+ */
183+ public function endsWith (string $ needle ): bool
184+ {
185+ return str_ends_with ($ this ->raw , $ needle );
186+ }
176187
177188 // Return self -->
178189
@@ -313,7 +324,7 @@ public function clearWhitespace(): self
313324 * @param bool $double_encode
314325 * @return self
315326 */
316- public function entityEncode (int $ flags = ENT_QUOTES |ENT_SUBSTITUTE , ?string $ encoding , bool $ double_encode = true ): self
327+ public function entityEncode (int $ flags = ENT_QUOTES |ENT_SUBSTITUTE , ?string $ encoding = null , bool $ double_encode = true ): self
317328 {
318329 $ this ->raw = htmlentities ($ this ->strVal (), $ flags , $ encoding , $ double_encode );
319330 return $ this ;
@@ -326,7 +337,7 @@ public function entityEncode(int $flags = ENT_QUOTES|ENT_SUBSTITUTE, ?string $en
326337 * @param string|null $encoding
327338 * @return self
328339 */
329- public function entityDecode (int $ flags = ENT_QUOTES |ENT_SUBSTITUTE , ?string $ encoding ): self
340+ public function entityDecode (int $ flags = ENT_QUOTES |ENT_SUBSTITUTE , ?string $ encoding = null ): self
330341 {
331342 $ this ->raw = html_entity_decode ($ this ->strVal (), $ flags , $ encoding );
332343 return $ this ;
0 commit comments