mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Optimized code of async-queue, cache, command, config
This commit is contained in:
parent
251eda809c
commit
d696a67b6f
@ -43,6 +43,9 @@ before_script:
|
||||
script:
|
||||
- composer analyse \
|
||||
src/amqp \
|
||||
src/async-queue
|
||||
src/async-queue \
|
||||
src/cache \
|
||||
src/command \
|
||||
src/config
|
||||
- composer test -- --exclude-group NonCoroutine
|
||||
- vendor/bin/phpunit --group NonCoroutine
|
||||
|
3
src/cache/src/Aspect/CacheableAspect.php
vendored
3
src/cache/src/Aspect/CacheableAspect.php
vendored
@ -18,7 +18,6 @@ use Hyperf\Cache\Driver\KeyCollectorInterface;
|
||||
use Hyperf\Di\Annotation\Aspect;
|
||||
use Hyperf\Di\Aop\AbstractAspect;
|
||||
use Hyperf\Di\Aop\ProceedingJoinPoint;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
/**
|
||||
* @Aspect
|
||||
@ -32,7 +31,7 @@ class CacheableAspect extends AbstractAspect
|
||||
];
|
||||
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
* @var CacheManager
|
||||
*/
|
||||
protected $manager;
|
||||
|
||||
|
3
src/cache/src/Aspect/FailCacheAspect.php
vendored
3
src/cache/src/Aspect/FailCacheAspect.php
vendored
@ -18,7 +18,6 @@ use Hyperf\Contract\StdoutLoggerInterface;
|
||||
use Hyperf\Di\Annotation\Aspect;
|
||||
use Hyperf\Di\Aop\AbstractAspect;
|
||||
use Hyperf\Di\Aop\ProceedingJoinPoint;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
/**
|
||||
* @Aspect
|
||||
@ -32,7 +31,7 @@ class FailCacheAspect extends AbstractAspect
|
||||
];
|
||||
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
* @var CacheManager
|
||||
*/
|
||||
protected $manager;
|
||||
|
||||
|
@ -51,6 +51,8 @@ class CoroutineMemoryDriver extends Driver implements KeyCollectorInterface
|
||||
foreach ($values as $key => $value) {
|
||||
$this->set($key, $values, $ttl);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteMultiple($keys)
|
||||
@ -58,6 +60,8 @@ class CoroutineMemoryDriver extends Driver implements KeyCollectorInterface
|
||||
foreach ($keys as $key) {
|
||||
$this->delete($key);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function has($key)
|
||||
|
2
src/cache/src/Driver/RedisDriver.php
vendored
2
src/cache/src/Driver/RedisDriver.php
vendored
@ -113,7 +113,7 @@ class RedisDriver extends Driver implements KeyCollectorInterface
|
||||
return $this->getCacheKey($key);
|
||||
}, $keys);
|
||||
|
||||
return $this->redis->del(...$cacheKeys);
|
||||
return (bool) $this->redis->del(...$cacheKeys);
|
||||
}
|
||||
|
||||
public function has($key)
|
||||
|
@ -40,7 +40,7 @@ abstract class Command extends SymfonyCommand
|
||||
protected $input;
|
||||
|
||||
/**
|
||||
* @var OutputInterface|SymfonyStyle
|
||||
* @var SymfonyStyle
|
||||
*/
|
||||
protected $output;
|
||||
|
||||
|
@ -28,6 +28,7 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class ModelCommand extends Command
|
||||
{
|
||||
@ -57,7 +58,7 @@ class ModelCommand extends Command
|
||||
protected $printer;
|
||||
|
||||
/**
|
||||
* @var OutputInterface
|
||||
* @var SymfonyStyle
|
||||
*/
|
||||
protected $output;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user