Skip to content

Commit

Permalink
Merge pull request #10 from aliyun/reduce-dependency
Browse files Browse the repository at this point in the history
reduce dependency
  • Loading branch information
aliguyong authored Jun 9, 2020
2 parents 351fa76 + 1260454 commit ab507ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 3 additions & 4 deletions src/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace AlibabaCloud\Credentials;

use Closure;
use Stringy\Stringy;

/**
* Class Helper
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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] === '"';
}

/**
Expand Down

0 comments on commit ab507ae

Please sign in to comment.