Skip to content

Commit

Permalink
升级依赖组件的版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Oct 16, 2023
1 parent a04ef29 commit 71827b2
Show file tree
Hide file tree
Showing 37 changed files with 653 additions and 737 deletions.
30 changes: 9 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,32 @@
"php": ">=8.1",
"ext-json": "*",
"composer-runtime-api": "^2.0",
"monolog/monolog": "^2.2",
"phpdocumentor/reflection-docblock": "^5.2",
"psr/container": "~1.1|~2.0",
"psr/http-message": "~1.0",
"monolog/monolog": "~3.0",
"phpdocumentor/reflection-docblock": "~5.3",
"psr/container": "~2.0",
"psr/http-message": "~1.1|~2.0",
"psr/http-server-middleware": "~1.0",
"psr/log": "~1.0|~2.0|~3.0",
"psr/simple-cache": "~1.0|~2.0",
"psr/log": "~2.0|~3.0",
"psr/simple-cache": "~2.0|~3.0",
"symfony/console": "^5.1|^6.0",
"symfony/event-dispatcher": "^5.1|^6.0",
"symfony/polyfill-php80": "^1.23",
"symfony/polyfill-php81": "^1.23",
"symfony/polyfill-php82": "^1.26",
"symfony/process": "^5.1|^6.0",
"vlucas/phpdotenv": "~5.3",
"vlucas/phpdotenv": "~5.5",
"yurunsoft/doctrine-annotations": "^1.73.0"
},
"require-dev": {
"psr/container": "~1.1.0",
"psr/http-message": "~1.0.0",
"psr/http-server-middleware": "~1.0.0",
"psr/log": "~1.0.0",
"psr/simple-cache": "~1.0.0",
"composer/semver": "^3.3.2",
"php-cs-fixer/shim": "~3.17.0",
"phpstan/phpstan": "~1.8.0",
"phpunit/phpunit": "~9.6",
"rector/rector": "~0.13",
"symfony/polyfill-uuid": "^1.27",
"yurunsoft/ide-helper": "~1.0",
"yurunsoft/yurun-http": "^4.0.0"
},
"replace": {
"symfony/polyfill-php71": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*"
"yurunsoft/yurun-http": "^5.0.0"
},
"replace": {},
"autoload": {
"psr-4": {
"Imi\\": "src/"
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
level: 6

phpVersion: 80000
phpVersion: 80100

paths:
- src
Expand Down
3 changes: 1 addition & 2 deletions split-repository/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"require": {
"knplabs/github-api": "^3.0",
"guzzlehttp/guzzle": "^7.0.1",
"http-interop/http-factory-guzzle": "^1.0",
"psr/http-message": "~1.0"
"http-interop/http-factory-guzzle": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 7 additions & 3 deletions src/Bean/ReflectionUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function getTypeComments(?\ReflectionType $type, ?string $classNam
$typeStr = '\\' . $className;
}
}
else
elseif ('static' !== $typeStr)
{
$typeStr = '\\' . $typeStr;
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public static function getTypeCode(?\ReflectionType $type, ?string $className =
$typeStr = '\\' . $className;
}
}
else
elseif ('static' !== $typeStr)
{
$typeStr = '\\' . $typeStr;
}
Expand Down Expand Up @@ -172,9 +172,13 @@ public static function allowsType(\ReflectionType $type, string $checkType, ?str
{
if (null !== $className)
{
$typeStr = $className;
$typeStr = '\\' . $className;
}
}
elseif ('static' !== $typeStr)
{
$typeStr = '\\' . $typeStr;
}
}

return $typeStr === $checkType || \in_array($typeStr, $checkTypes) || is_subclass_of($checkType, $typeStr);
Expand Down
16 changes: 8 additions & 8 deletions src/Cache/Handler/Apcu.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Apcu extends Base
/**
* {@inheritDoc}
*/
public function get($key, $default = null)
public function get(string $key, mixed $default = null): mixed
{
$result = apcu_fetch($this->parseKey($key), $success);
if ($success)
Expand All @@ -35,31 +35,31 @@ public function get($key, $default = null)
/**
* {@inheritDoc}
*/
public function set($key, $value, $ttl = null)
public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool
{
return apcu_store($this->parseKey($key), $value, (int) $ttl);
}

/**
* {@inheritDoc}
*/
public function delete($key)
public function delete(string $key): bool
{
return apcu_delete($this->parseKey($key));
}

/**
* {@inheritDoc}
*/
public function clear()
public function clear(): bool
{
return apcu_clear_cache();
}

/**
* {@inheritDoc}
*/
public function getMultiple($keys, $default = null)
public function getMultiple(iterable $keys, mixed $default = null): iterable
{
$result = [];
foreach ($keys as $key)
Expand All @@ -73,7 +73,7 @@ public function getMultiple($keys, $default = null)
/**
* {@inheritDoc}
*/
public function setMultiple($values, $ttl = null)
public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool
{
$newValues = [];
foreach ($values as $k => $v)
Expand All @@ -87,7 +87,7 @@ public function setMultiple($values, $ttl = null)
/**
* {@inheritDoc}
*/
public function deleteMultiple($keys)
public function deleteMultiple(iterable $keys): bool
{
$newKeys = [];
foreach ($keys as $key)
Expand All @@ -101,7 +101,7 @@ public function deleteMultiple($keys)
/**
* {@inheritDoc}
*/
public function has($key)
public function has(string $key): bool
{
return apcu_exists($this->parseKey($key));
}
Expand Down
16 changes: 8 additions & 8 deletions src/Cache/Handler/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class File extends Base
/**
* {@inheritDoc}
*/
public function get($key, $default = null)
public function get(string $key, mixed $default = null): mixed
{
$this->checkKey($key);
$fileName = $this->getFileName($key);
Expand Down Expand Up @@ -86,7 +86,7 @@ public function get($key, $default = null)
/**
* {@inheritDoc}
*/
public function set($key, $value, $ttl = null)
public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool
{
$this->checkKey($key);
$fileName = $this->getFileName($key);
Expand Down Expand Up @@ -135,7 +135,7 @@ public function set($key, $value, $ttl = null)
/**
* {@inheritDoc}
*/
public function delete($key)
public function delete(string $key): bool
{
$this->checkKey($key);
$fileName = $this->getFileName($key);
Expand All @@ -159,7 +159,7 @@ public function delete($key)
/**
* {@inheritDoc}
*/
public function clear()
public function clear(): bool
{
foreach (FileUtil::enumAll($this->savePath) as $fileIterator)
{
Expand All @@ -180,7 +180,7 @@ public function clear()
/**
* {@inheritDoc}
*/
public function getMultiple($keys, $default = null)
public function getMultiple(iterable $keys, mixed $default = null): iterable
{
$this->checkArrayOrTraversable($keys);
$result = [];
Expand All @@ -195,7 +195,7 @@ public function getMultiple($keys, $default = null)
/**
* {@inheritDoc}
*/
public function setMultiple($values, $ttl = null)
public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool
{
$this->checkArrayOrTraversable($values);
$result = true;
Expand All @@ -215,7 +215,7 @@ public function setMultiple($values, $ttl = null)
/**
* {@inheritDoc}
*/
public function deleteMultiple($keys)
public function deleteMultiple(iterable $keys): bool
{
$this->checkArrayOrTraversable($keys);
$result = true;
Expand All @@ -230,7 +230,7 @@ public function deleteMultiple($keys)
/**
* {@inheritDoc}
*/
public function has($key)
public function has(string $key): bool
{
$this->checkKey($key);
$fileName = $this->getFileName($key);
Expand Down
16 changes: 8 additions & 8 deletions src/Cache/Handler/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ public function __construct(array $option = [])
/**
* {@inheritDoc}
*/
public function get($key, $default = null)
public function get(string $key, mixed $default = null): mixed
{
return self::$storage->get($key, $default);
}

/**
* {@inheritDoc}
*/
public function set($key, $value, $ttl = null)
public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool
{
// ttl 支持 \DateInterval 格式
if ($ttl instanceof \DateInterval)
Expand All @@ -50,7 +50,7 @@ public function set($key, $value, $ttl = null)
/**
* {@inheritDoc}
*/
public function delete($key)
public function delete(string $key): bool
{
self::$storage->unset($key);

Expand All @@ -60,7 +60,7 @@ public function delete($key)
/**
* {@inheritDoc}
*/
public function clear()
public function clear(): bool
{
self::$storage->clear();

Expand All @@ -70,7 +70,7 @@ public function clear()
/**
* {@inheritDoc}
*/
public function getMultiple($keys, $default = null)
public function getMultiple(iterable $keys, mixed $default = null): iterable
{
$this->checkArrayOrTraversable($keys);
$object = self::$storage;
Expand All @@ -86,7 +86,7 @@ public function getMultiple($keys, $default = null)
/**
* {@inheritDoc}
*/
public function setMultiple($values, $ttl = null)
public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool
{
$this->checkArrayOrTraversable($values);
// ttl 支持 \DateInterval 格式
Expand All @@ -106,7 +106,7 @@ public function setMultiple($values, $ttl = null)
/**
* {@inheritDoc}
*/
public function deleteMultiple($keys)
public function deleteMultiple(iterable $keys): bool
{
$this->checkArrayOrTraversable($keys);
$object = self::$storage;
Expand All @@ -121,7 +121,7 @@ public function deleteMultiple($keys)
/**
* {@inheritDoc}
*/
public function has($key)
public function has(string $key): bool
{
return self::$storage->isset($key);
}
Expand Down
16 changes: 8 additions & 8 deletions src/Cache/Handler/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Redis extends Base
/**
* {@inheritDoc}
*/
public function get($key, $default = null)
public function get(string $key, mixed $default = null): mixed
{
$this->checkKey($key);
$result = ImiRedis::use(fn (\Imi\Redis\RedisHandler $redis) => $redis->get($this->parseKey($key)), $this->poolName, true);
Expand All @@ -48,7 +48,7 @@ public function get($key, $default = null)
/**
* {@inheritDoc}
*/
public function set($key, $value, $ttl = null)
public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool
{
$this->checkKey($key);
// ttl 支持 \DateInterval 格式
Expand All @@ -63,7 +63,7 @@ public function set($key, $value, $ttl = null)
/**
* {@inheritDoc}
*/
public function delete($key)
public function delete(string $key): bool
{
$this->checkKey($key);

Expand All @@ -73,15 +73,15 @@ public function delete($key)
/**
* {@inheritDoc}
*/
public function clear()
public function clear(): bool
{
return (bool) ImiRedis::use(static fn (\Imi\Redis\RedisHandler $redis) => $redis->flushDB(), $this->poolName, true);
}

/**
* {@inheritDoc}
*/
public function getMultiple($keys, $default = null)
public function getMultiple(iterable $keys, mixed $default = null): iterable
{
$this->checkArrayOrTraversable($keys);
foreach ($keys as &$key)
Expand Down Expand Up @@ -111,7 +111,7 @@ public function getMultiple($keys, $default = null)
/**
* {@inheritDoc}
*/
public function setMultiple($values, $ttl = null)
public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool
{
$this->checkArrayOrTraversable($values);
if ($values instanceof \Traversable)
Expand Down Expand Up @@ -158,7 +158,7 @@ public function setMultiple($values, $ttl = null)
/**
* {@inheritDoc}
*/
public function deleteMultiple($keys)
public function deleteMultiple(iterable $keys): bool
{
$this->checkArrayOrTraversable($keys);

Expand All @@ -173,7 +173,7 @@ public function deleteMultiple($keys)
/**
* {@inheritDoc}
*/
public function has($key)
public function has(string $key): bool
{
$this->checkKey($key);

Expand Down
Loading

0 comments on commit 71827b2

Please sign in to comment.