diff --git a/.travis.yml b/.travis.yml index 6b2a861a..5385b1c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,8 @@ script: after_success: - rm -f build/clover.xml - - phpdbg -qrr vendor/bin/phpcov merge build --clover build/clover.xml + - wget https://phar.phpunit.de/phpcov-6.0.1.phar + - phpdbg -qrr phpcov-6.0.1.phar merge build --clover build/clover.xml - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/clover.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index f17ae4d4..6394408b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Changed -* *Nothing* +* [#492](https://github.com/shlinkio/shlink/issues/492) Updated to monolog 2, together with other dependencies, like Symfony 5 and infection-php. #### Deprecated diff --git a/composer.json b/composer.json index 5d035b60..fd3840bb 100644 --- a/composer.json +++ b/composer.json @@ -28,20 +28,20 @@ "guzzlehttp/guzzle": "^6.3", "lstrojny/functional-php": "^1.9", "mikehaertl/phpwkhtmltopdf": "^2.2", - "monolog/monolog": "^1.24", + "monolog/monolog": "^2.0", + "nikolaposa/monolog-factory": "^3.0", "ocramius/proxy-manager": "~2.2.2", "phly/phly-event-dispatcher": "^1.0", "predis/predis": "^1.1", "pugx/shortid-php": "^0.5", - "shlinkio/shlink-common": "^2.3", - "shlinkio/shlink-event-dispatcher": "^1.0", - "shlinkio/shlink-installer": "^3.1", - "shlinkio/shlink-ip-geolocation": "^1.1", - "symfony/console": "^4.3", - "symfony/filesystem": "^4.3", - "symfony/lock": "^4.3", - "symfony/process": "^4.3", - "theorchard/monolog-cascade": "^0.5", + "shlinkio/shlink-common": "^2.4", + "shlinkio/shlink-event-dispatcher": "^1.1", + "shlinkio/shlink-installer": "^3.2", + "shlinkio/shlink-ip-geolocation": "^1.2", + "symfony/console": "^5.0", + "symfony/filesystem": "^5.0", + "symfony/lock": "^5.0", + "symfony/process": "^5.0", "zendframework/zend-config": "^3.3", "zendframework/zend-config-aggregator": "^1.1", "zendframework/zend-diactoros": "^2.1.3", @@ -59,17 +59,14 @@ "require-dev": { "devster/ubench": "^2.0", "eaglewu/swoole-ide-helper": "dev-master", - "infection/infection": "^0.14.2", - "phpstan/phpstan": "^0.11.16", - "phpunit/phpcov": "^6.0", + "infection/infection": "^0.15.0", + "phpstan/phpstan-shim": "^0.11.16", "phpunit/phpunit": "^8.3", "roave/security-advisories": "dev-master", "shlinkio/php-coding-standard": "~2.0.0", - "shlinkio/shlink-test-utils": "^1.1", - "symfony/dotenv": "^4.3", - "symfony/var-dumper": "^4.3", - "zendframework/zend-component-installer": "^2.1", - "zendframework/zend-expressive-tooling": "^1.2" + "shlinkio/shlink-test-utils": "^1.2", + "symfony/dotenv": "^5.0", + "symfony/var-dumper": "^5.0" }, "autoload": { "psr-4": { @@ -115,7 +112,7 @@ "@test:api" ], "test:unit": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-unit.cov --testdox", - "test:unit:ci": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-unit.cov --coverage-clover=build/clover.xml --coverage-xml=build/coverage-xml --log-junit=build/phpunit.junit.xml --testdox", + "test:unit:ci": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-unit.cov --coverage-clover=build/clover.xml --coverage-xml=build/coverage-xml --log-junit=build/junit.xml --testdox", "test:db": [ "@test:db:sqlite", "@test:db:mysql", @@ -132,10 +129,6 @@ "test:db:maria": "DB_DRIVER=maria composer test:db:sqlite", "test:db:postgres": "DB_DRIVER=postgres composer test:db:sqlite", "test:api": "bin/test/run-api-tests.sh", - "test:pretty": [ - "@test", - "phpdbg -qrr vendor/bin/phpcov merge build --html build/html" - ], "test:unit:pretty": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-html build/coverage", "infect": "infection --threads=4 --min-msi=75 --log-verbosity=default --only-covered", "infect:ci": "infection --threads=4 --min-msi=75 --log-verbosity=default --only-covered --coverage=build", @@ -162,7 +155,6 @@ "test:db:maria": "Runs database test suites on a MariaDB database", "test:db:postgres": "Runs database test suites on a PostgreSQL database", "test:api": "Runs API test suites", - "test:pretty": "Runs all test suites and generates an HTML code coverage report", "test:unit:pretty": "Runs unit test suites and generates an HTML code coverage report", "infect": "Checks unit tests quality applying mutation testing", "infect:ci": "Checks unit tests quality applying mutation testing with existing reports and logs", diff --git a/config/autoload/locks.global.php b/config/autoload/locks.global.php index db64e187..e8c39338 100644 --- a/config/autoload/locks.global.php +++ b/config/autoload/locks.global.php @@ -10,7 +10,7 @@ use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; // This class alias tricks the ConfigAbstractFactory to return Lock\Factory instances even with a different service name $localLockFactory = 'Shlinkio\Shlink\LocalLockFactory'; -class_alias(Lock\Factory::class, $localLockFactory); +class_alias(Lock\LockFactory::class, $localLockFactory); return [ @@ -22,7 +22,7 @@ return [ 'factories' => [ Lock\Store\FlockStore::class => ConfigAbstractFactory::class, Lock\Store\RedisStore::class => ConfigAbstractFactory::class, - Lock\Factory::class => ConfigAbstractFactory::class, + Lock\LockFactory::class => ConfigAbstractFactory::class, $localLockFactory => ConfigAbstractFactory::class, ], 'aliases' => [ @@ -36,7 +36,7 @@ return [ Lock\Store\RedisStore::class => [ RetryLockStoreDelegatorFactory::class, ], - Lock\Factory::class => [ + Lock\LockFactory::class => [ LoggerAwareDelegatorFactory::class, ], ], @@ -45,7 +45,7 @@ return [ ConfigAbstractFactory::class => [ Lock\Store\FlockStore::class => ['config.locks.locks_dir'], Lock\Store\RedisStore::class => [RedisFactory::SERVICE_NAME], - Lock\Factory::class => ['lock_store'], + Lock\LockFactory::class => ['lock_store'], $localLockFactory => ['local_lock_store'], ], diff --git a/config/autoload/logger.global.php b/config/autoload/logger.global.php index 6b0df063..40aa8a2d 100644 --- a/config/autoload/logger.global.php +++ b/config/autoload/logger.global.php @@ -4,64 +4,69 @@ declare(strict_types=1); namespace Shlinkio\Shlink; -use Monolog\Handler\RotatingFileHandler; -use Monolog\Handler\StreamHandler; +use Monolog\Formatter; +use Monolog\Handler; use Monolog\Logger; use Monolog\Processor; +use MonologFactory\DiContainerLoggerFactory; use Psr\Log\LoggerInterface; use const PHP_EOL; +$processors = [ + 'exception_with_new_line' => [ + 'name' => Common\Logger\Processor\ExceptionWithNewLineProcessor::class, + ], + 'psr3' => [ + 'name' => Processor\PsrLogMessageProcessor::class, + ], +]; +$formatter = [ + 'name' => Formatter\LineFormatter::class, + 'params' => [ + 'format' => '[%datetime%] %channel%.%level_name% - %message%' . PHP_EOL, + 'allow_inline_line_breaks' => true, + ], +]; + return [ 'logger' => [ - 'formatters' => [ - 'dashed' => [ - 'format' => '[%datetime%] %channel%.%level_name% - %message%' . PHP_EOL, - 'include_stacktraces' => true, + 'Shlink' => [ + 'name' => 'Shlink', + 'handlers' => [ + 'shlink_handler' => [ + 'name' => Handler\RotatingFileHandler::class, + 'params' => [ + 'level' => Logger::INFO, + 'filename' => 'data/log/shlink_log.log', + 'max_files' => 30, + ], + 'formatter' => $formatter, + ], ], + 'processors' => $processors, ], - - 'handlers' => [ - 'shlink_rotating_handler' => [ - 'class' => RotatingFileHandler::class, - 'level' => Logger::INFO, - 'filename' => 'data/log/shlink_log.log', - 'max_files' => 30, - 'formatter' => 'dashed', - ], - 'access_handler' => [ - 'class' => StreamHandler::class, - 'level' => Logger::INFO, - 'stream' => 'php://stdout', - ], - ], - - 'processors' => [ - 'exception_with_new_line' => [ - 'class' => Common\Logger\Processor\ExceptionWithNewLineProcessor::class, - ], - 'psr3' => [ - 'class' => Processor\PsrLogMessageProcessor::class, - ], - ], - - 'loggers' => [ - 'Shlink' => [ - 'handlers' => ['shlink_rotating_handler'], - 'processors' => ['exception_with_new_line', 'psr3'], - ], - 'Access' => [ - 'handlers' => ['access_handler'], - 'processors' => ['exception_with_new_line', 'psr3'], + 'Access' => [ + 'name' => 'Access', + 'handlers' => [ + 'access_handler' => [ + 'name' => Handler\StreamHandler::class, + 'params' => [ + 'level' => Logger::INFO, + 'stream' => 'php://stdout', + ], + 'formatter' => $formatter, + ], ], + 'processors' => $processors, ], ], 'dependencies' => [ 'factories' => [ - 'Logger_Shlink' => Common\Logger\LoggerFactory::class, - 'Logger_Access' => Common\Logger\LoggerFactory::class, + 'Logger_Shlink' => [DiContainerLoggerFactory::class, 'Shlink'], + 'Logger_Access' => [DiContainerLoggerFactory::class, 'Access'], ], 'aliases' => [ 'logger' => 'Logger_Shlink', diff --git a/config/autoload/logger.local.php.dist b/config/autoload/logger.local.php.dist index cf7e4801..4aa46c68 100644 --- a/config/autoload/logger.local.php.dist +++ b/config/autoload/logger.local.php.dist @@ -1,4 +1,5 @@ [ - 'shlink_rotating_handler' => [ - 'level' => Logger::EMERGENCY, // This basically disables regular file logs - ], - 'shlink_stdout_handler' => [ - 'class' => StreamHandler::class, +$handler = $isSwoole + ? [ + 'name' => StreamHandler::class, + 'params' => [ 'level' => Logger::DEBUG, 'stream' => 'php://stdout', - 'formatter' => 'dashed', ], - ], - - 'loggers' => [ - 'Shlink' => [ - 'handlers' => ['shlink_stdout_handler'], - ], - ], -] : [ - 'handlers' => [ - 'shlink_rotating_handler' => [ + ] + : [ + 'params' => [ 'level' => Logger::DEBUG, ], - ], -]; + ]; return [ - 'logger' => $logger, + 'logger' => [ + 'Shlink' => [ + 'handlers' => [ + 'shlink_handler' => $handler, + ], + ], + ], ]; diff --git a/config/container.php b/config/container.php index 37be5669..f2c1d0c7 100644 --- a/config/container.php +++ b/config/container.php @@ -13,7 +13,7 @@ require 'vendor/autoload.php'; if (class_exists(Dotenv::class)) { error_reporting(E_ALL); ini_set('display_errors', '1'); - $dotenv = new Dotenv(); + $dotenv = new Dotenv(true); $dotenv->load(__DIR__ . '/../.env'); } diff --git a/docker/config/shlink_in_docker.local.php b/docker/config/shlink_in_docker.local.php index bd2d0411..5da6761d 100644 --- a/docker/config/shlink_in_docker.local.php +++ b/docker/config/shlink_in_docker.local.php @@ -130,21 +130,15 @@ return [ 'not_found_redirects' => $helper->getNotFoundRedirectsConfig(), 'logger' => [ - 'handlers' => [ - 'shlink_rotating_handler' => [ - 'level' => Logger::EMERGENCY, // This basically disables regular file logs - ], - 'shlink_stdout_handler' => [ - 'class' => StreamHandler::class, - 'level' => Logger::INFO, - 'stream' => 'php://stdout', - 'formatter' => 'dashed', - ], - ], - - 'loggers' => [ - 'Shlink' => [ - 'handlers' => ['shlink_stdout_handler'], + 'Shlink' => [ + 'handlers' => [ + 'shlink_handler' => [ + 'name' => StreamHandler::class, + 'params' => [ + 'level' => Logger::INFO, + 'stream' => 'php://stdout', + ], + ], ], ], ], diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php index a7f7e90e..c89a0ad7 100644 --- a/module/CLI/config/dependencies.config.php +++ b/module/CLI/config/dependencies.config.php @@ -15,7 +15,7 @@ use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface; use Shlinkio\Shlink\PreviewGenerator\Service\PreviewGenerator; use Shlinkio\Shlink\Rest\Service\ApiKeyService; use Symfony\Component\Console as SymfonyCli; -use Symfony\Component\Lock\Factory as Locker; +use Symfony\Component\Lock\LockFactory; use Symfony\Component\Process\PhpExecutableFinder; use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; use Zend\ServiceManager\Factory\InvokableFactory; @@ -70,7 +70,7 @@ return [ Command\Visit\LocateVisitsCommand::class => [ Service\VisitService::class, IpLocationResolverInterface::class, - Locker::class, + LockFactory::class, GeolocationDbUpdater::class, ], Command\Visit\UpdateDbCommand::class => [DbUpdater::class], @@ -85,14 +85,14 @@ return [ Command\Tag\DeleteTagsCommand::class => [Service\Tag\TagService::class], Command\Db\CreateDatabaseCommand::class => [ - Locker::class, + LockFactory::class, SymfonyCli\Helper\ProcessHelper::class, PhpExecutableFinder::class, Connection::class, NoDbNameConnectionFactory::SERVICE_NAME, ], Command\Db\MigrateDatabaseCommand::class => [ - Locker::class, + LockFactory::class, SymfonyCli\Helper\ProcessHelper::class, PhpExecutableFinder::class, ], diff --git a/module/CLI/src/Command/Db/AbstractDatabaseCommand.php b/module/CLI/src/Command/Db/AbstractDatabaseCommand.php index 3ab12b3b..bf99de9b 100644 --- a/module/CLI/src/Command/Db/AbstractDatabaseCommand.php +++ b/module/CLI/src/Command/Db/AbstractDatabaseCommand.php @@ -8,7 +8,7 @@ use Shlinkio\Shlink\CLI\Command\Util\AbstractLockedCommand; use Shlinkio\Shlink\CLI\Command\Util\LockedCommandConfig; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Lock\Factory as Locker; +use Symfony\Component\Lock\LockFactory; use Symfony\Component\Process\PhpExecutableFinder; use function array_unshift; @@ -20,7 +20,7 @@ abstract class AbstractDatabaseCommand extends AbstractLockedCommand /** @var string */ private $phpBinary; - public function __construct(Locker $locker, ProcessHelper $processHelper, PhpExecutableFinder $phpFinder) + public function __construct(LockFactory $locker, ProcessHelper $processHelper, PhpExecutableFinder $phpFinder) { parent::__construct($locker); $this->processHelper = $processHelper; diff --git a/module/CLI/src/Command/Db/CreateDatabaseCommand.php b/module/CLI/src/Command/Db/CreateDatabaseCommand.php index 36bb9de4..54cd27ea 100644 --- a/module/CLI/src/Command/Db/CreateDatabaseCommand.php +++ b/module/CLI/src/Command/Db/CreateDatabaseCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Lock\Factory as Locker; +use Symfony\Component\Lock\LockFactory; use Symfony\Component\Process\PhpExecutableFinder; use function Functional\contains; @@ -27,7 +27,7 @@ class CreateDatabaseCommand extends AbstractDatabaseCommand private $noDbNameConn; public function __construct( - Locker $locker, + LockFactory $locker, ProcessHelper $processHelper, PhpExecutableFinder $phpFinder, Connection $conn, diff --git a/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php index 7483e890..081fa94f 100644 --- a/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php +++ b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php @@ -69,7 +69,7 @@ class GeneratePreviewCommand extends Command } catch (PreviewGenerationException $e) { $output->writeln(' Error'); if ($output->isVerbose()) { - $this->getApplication()->renderException($e, $output); + $this->getApplication()->renderThrowable($e, $output); } } } diff --git a/module/CLI/src/Command/Util/AbstractLockedCommand.php b/module/CLI/src/Command/Util/AbstractLockedCommand.php index 0e206cbe..59ea74fa 100644 --- a/module/CLI/src/Command/Util/AbstractLockedCommand.php +++ b/module/CLI/src/Command/Util/AbstractLockedCommand.php @@ -8,16 +8,16 @@ use Shlinkio\Shlink\CLI\Util\ExitCodes; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Lock\Factory as Locker; +use Symfony\Component\Lock\LockFactory; use function sprintf; abstract class AbstractLockedCommand extends Command { - /** @var Locker */ + /** @var LockFactory */ private $locker; - public function __construct(Locker $locker) + public function __construct(LockFactory $locker) { parent::__construct(); $this->locker = $locker; diff --git a/module/CLI/src/Command/Visit/LocateVisitsCommand.php b/module/CLI/src/Command/Visit/LocateVisitsCommand.php index 21012480..710c4a3a 100644 --- a/module/CLI/src/Command/Visit/LocateVisitsCommand.php +++ b/module/CLI/src/Command/Visit/LocateVisitsCommand.php @@ -22,7 +22,7 @@ use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Lock\Factory as Locker; +use Symfony\Component\Lock\LockFactory; use Throwable; use function sprintf; @@ -47,7 +47,7 @@ class LocateVisitsCommand extends AbstractLockedCommand public function __construct( VisitServiceInterface $visitService, IpLocationResolverInterface $ipLocationResolver, - Locker $locker, + LockFactory $locker, GeolocationDbUpdaterInterface $dbUpdater ) { parent::__construct($locker); @@ -87,7 +87,7 @@ class LocateVisitsCommand extends AbstractLockedCommand } catch (Throwable $e) { $this->io->error($e->getMessage()); if ($e instanceof Exception && $this->io->isVerbose()) { - $this->getApplication()->renderException($e, $this->io); + $this->getApplication()->renderThrowable($e, $this->io); } return ExitCodes::EXIT_FAILURE; @@ -116,7 +116,7 @@ class LocateVisitsCommand extends AbstractLockedCommand } catch (WrongIpException $e) { $this->io->writeln(' [An error occurred while locating IP. Skipped]'); if ($this->io->isVerbose()) { - $this->getApplication()->renderException($e, $this->io); + $this->getApplication()->renderThrowable($e, $this->io); } throw IpCannotBeLocatedException::forError($e); diff --git a/module/CLI/src/Command/Visit/UpdateDbCommand.php b/module/CLI/src/Command/Visit/UpdateDbCommand.php index c138372b..367423fd 100644 --- a/module/CLI/src/Command/Visit/UpdateDbCommand.php +++ b/module/CLI/src/Command/Visit/UpdateDbCommand.php @@ -84,7 +84,7 @@ class UpdateDbCommand extends Command $io->error($baseErrorMsg); if ($io->isVerbose()) { - $this->getApplication()->renderException($e, $io); + $this->getApplication()->renderThrowable($e, $io); } return ExitCodes::EXIT_FAILURE; } diff --git a/module/CLI/src/Util/GeolocationDbUpdater.php b/module/CLI/src/Util/GeolocationDbUpdater.php index 2e530a34..25b49c37 100644 --- a/module/CLI/src/Util/GeolocationDbUpdater.php +++ b/module/CLI/src/Util/GeolocationDbUpdater.php @@ -9,7 +9,7 @@ use GeoIp2\Database\Reader; use Shlinkio\Shlink\CLI\Exception\GeolocationDbUpdateFailedException; use Shlinkio\Shlink\IpGeolocation\Exception\RuntimeException; use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdaterInterface; -use Symfony\Component\Lock\Factory as Locker; +use Symfony\Component\Lock\LockFactory; class GeolocationDbUpdater implements GeolocationDbUpdaterInterface { @@ -19,10 +19,10 @@ class GeolocationDbUpdater implements GeolocationDbUpdaterInterface private $dbUpdater; /** @var Reader */ private $geoLiteDbReader; - /** @var Locker */ + /** @var LockFactory */ private $locker; - public function __construct(DbUpdaterInterface $dbUpdater, Reader $geoLiteDbReader, Locker $locker) + public function __construct(DbUpdaterInterface $dbUpdater, Reader $geoLiteDbReader, LockFactory $locker) { $this->dbUpdater = $dbUpdater; $this->geoLiteDbReader = $geoLiteDbReader; diff --git a/module/CLI/test/Command/Db/CreateDatabaseCommandTest.php b/module/CLI/test/Command/Db/CreateDatabaseCommandTest.php index 89322544..7945ea05 100644 --- a/module/CLI/test/Command/Db/CreateDatabaseCommandTest.php +++ b/module/CLI/test/Command/Db/CreateDatabaseCommandTest.php @@ -15,7 +15,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Lock\Factory as Locker; +use Symfony\Component\Lock\LockFactory; use Symfony\Component\Lock\LockInterface; use Symfony\Component\Process\PhpExecutableFinder; @@ -36,7 +36,7 @@ class CreateDatabaseCommandTest extends TestCase public function setUp(): void { - $locker = $this->prophesize(Locker::class); + $locker = $this->prophesize(LockFactory::class); $lock = $this->prophesize(LockInterface::class); $lock->acquire(Argument::any())->willReturn(true); $lock->release()->will(function () { diff --git a/module/CLI/test/Command/Db/MigrateDatabaseCommandTest.php b/module/CLI/test/Command/Db/MigrateDatabaseCommandTest.php index 1e7690ae..be36a980 100644 --- a/module/CLI/test/Command/Db/MigrateDatabaseCommandTest.php +++ b/module/CLI/test/Command/Db/MigrateDatabaseCommandTest.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Lock\Factory as Locker; +use Symfony\Component\Lock\LockFactory; use Symfony\Component\Lock\LockInterface; use Symfony\Component\Process\PhpExecutableFinder; @@ -25,7 +25,7 @@ class MigrateDatabaseCommandTest extends TestCase public function setUp(): void { - $locker = $this->prophesize(Locker::class); + $locker = $this->prophesize(LockFactory::class); $lock = $this->prophesize(LockInterface::class); $lock->acquire(Argument::any())->willReturn(true); $lock->release()->will(function () { diff --git a/module/CLI/test/Command/Visit/LocateVisitsCommandTest.php b/module/CLI/test/Command/Visit/LocateVisitsCommandTest.php index bb3be84c..e01bf85f 100644 --- a/module/CLI/test/Command/Visit/LocateVisitsCommandTest.php +++ b/module/CLI/test/Command/Visit/LocateVisitsCommandTest.php @@ -48,7 +48,7 @@ class LocateVisitsCommandTest extends TestCase $this->ipResolver = $this->prophesize(IpLocationResolverInterface::class); $this->dbUpdater = $this->prophesize(GeolocationDbUpdaterInterface::class); - $this->locker = $this->prophesize(Lock\Factory::class); + $this->locker = $this->prophesize(Lock\LockFactory::class); $this->lock = $this->prophesize(Lock\LockInterface::class); $this->lock->acquire(false)->willReturn(true); $this->lock->release()->will(function () { diff --git a/module/CLI/test/Util/GeolocationDbUpdaterTest.php b/module/CLI/test/Util/GeolocationDbUpdaterTest.php index 56819924..f2b0f98c 100644 --- a/module/CLI/test/Util/GeolocationDbUpdaterTest.php +++ b/module/CLI/test/Util/GeolocationDbUpdaterTest.php @@ -38,7 +38,7 @@ class GeolocationDbUpdaterTest extends TestCase $this->dbUpdater = $this->prophesize(DbUpdaterInterface::class); $this->geoLiteDbReader = $this->prophesize(Reader::class); - $this->locker = $this->prophesize(Lock\Factory::class); + $this->locker = $this->prophesize(Lock\LockFactory::class); $this->lock = $this->prophesize(Lock\LockInterface::class); $this->lock->acquire(true)->willReturn(true); $this->lock->release()->will(function () {