From 025135b8c64fb762a20e70d19e5a51771244efff Mon Sep 17 00:00:00 2001 From: Alejandro Celaya <alejandro@alejandrocelaya.com> Date: Sun, 28 Oct 2018 08:34:02 +0100 Subject: [PATCH] Added all missing use statements from global functions and constants --- composer.json | 8 ++++---- .../test/Command/Config/GenerateCharsetCommandTest.php | 3 +++ .../test/Command/ShortUrl/GeneratePreviewCommandTest.php | 2 ++ .../Command/ShortUrl/GenerateShortcodeCommandTest.php | 1 + .../CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php | 1 + module/CLI/test/Factory/ApplicationFactoryTest.php | 1 + module/Common/functions/functions.php | 1 + .../Common/src/Exception/PreviewGenerationException.php | 2 ++ .../src/Factory/DottedAccessConfigAbstractFactory.php | 5 +++++ module/Common/src/Factory/EntityManagerFactory.php | 4 +++- module/Common/src/Factory/LoggerFactory.php | 2 ++ module/Common/src/Middleware/LocaleMiddleware.php | 2 ++ module/Common/src/Service/PreviewGenerator.php | 2 ++ module/Common/src/Util/ResponseUtilsTrait.php | 2 ++ module/Common/test/Factory/CacheFactoryTest.php | 4 ++++ module/Common/test/Service/PreviewGeneratorTest.php | 2 ++ module/Core/src/Exception/EntityDoesNotExistException.php | 3 +++ module/Core/src/Exception/InvalidUrlException.php | 1 + module/Core/src/Exception/NonUniqueSlugException.php | 2 ++ module/Core/src/Exception/ValidationException.php | 1 + module/Core/src/Options/AppOptions.php | 1 + module/Core/src/Service/VisitsTracker.php | 1 + module/Core/test/Action/PreviewActionTest.php | 2 ++ module/Core/test/Service/ShortUrlServiceTest.php | 1 + module/Installer/src/Command/InstallCommand.php | 1 + .../Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php | 1 + module/Rest/src/Action/Tag/UpdateTagAction.php | 1 + module/Rest/src/Action/Visit/GetVisitsAction.php | 1 + module/Rest/test/Action/AuthenticateActionTest.php | 1 + .../test/Action/ShortUrl/CreateShortUrlActionTest.php | 1 + .../test/Action/ShortUrl/ResolveShortUrlActionTest.php | 1 + module/Rest/test/Authentication/JWTServiceTest.php | 1 + .../Plugin/AuthorizationHeaderPluginTest.php | 1 + .../Rest/test/Authentication/RequestToAuthPluginTest.php | 2 ++ module/Rest/test/Middleware/BodyParserMiddlewareTest.php | 1 + phpcs.xml | 7 ++++++- 36 files changed, 67 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index c1fd4d5c..d31169c9 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "infection/infection": "^0.9.0", "phpstan/phpstan": "^0.10.0", "phpunit/phpcov": "^5.0", - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^7.3", "slevomat/coding-standard": "^4.0", "squizlabs/php_codesniffer": "^3.2.3", "symfony/dotenv": "^4.0", @@ -101,15 +101,15 @@ "@test:unit", "@test:func" ], - "test:unit": "phpunit --coverage-php build/coverage-unit.cov", - "test:func": "phpunit -c phpunit-func.xml --coverage-php build/coverage-func.cov", + "test:unit": "phpunit --coverage-php build/coverage-unit.cov --order-by=random", + "test:func": "phpunit -c phpunit-func.xml --coverage-php build/coverage-func.cov --order-by=random", "test:pretty": [ "@test:unit", "@test:func", "phpcov merge build --html build/html" ], - "test:unit:pretty": "phpunit --coverage-html build/coverage", + "test:unit:pretty": "phpunit --coverage-html build/coverage --order-by=random", "infect": "infection --threads=4 --min-msi=60 --only-covered --log-verbosity=2", "infect:show": "infection --threads=4 --min-msi=60 --only-covered --log-verbosity=2 --show-mutations" diff --git a/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php b/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php index a9d62c18..8aaca745 100644 --- a/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php +++ b/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php @@ -8,6 +8,9 @@ use Shlinkio\Shlink\CLI\Command\Config\GenerateCharsetCommand; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Zend\I18n\Translator\Translator; +use function implode; +use function sort; +use function str_split; class GenerateCharsetCommandTest extends TestCase { diff --git a/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php index de62f193..e451db1f 100644 --- a/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php @@ -16,6 +16,8 @@ use Symfony\Component\Console\Tester\CommandTester; use Zend\I18n\Translator\Translator; use Zend\Paginator\Adapter\ArrayAdapter; use Zend\Paginator\Paginator; +use function count; +use function substr_count; class GeneratePreviewCommandTest extends TestCase { diff --git a/module/CLI/test/Command/ShortUrl/GenerateShortcodeCommandTest.php b/module/CLI/test/Command/ShortUrl/GenerateShortcodeCommandTest.php index b26968f5..d4477254 100644 --- a/module/CLI/test/Command/ShortUrl/GenerateShortcodeCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GenerateShortcodeCommandTest.php @@ -13,6 +13,7 @@ use Shlinkio\Shlink\Core\Service\UrlShortener; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Zend\I18n\Translator\Translator; +use function strpos; class GenerateShortcodeCommandTest extends TestCase { diff --git a/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php index b5e7aff2..dbfc804a 100644 --- a/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php @@ -13,6 +13,7 @@ use Shlinkio\Shlink\Core\Service\UrlShortener; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Zend\I18n\Translator\Translator; +use const PHP_EOL; class ResolveUrlCommandTest extends TestCase { diff --git a/module/CLI/test/Factory/ApplicationFactoryTest.php b/module/CLI/test/Factory/ApplicationFactoryTest.php index 7e765941..a5d6614b 100644 --- a/module/CLI/test/Factory/ApplicationFactoryTest.php +++ b/module/CLI/test/Factory/ApplicationFactoryTest.php @@ -10,6 +10,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; use Zend\I18n\Translator\Translator; use Zend\ServiceManager\ServiceManager; +use function array_merge; class ApplicationFactoryTest extends TestCase { diff --git a/module/Common/functions/functions.php b/module/Common/functions/functions.php index bd851351..ac0eb94f 100644 --- a/module/Common/functions/functions.php +++ b/module/Common/functions/functions.php @@ -9,6 +9,7 @@ use function in_array; use function json_decode as spl_json_decode; use function json_last_error; use function json_last_error_msg; +use function sprintf; use function strtolower; use function trim; diff --git a/module/Common/src/Exception/PreviewGenerationException.php b/module/Common/src/Exception/PreviewGenerationException.php index 3871f0c6..ef9ccfc3 100644 --- a/module/Common/src/Exception/PreviewGenerationException.php +++ b/module/Common/src/Exception/PreviewGenerationException.php @@ -3,6 +3,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Common\Exception; +use function sprintf; + class PreviewGenerationException extends RuntimeException { public static function fromImageError($error) diff --git a/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php b/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php index b3080375..562431d8 100644 --- a/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php +++ b/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php @@ -10,6 +10,11 @@ use Shlinkio\Shlink\Common\Exception\InvalidArgumentException; use Zend\ServiceManager\Exception\ServiceNotCreatedException; use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\ServiceManager\Factory\AbstractFactoryInterface; +use function array_shift; +use function explode; +use function is_array; +use function sprintf; +use function substr_count; class DottedAccessConfigAbstractFactory implements AbstractFactoryInterface { diff --git a/module/Common/src/Factory/EntityManagerFactory.php b/module/Common/src/Factory/EntityManagerFactory.php index 59285601..bb0c1b14 100644 --- a/module/Common/src/Factory/EntityManagerFactory.php +++ b/module/Common/src/Factory/EntityManagerFactory.php @@ -33,7 +33,9 @@ class EntityManagerFactory implements FactoryInterface $connectionConfig = $emConfig['connection'] ?? []; $ormConfig = $emConfig['orm'] ?? []; - Type::addType(ChronosDateTimeType::CHRONOS_DATETIME, ChronosDateTimeType::class); + if (! Type::hasType(ChronosDateTimeType::CHRONOS_DATETIME)) { + Type::addType(ChronosDateTimeType::CHRONOS_DATETIME, ChronosDateTimeType::class); + } return EntityManager::create($connectionConfig, Setup::createAnnotationMetadataConfiguration( $ormConfig['entities_paths'] ?? [], diff --git a/module/Common/src/Factory/LoggerFactory.php b/module/Common/src/Factory/LoggerFactory.php index f357c29b..7ea491c0 100644 --- a/module/Common/src/Factory/LoggerFactory.php +++ b/module/Common/src/Factory/LoggerFactory.php @@ -9,6 +9,8 @@ use Interop\Container\Exception\ContainerException; use Zend\ServiceManager\Exception\ServiceNotCreatedException; use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\ServiceManager\Factory\FactoryInterface; +use function count; +use function explode; class LoggerFactory implements FactoryInterface { diff --git a/module/Common/src/Middleware/LocaleMiddleware.php b/module/Common/src/Middleware/LocaleMiddleware.php index cdb5df19..066cacf2 100644 --- a/module/Common/src/Middleware/LocaleMiddleware.php +++ b/module/Common/src/Middleware/LocaleMiddleware.php @@ -8,6 +8,8 @@ use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface as DelegateInterface; use Zend\I18n\Translator\Translator; +use function count; +use function explode; class LocaleMiddleware implements MiddlewareInterface { diff --git a/module/Common/src/Service/PreviewGenerator.php b/module/Common/src/Service/PreviewGenerator.php index 0a7814a2..bc084171 100644 --- a/module/Common/src/Service/PreviewGenerator.php +++ b/module/Common/src/Service/PreviewGenerator.php @@ -7,6 +7,8 @@ use mikehaertl\wkhtmlto\Image; use Shlinkio\Shlink\Common\Exception\PreviewGenerationException; use Shlinkio\Shlink\Common\Image\ImageBuilderInterface; use Symfony\Component\Filesystem\Filesystem; +use function sprintf; +use function urlencode; class PreviewGenerator implements PreviewGeneratorInterface { diff --git a/module/Common/src/Util/ResponseUtilsTrait.php b/module/Common/src/Util/ResponseUtilsTrait.php index f73c163e..998b0af4 100644 --- a/module/Common/src/Util/ResponseUtilsTrait.php +++ b/module/Common/src/Util/ResponseUtilsTrait.php @@ -8,6 +8,8 @@ use Psr\Http\Message\ResponseInterface; use Zend\Diactoros\Response; use Zend\Diactoros\Stream; use Zend\Stdlib\ArrayUtils; +use const FILEINFO_MIME; +use function basename; trait ResponseUtilsTrait { diff --git a/module/Common/test/Factory/CacheFactoryTest.php b/module/Common/test/Factory/CacheFactoryTest.php index 0da1b694..4ffa978e 100644 --- a/module/Common/test/Factory/CacheFactoryTest.php +++ b/module/Common/test/Factory/CacheFactoryTest.php @@ -12,6 +12,10 @@ use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Common\Factory\CacheFactory; use Shlinkio\Shlink\Core\Options\AppOptions; use Zend\ServiceManager\ServiceManager; +use function count; +use function putenv; +use function realpath; +use function sys_get_temp_dir; class CacheFactoryTest extends TestCase { diff --git a/module/Common/test/Service/PreviewGeneratorTest.php b/module/Common/test/Service/PreviewGeneratorTest.php index 20d625bd..650b0b03 100644 --- a/module/Common/test/Service/PreviewGeneratorTest.php +++ b/module/Common/test/Service/PreviewGeneratorTest.php @@ -11,6 +11,8 @@ use Shlinkio\Shlink\Common\Image\ImageBuilder; use Shlinkio\Shlink\Common\Service\PreviewGenerator; use Symfony\Component\Filesystem\Filesystem; use Zend\ServiceManager\ServiceManager; +use function sprintf; +use function urlencode; class PreviewGeneratorTest extends TestCase { diff --git a/module/Core/src/Exception/EntityDoesNotExistException.php b/module/Core/src/Exception/EntityDoesNotExistException.php index ba4d233d..9cc3b1b1 100644 --- a/module/Core/src/Exception/EntityDoesNotExistException.php +++ b/module/Core/src/Exception/EntityDoesNotExistException.php @@ -3,6 +3,9 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; +use function implode; +use function sprintf; + class EntityDoesNotExistException extends RuntimeException { public static function createFromEntityAndConditions($entityName, array $conditions) diff --git a/module/Core/src/Exception/InvalidUrlException.php b/module/Core/src/Exception/InvalidUrlException.php index cbedb4b5..65f87e4e 100644 --- a/module/Core/src/Exception/InvalidUrlException.php +++ b/module/Core/src/Exception/InvalidUrlException.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Throwable; +use function sprintf; class InvalidUrlException extends RuntimeException { diff --git a/module/Core/src/Exception/NonUniqueSlugException.php b/module/Core/src/Exception/NonUniqueSlugException.php index d94a61b5..09e22b9b 100644 --- a/module/Core/src/Exception/NonUniqueSlugException.php +++ b/module/Core/src/Exception/NonUniqueSlugException.php @@ -3,6 +3,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; +use function sprintf; + class NonUniqueSlugException extends InvalidArgumentException { public static function fromSlug(string $slug): self diff --git a/module/Core/src/Exception/ValidationException.php b/module/Core/src/Exception/ValidationException.php index 2f2dd1e6..5220005a 100644 --- a/module/Core/src/Exception/ValidationException.php +++ b/module/Core/src/Exception/ValidationException.php @@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\Core\Exception; use Throwable; use Zend\InputFilter\InputFilterInterface; +use const PHP_EOL; use function is_array; use function print_r; use function sprintf; diff --git a/module/Core/src/Options/AppOptions.php b/module/Core/src/Options/AppOptions.php index 0220dbd8..cdcf5eec 100644 --- a/module/Core/src/Options/AppOptions.php +++ b/module/Core/src/Options/AppOptions.php @@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\Core\Options; use Shlinkio\Shlink\Common\Util\StringUtilsTrait; use Zend\Stdlib\AbstractOptions; +use function sprintf; class AppOptions extends AbstractOptions { diff --git a/module/Core/src/Service/VisitsTracker.php b/module/Core/src/Service/VisitsTracker.php index 1f40b245..81bf2c96 100644 --- a/module/Core/src/Service/VisitsTracker.php +++ b/module/Core/src/Service/VisitsTracker.php @@ -10,6 +10,7 @@ use Shlinkio\Shlink\Core\Entity\Visit; use Shlinkio\Shlink\Core\Exception\InvalidArgumentException; use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Repository\VisitRepository; +use function sprintf; class VisitsTracker implements VisitsTrackerInterface { diff --git a/module/Core/test/Action/PreviewActionTest.php b/module/Core/test/Action/PreviewActionTest.php index e49a6d72..c0fbeb46 100644 --- a/module/Core/test/Action/PreviewActionTest.php +++ b/module/Core/test/Action/PreviewActionTest.php @@ -18,6 +18,8 @@ use Shlinkio\Shlink\Core\Service\UrlShortener; use ShlinkioTest\Shlink\Common\Util\TestUtils; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequestFactory; +use const FILEINFO_MIME; +use function filesize; class PreviewActionTest extends TestCase { diff --git a/module/Core/test/Service/ShortUrlServiceTest.php b/module/Core/test/Service/ShortUrlServiceTest.php index 8c4f6618..5b7e52f4 100644 --- a/module/Core/test/Service/ShortUrlServiceTest.php +++ b/module/Core/test/Service/ShortUrlServiceTest.php @@ -15,6 +15,7 @@ use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; use Shlinkio\Shlink\Core\Repository\ShortUrlRepository; use Shlinkio\Shlink\Core\Service\ShortUrlService; +use function count; class ShortUrlServiceTest extends TestCase { diff --git a/module/Installer/src/Command/InstallCommand.php b/module/Installer/src/Command/InstallCommand.php index 0f677bd5..a3807a6b 100644 --- a/module/Installer/src/Command/InstallCommand.php +++ b/module/Installer/src/Command/InstallCommand.php @@ -21,6 +21,7 @@ use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\PhpExecutableFinder; use Zend\Config\Writer\WriterInterface; +use function sprintf; class InstallCommand extends Command { diff --git a/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php b/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php index 064f5d19..ad79ed0e 100644 --- a/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php +++ b/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\JsonResponse; use Zend\I18n\Translator\TranslatorInterface; +use function sprintf; class EditShortUrlTagsAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/Tag/UpdateTagAction.php b/module/Rest/src/Action/Tag/UpdateTagAction.php index 02f32abb..b17ea940 100644 --- a/module/Rest/src/Action/Tag/UpdateTagAction.php +++ b/module/Rest/src/Action/Tag/UpdateTagAction.php @@ -13,6 +13,7 @@ use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\EmptyResponse; use Zend\Diactoros\Response\JsonResponse; use Zend\I18n\Translator\TranslatorInterface; +use function sprintf; class UpdateTagAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/Visit/GetVisitsAction.php b/module/Rest/src/Action/Visit/GetVisitsAction.php index f0cdba80..8f1db5f3 100644 --- a/module/Rest/src/Action/Visit/GetVisitsAction.php +++ b/module/Rest/src/Action/Visit/GetVisitsAction.php @@ -15,6 +15,7 @@ use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\JsonResponse; use Zend\I18n\Translator\TranslatorInterface; +use function sprintf; class GetVisitsAction extends AbstractRestAction { diff --git a/module/Rest/test/Action/AuthenticateActionTest.php b/module/Rest/test/Action/AuthenticateActionTest.php index 131efb6d..49fe07cb 100644 --- a/module/Rest/test/Action/AuthenticateActionTest.php +++ b/module/Rest/test/Action/AuthenticateActionTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Rest\Entity\ApiKey; use Shlinkio\Shlink\Rest\Service\ApiKeyService; use Zend\Diactoros\ServerRequestFactory; use Zend\I18n\Translator\Translator; +use function strpos; class AuthenticateActionTest extends TestCase { diff --git a/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php index 15c9abfe..f3cc160e 100644 --- a/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php @@ -16,6 +16,7 @@ use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\ServerRequestFactory; use Zend\Diactoros\Uri; use Zend\I18n\Translator\Translator; +use function strpos; class CreateShortUrlActionTest extends TestCase { diff --git a/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php index ba7c2dfa..1411629c 100644 --- a/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php @@ -14,6 +14,7 @@ use Shlinkio\Shlink\Rest\Action\ShortUrl\ResolveShortUrlAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\ServerRequestFactory; use Zend\I18n\Translator\Translator; +use function strpos; class ResolveShortUrlActionTest extends TestCase { diff --git a/module/Rest/test/Authentication/JWTServiceTest.php b/module/Rest/test/Authentication/JWTServiceTest.php index e592e865..64812613 100644 --- a/module/Rest/test/Authentication/JWTServiceTest.php +++ b/module/Rest/test/Authentication/JWTServiceTest.php @@ -8,6 +8,7 @@ use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Core\Options\AppOptions; use Shlinkio\Shlink\Rest\Authentication\JWTService; use Shlinkio\Shlink\Rest\Entity\ApiKey; +use function time; class JWTServiceTest extends TestCase { diff --git a/module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php b/module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php index 31590c53..f5b97c2f 100644 --- a/module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php +++ b/module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php @@ -11,6 +11,7 @@ use Shlinkio\Shlink\Rest\Exception\VerifyAuthenticationException; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequestFactory; use Zend\I18n\Translator\Translator; +use function sprintf; class AuthorizationHeaderPluginTest extends TestCase { diff --git a/module/Rest/test/Authentication/RequestToAuthPluginTest.php b/module/Rest/test/Authentication/RequestToAuthPluginTest.php index ed852e92..454a93e4 100644 --- a/module/Rest/test/Authentication/RequestToAuthPluginTest.php +++ b/module/Rest/test/Authentication/RequestToAuthPluginTest.php @@ -12,6 +12,8 @@ use Shlinkio\Shlink\Rest\Authentication\Plugin\AuthorizationHeaderPlugin; use Shlinkio\Shlink\Rest\Authentication\RequestToHttpAuthPlugin; use Shlinkio\Shlink\Rest\Exception\NoAuthenticationException; use Zend\Diactoros\ServerRequestFactory; +use function implode; +use function sprintf; class RequestToAuthPluginTest extends TestCase { diff --git a/module/Rest/test/Middleware/BodyParserMiddlewareTest.php b/module/Rest/test/Middleware/BodyParserMiddlewareTest.php index e433322b..2c09f4dc 100644 --- a/module/Rest/test/Middleware/BodyParserMiddlewareTest.php +++ b/module/Rest/test/Middleware/BodyParserMiddlewareTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Rest\Middleware\BodyParserMiddleware; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequestFactory; use Zend\Diactoros\Stream; +use function array_shift; class BodyParserMiddlewareTest extends TestCase { diff --git a/phpcs.xml b/phpcs.xml index 1e1fcda9..2d4d3e65 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -40,7 +40,12 @@ <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/> <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/> <!-- Enforce all global namespace classes, functions and constants to be explicitly imported --> - <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/> + <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"> + <properties> + <property name="allowFallbackGlobalFunctions" value="false"/> + <property name="allowFallbackGlobalConstants" value="false"/> + </properties> + </rule> <!-- Paths to check --> <file>bin</file>