Skip to content

Commit

Permalink
Marked methods as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored and cmuench committed Jul 13, 2024
1 parent bfe0818 commit 533526b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/N98/Util/BinaryString.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,26 @@ public static function trimExplodeEmpty($delimiter, $string)
* @param string $needle
*
* @return bool
*
* @deprecated use str_starts_with() instead
*/
public static function startsWith($haystack, $needle)
{
return $needle === '' || strpos($haystack, $needle) === 0;
trigger_error(__METHOD__ . ' is obsolete, use str_starts_with', E_USER_DEPRECATED);
return str_starts_with($haystack, $needle);
}

/**
* @param string $haystack
* @param string $needle
*
* @return bool
*
* @deprecated use str_ends_with() instead
*/
public static function endsWith($haystack, $needle)
{
trigger_error(__METHOD__ . ' is obsolete, use str_ends_with()', E_USER_DEPRECATED);
return str_ends_with($haystack, $needle);
}
}

0 comments on commit 533526b

Please sign in to comment.