--- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_ApiMethodInfo.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_ApiMethodInfo.php @@ -11,7 +11,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ class ApiMethodInfo extends ValueObject { --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_Arr.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_Arr.php @@ -10,7 +10,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ class Arr { --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_Invalid.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_Invalid.php @@ -12,7 +12,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ class Invalid extends Exception { --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_Obj.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_Obj.php @@ -11,7 +11,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ class Obj { --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_Text.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_Text.php @@ -10,91 +10,87 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ class Text { - /** - * Given haystack contains the needle or not? - * - * @param string $haystack - * @param string $needle - * @param bool $caseSensitive - * - * @return bool - */ - public static function contains($haystack, $needle, $caseSensitive = true) - { - if (empty($needle)) - return true; - return $caseSensitive - ? strpos($haystack, $needle) !== false - : stripos($haystack, $needle) !== false; - } - - /** - * Given haystack begins with the needle or not? - * - * @param string $haystack - * @param string $needle - * - * @return bool - */ - public static function beginsWith($haystack, $needle) - { - $length = strlen($needle); - return (substr($haystack, 0, $length) === $needle); - } - - /** - * Given haystack ends with the needle or not? - * - * @param string $haystack - * @param string $needle - * - * @return bool - */ - public static function endsWith($haystack, $needle) - { - $length = strlen($needle); - if ($length == 0) { - return true; - } - - // @CHANGE LDR - if (!is_string($haystack)) return false; - - return (substr($haystack, -$length) === $needle); - } - - - /** - * Convert camelCased or underscored string in to a title - * - * @param string $name - * - * @return string - */ - public static function title($name) - { - return - ucwords( - preg_replace( - array('/(?<=[^A-Z])([A-Z])/', '/(?<=[^0-9])([0-9])/', '/([_-])/', '/[^a-zA-Z0-9\s]|\s\s+/'), - array(' $0', ' $0', ' ', ' '), - $name - ) - ); - } - - /** - * Convert given string to be used as a slug or css class - * - * @param string $name - * @return string - */ - public static function slug($name) - { - return preg_replace('/[^a-zA-Z]+/', '-', strtolower(strip_tags($name))); - } + /** + * Given haystack contains the needle or not? + * + * @param string $haystack + * @param string $needle + * @param bool $caseSensitive + * + * @return bool + */ + public static function contains($haystack, $needle, $caseSensitive = true) + { + if (empty($needle)) + return true; + return $caseSensitive + ? strpos($haystack, $needle) !== false + : stripos($haystack, $needle) !== false; + } + + /** + * Given haystack begins with the needle or not? + * + * @param string $haystack + * @param string $needle + * + * @return bool + */ + public static function beginsWith($haystack, $needle) + { + $length = strlen($needle); + return (substr($haystack, 0, $length) === $needle); + } + + /** + * Given haystack ends with the needle or not? + * + * @param string $haystack + * @param string $needle + * + * @return bool + */ + public static function endsWith($haystack, $needle) + { + $length = strlen($needle); + if ($length == 0) { + return true; + } + return (substr($haystack, -$length) === $needle); + } + + + /** + * Convert camelCased or underscored string in to a title + * + * @param string $name + * + * @return string + */ + public static function title($name) + { + return + ucwords( + preg_replace( + array('/(?<=[^A-Z])([A-Z])/', '/(?<=[^0-9])([0-9])/', '/([_-])/', '/[^a-zA-Z0-9\s]|\s\s+/'), + array(' $0', ' $0', ' ', ' '), + $name + ) + ); + } + + /** + * Convert given string to be used as a slug or css class + * + * @param string $name + * @return string + */ + public static function slug($name) + { + return preg_replace('/[^a-zA-Z]+/', '-', strtolower(strip_tags($name))); + } } --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_ValidationInfo.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_ValidationInfo.php @@ -15,7 +15,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ class ValidationInfo implements iValueObject { --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_Validator.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_Validator.php @@ -18,7 +18,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ class Validator implements iValidate { --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_ValueObject.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_ValueObject.php @@ -11,7 +11,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ class ValueObject implements iValueObject { --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_iValidate.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_iValidate.php @@ -10,7 +10,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ interface iValidate { --- /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/github_iValueObject.php +++ /tmp/dsg/dolibarr/htdocs/includes/restler/framework/Luracast/Restler/Data/client_iValueObject.php @@ -11,7 +11,7 @@ * @copyright 2010 Luracast * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://luracast.com/products/restler/ - * + * @version 3.0.0rc6 */ interface iValueObject {