diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 885bbcd..e8d1242 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -32,6 +32,7 @@ 'phpdoc_types' => true, 'phpdoc_scalar' => true, 'phpdoc_align' => true, + 'no_unused_imports' => true, 'array_syntax' => ['syntax' => 'short'], 'header_comment' => ['header' => $header], ]) diff --git a/bin/resque b/bin/resque index 5dd962e..ee13713 100755 --- a/bin/resque +++ b/bin/resque @@ -10,9 +10,6 @@ * file that was distributed with this source code. */ -/** - * The main point of entry for the php-resque commands - */ if (!ini_get('date.timezone') or ! date_default_timezone_get()) { date_default_timezone_set('UTC'); } diff --git a/src/Config.php b/src/Config.php index 204b7f3..729216f 100644 --- a/src/Config.php +++ b/src/Config.php @@ -13,7 +13,6 @@ use InvalidArgumentException; use Resque\Helpers\Util; -use Resque\Redis; use RuntimeException; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Yaml; @@ -24,7 +23,7 @@ * @package Resque * @author Paul Litovka */ -class Config +final class Config { /** * Default config file name @@ -51,10 +50,8 @@ class Config * Reads and loads data from a config file * * @param string $file The config file path - * - * @return bool */ - public static function loadConfig(string $file = self::DEFAULT_CONFIG_FILE): bool + public static function loadConfig(string $file = self::DEFAULT_CONFIG_FILE): void { static::$config = static::parseConfig($file); @@ -68,8 +65,6 @@ public static function loadConfig(string $file = self::DEFAULT_CONFIG_FILE): boo 'phpiredis' => static::read('redis.phpiredis', Redis::DEFAULT_PHPIREDIS), 'predis' => static::read('predis'), ]); - - return true; } /** diff --git a/src/Console/Command/Cleanup.php b/src/Console/Command/Cleanup.php index 26f106c..9aed3c8 100644 --- a/src/Console/Command/Cleanup.php +++ b/src/Console/Command/Cleanup.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command; -use Resque\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/Console/Command/Clear.php b/src/Console/Command/Clear.php index 14fcd94..acac2dd 100644 --- a/src/Console/Command/Clear.php +++ b/src/Console/Command/Clear.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command; -use Resque\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/Console/Command/Hosts.php b/src/Console/Command/Hosts.php index b165a60..6fe6209 100644 --- a/src/Console/Command/Hosts.php +++ b/src/Console/Command/Hosts.php @@ -11,8 +11,6 @@ namespace Resque\Console\Command; -use Resque\Resque; -use Resque\Console\Command\Command; use Resque\Host; use Resque\Redis; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/Console/Command/Queues.php b/src/Console/Command/Queues.php index 0021ccf..c08de38 100644 --- a/src/Console/Command/Queues.php +++ b/src/Console/Command/Queues.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command; -use Resque\Console\Command\Command; use Resque\Queue; use Resque\Redis; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/Console/Command/Socket/Connect.php b/src/Console/Command/Socket/Connect.php index d3c46a4..b23014d 100644 --- a/src/Console/Command/Socket/Connect.php +++ b/src/Console/Command/Socket/Connect.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command\Socket; -use Resque\Resque; use Resque\Console\Command\Command; use Resque\Socket\Server; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/Console/Command/Socket/Receive.php b/src/Console/Command/Socket/Receive.php index 8685402..197a10c 100644 --- a/src/Console/Command/Socket/Receive.php +++ b/src/Console/Command/Socket/Receive.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command\Socket; -use Resque\Resque; use Resque\Job; use Resque\Host; use Resque\Worker; diff --git a/src/Console/Command/Socket/Send.php b/src/Console/Command/Socket/Send.php index f11ce76..788cf61 100644 --- a/src/Console/Command/Socket/Send.php +++ b/src/Console/Command/Socket/Send.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command\Socket; -use Resque\Resque; use Resque\Console\Command\Command; use Resque\Socket\Server; use Symfony\Component\Console\Input\InputArgument; diff --git a/src/Console/Command/SpeedTest.php b/src/Console/Command/SpeedTest.php index 6371e31..7f3e3f8 100644 --- a/src/Console/Command/SpeedTest.php +++ b/src/Console/Command/SpeedTest.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command; -use Resque\Console\Command\Command; use Resque\Redis; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; diff --git a/src/Console/Command/Worker/Cancel.php b/src/Console/Command/Worker/Cancel.php index 4985f85..4083250 100644 --- a/src/Console/Command/Worker/Cancel.php +++ b/src/Console/Command/Worker/Cancel.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command\Worker; -use Resque\Resque; use Resque\Console\Command\Command; use Resque\Worker; use Symfony\Component\Console\Input\InputArgument; diff --git a/src/Console/Command/Worker/Pause.php b/src/Console/Command/Worker/Pause.php index 0b367e8..4cd4f97 100644 --- a/src/Console/Command/Worker/Pause.php +++ b/src/Console/Command/Worker/Pause.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command\Worker; -use Resque\Resque; use Resque\Console\Command\Command; use Resque\Worker; use Symfony\Component\Console\Input\InputArgument; diff --git a/src/Console/Command/Worker/Restart.php b/src/Console/Command/Worker/Restart.php index 7b48b03..ca31ded 100644 --- a/src/Console/Command/Worker/Restart.php +++ b/src/Console/Command/Worker/Restart.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command\Worker; -use Resque\Resque; use Resque\Console\Command\Command; use Resque\Worker; use Symfony\Component\Console\Input\InputArgument; diff --git a/src/Console/Command/Worker/Resume.php b/src/Console/Command/Worker/Resume.php index dfc6342..5fe10e5 100644 --- a/src/Console/Command/Worker/Resume.php +++ b/src/Console/Command/Worker/Resume.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command\Worker; -use Resque\Resque; use Resque\Console\Command\Command; use Resque\Worker; use Symfony\Component\Console\Input\InputArgument; diff --git a/src/Console/Command/Worker/Stop.php b/src/Console/Command/Worker/Stop.php index 848082c..342b5f5 100644 --- a/src/Console/Command/Worker/Stop.php +++ b/src/Console/Command/Worker/Stop.php @@ -11,7 +11,6 @@ namespace Resque\Console\Command\Worker; -use Resque\Resque; use Resque\Console\Command\Command; use Resque\Worker; use Symfony\Component\Console\Input\InputArgument; diff --git a/src/Console/Command/Workers.php b/src/Console/Command/Workers.php index f2fda8f..af154b5 100644 --- a/src/Console/Command/Workers.php +++ b/src/Console/Command/Workers.php @@ -11,8 +11,6 @@ namespace Resque\Console\Command; -use Resque\Resque; -use Resque\Console\Command\Command; use Resque\Helpers\Util; use Resque\Worker; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/Event.php b/src/Event.php index 6371942..6bfa45b 100644 --- a/src/Event.php +++ b/src/Event.php @@ -17,7 +17,7 @@ * @package Resque * @author Michael Haynes */ -class Event +final class Event { // Worker event constants public const WORKER_INSTANCE = 100; diff --git a/src/Helpers/CatchOutput.php b/src/Helpers/CatchOutput.php index 3a21899..04633e7 100644 --- a/src/Helpers/CatchOutput.php +++ b/src/Helpers/CatchOutput.php @@ -19,7 +19,7 @@ * @package Resque * @author Michael Haynes */ -class CatchOutput extends \Symfony\Component\Console\Output\Output +final class CatchOutput extends \Symfony\Component\Console\Output\Output { /** * @var string Stored output string diff --git a/src/Helpers/ClosureJob.php b/src/Helpers/ClosureJob.php index c7572c3..88c03b5 100644 --- a/src/Helpers/ClosureJob.php +++ b/src/Helpers/ClosureJob.php @@ -17,7 +17,7 @@ * @package Resque * @author Michael Haynes */ -class ClosureJob +final class ClosureJob { /** * Fire the Closure based queue job. diff --git a/src/Helpers/SerializableClosure.php b/src/Helpers/SerializableClosure.php index 834cf0e..ae70a0c 100644 --- a/src/Helpers/SerializableClosure.php +++ b/src/Helpers/SerializableClosure.php @@ -17,7 +17,7 @@ * @package Resque * @author Michael Haynes */ -class SerializableClosure +final class SerializableClosure { /** * The Closure instance. diff --git a/src/Helpers/Stats.php b/src/Helpers/Stats.php index 4f77384..378897c 100644 --- a/src/Helpers/Stats.php +++ b/src/Helpers/Stats.php @@ -19,7 +19,7 @@ * @package Resque * @author Michael Haynes */ -class Stats +final class Stats { public const DEFAULT_KEY = 'stats'; diff --git a/src/Helpers/Table.php b/src/Helpers/Table.php index 712409a..433b35c 100644 --- a/src/Helpers/Table.php +++ b/src/Helpers/Table.php @@ -20,7 +20,7 @@ * @package Resque * @author Michael Haynes */ -class Table +final class Table { /** * @var TableHelper diff --git a/src/Helpers/Util.php b/src/Helpers/Util.php index 029aa24..13c4f2b 100644 --- a/src/Helpers/Util.php +++ b/src/Helpers/Util.php @@ -17,7 +17,7 @@ * @package Resque * @author Michael Haynes */ -class Util +final class Util { /** * Returns human readable sizes. Based on original functions written by diff --git a/src/Logger.php b/src/Logger.php index a4200bd..e2cf45c 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -19,7 +19,7 @@ * @package Resque * @author Michael Haynes */ -class Logger +final class Logger { /** * Detailed debug information diff --git a/src/Queue.php b/src/Queue.php index c8fb76b..465f635 100644 --- a/src/Queue.php +++ b/src/Queue.php @@ -17,7 +17,7 @@ * @package Resque * @author Michael Haynes */ -class Queue +final class Queue { /** * @var Redis The Redis instance diff --git a/src/Redis.php b/src/Redis.php index 7d83169..48bb63b 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -19,7 +19,7 @@ * @package Resque * @author Michael Haynes */ -class Redis +final class Redis { /** * Default Redis connection scheme diff --git a/src/Resque.php b/src/Resque.php index 7ab0db7..265a537 100644 --- a/src/Resque.php +++ b/src/Resque.php @@ -11,9 +11,6 @@ namespace Resque; -use Resque\Redis; -use Resque\Queue; - /** * Main Resque class *