mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-15 09:44:14 +02:00
Conditionally load Stringy\create
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
namespace Stringy;
|
namespace Stringy;
|
||||||
|
|
||||||
/**
|
if (!function_exists('Stringy\create')) {
|
||||||
|
/**
|
||||||
* Creates a Stringy object and returns it on success.
|
* Creates a Stringy object and returns it on success.
|
||||||
*
|
*
|
||||||
* @param mixed $str Value to modify, after being cast to string
|
* @param mixed $str Value to modify, after being cast to string
|
||||||
@@ -11,7 +12,8 @@ namespace Stringy;
|
|||||||
* @throws \InvalidArgumentException if an array or object without a
|
* @throws \InvalidArgumentException if an array or object without a
|
||||||
* __toString method is passed as the first argument
|
* __toString method is passed as the first argument
|
||||||
*/
|
*/
|
||||||
function create($str, $encoding = null)
|
function create($str, $encoding = null)
|
||||||
{
|
{
|
||||||
return new Stringy($str, $encoding);
|
return new Stringy($str, $encoding);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user