diff --git a/composer.json b/composer.json index 7bd2e55..f85f140 100644 --- a/composer.json +++ b/composer.json @@ -36,10 +36,7 @@ "ext-simplexml": "*", "ext-xmlwriter": "*", "guzzlehttp/guzzle": "^6.3", - "danielstjules/stringy": "^3.1", - "mtdowling/jmespath.php": "^2.4", "adbario/php-dot-notation": "^2.2", - "clagiordano/weblibs-configmanager": "^1.0", "alibabacloud/tea": "^3.0" }, "require-dev": { diff --git a/src/Helper.php b/src/Helper.php index 45438cf..6d9eab4 100644 --- a/src/Helper.php +++ b/src/Helper.php @@ -3,7 +3,6 @@ namespace AlibabaCloud\Credentials; use Closure; -use Stringy\Stringy; /** * Class Helper @@ -67,7 +66,7 @@ public static function inOpenBasedir($filename) public static function inDir($filename, array $dirs) { foreach ($dirs as $dir) { - if (!Stringy::create($dir)->endsWith(DIRECTORY_SEPARATOR)) { + if ($dir[strlen($dir) - 1] !== DIRECTORY_SEPARATOR) { $dir .= DIRECTORY_SEPARATOR; } @@ -145,8 +144,8 @@ public static function value($value) public static function envSubstr($value) { return ($valueLength = strlen($value)) > 1 - && strpos($value, '"') === 0 - && $value[$valueLength - 1] === '"'; + && strpos($value, '"') === 0 + && $value[$valueLength - 1] === '"'; } /**