Skip to content

Commit

Permalink
Use the latest container version (#15)
Browse files Browse the repository at this point in the history
* Use the latest container version

* fix pint
  • Loading branch information
godruoyi authored Oct 2, 2023
1 parent 8e2352e commit 317206f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"guzzlehttp/guzzle": "^7.2",
"monolog/monolog": "^3.0",
"psr/log": "^2.0 || ^3.0",
"godruoyi/easy-container": "^2.0",
"godruoyi/easy-container": "^2.0 || ^3.0",
"psr/simple-cache": "^2.0 || ^3.0",
"symfony/cache": "^6.1",
"ext-json": "*"
Expand Down
8 changes: 4 additions & 4 deletions src/Support/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static function forget(&$array, $keys)

$keys = (array) $keys;

if (0 === count($keys)) {
if (count($keys) === 0) {
return;
}

Expand Down Expand Up @@ -195,7 +195,7 @@ public static function get($array, $key, $default = null)
return $array[$key];
}

if (false === strpos($key, '.')) {
if (strpos($key, '.') === false) {
return $array[$key] ?? self::vvalue($default);
}

Expand Down Expand Up @@ -364,7 +364,7 @@ public static function random($array, $number = null)
return $array[array_rand($array)];
}

if (0 === (int) $number) {
if ((int) $number === 0) {
return [];
}

Expand Down Expand Up @@ -398,7 +398,7 @@ public static function set(&$array, $key, $value)
$keys = explode('.', $key);

foreach ($keys as $i => $key) {
if (1 === count($keys)) {
if (count($keys) === 1) {
break;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Support/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Encoder
public static function getCanonicalHeaders(array $headers)
{
// 如果没有 headers,则返回空串
if (0 == count($headers)) {
if (count($headers) == 0) {
return '';
}

Expand All @@ -31,7 +31,7 @@ public static function getCanonicalHeaders(array $headers)
continue;
}

$v = null === $v ? '' : $v;
$v = $v === null ? '' : $v;

$headerStrings[] = strtolower(trim($k)).':'.strtolower(trim($v));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Support/FileConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static function isString($file)
*/
public static function isUrl($file)
{
return false !== filter_var($file, FILTER_VALIDATE_URL);
return filter_var($file, FILTER_VALIDATE_URL) !== false;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Support/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Godruoyi\OCR\Support;

use function implode;

use Monolog\Formatter\LineFormatter;
use Monolog\Handler\ErrorLogHandler;
use Monolog\Handler\HandlerInterface;
Expand All @@ -20,6 +21,7 @@
use Monolog\Handler\SyslogHandler;
use Monolog\Logger as Monolog;
use Psr\Log\LoggerInterface;

use function sprintf;

class Logger implements LoggerInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function toArray(): array

$response = json_decode($body, true);

if (JSON_ERROR_NONE != json_last_error()) {
if (json_last_error() != JSON_ERROR_NONE) {
return [];
}

Expand Down

0 comments on commit 317206f

Please sign in to comment.