diff --git a/CHANGELOG.md b/CHANGELOG.md index b7df04c1..d967d392 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] +### Added +* *Nothing* + +### Changed +* [#1046](https://github.com/shlinkio/shlink/issues/1046) Dropped support for PHP 7.4. + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* *Nothing* + + ## [2.7.0] - 2021-05-23 ### Added * [#1044](https://github.com/shlinkio/shlink/issues/1044) Added ability to set names on API keys, which helps to identify them when the list grows. diff --git a/data/migrations/Version20180913205455.php b/data/migrations/Version20180913205455.php index ee6cd861..727e4400 100644 --- a/data/migrations/Version20180913205455.php +++ b/data/migrations/Version20180913205455.php @@ -57,7 +57,7 @@ final class Version20180913205455 extends AbstractMigration try { return (string) IpAddress::fromString($addr)->getAnonymizedCopy(); - } catch (InvalidArgumentException $e) { + } catch (InvalidArgumentException) { return null; } } diff --git a/module/CLI/src/Command/Util/AbstractWithDateRangeCommand.php b/module/CLI/src/Command/Util/AbstractWithDateRangeCommand.php index 39e60c9a..51731e3a 100644 --- a/module/CLI/src/Command/Util/AbstractWithDateRangeCommand.php +++ b/module/CLI/src/Command/Util/AbstractWithDateRangeCommand.php @@ -63,7 +63,7 @@ abstract class AbstractWithDateRangeCommand extends BaseCommand )); if ($output->isVeryVerbose()) { - $this->getApplication()->renderThrowable($e, $output); + $this->getApplication()?->renderThrowable($e, $output); } return null; diff --git a/module/CLI/src/Command/Visit/DownloadGeoLiteDbCommand.php b/module/CLI/src/Command/Visit/DownloadGeoLiteDbCommand.php index f86edfd1..aef30427 100644 --- a/module/CLI/src/Command/Visit/DownloadGeoLiteDbCommand.php +++ b/module/CLI/src/Command/Visit/DownloadGeoLiteDbCommand.php @@ -69,7 +69,7 @@ class DownloadGeoLiteDbCommand extends Command } if ($io->isVerbose()) { - $this->getApplication()->renderThrowable($e, $io); + $this->getApplication()?->renderThrowable($e, $io); } return $olderDbExists ? ExitCodes::EXIT_WARNING : ExitCodes::EXIT_FAILURE; diff --git a/module/CLI/src/Command/Visit/LocateVisitsCommand.php b/module/CLI/src/Command/Visit/LocateVisitsCommand.php index a9854c5b..31b1fb05 100644 --- a/module/CLI/src/Command/Visit/LocateVisitsCommand.php +++ b/module/CLI/src/Command/Visit/LocateVisitsCommand.php @@ -119,7 +119,7 @@ class LocateVisitsCommand extends AbstractLockedCommand implements VisitGeolocat } catch (Throwable $e) { $this->io->error($e->getMessage()); if ($this->io->isVerbose()) { - $this->getApplication()->renderThrowable($e, $this->io); + $this->getApplication()?->renderThrowable($e, $this->io); } return ExitCodes::EXIT_FAILURE; @@ -151,7 +151,7 @@ class LocateVisitsCommand extends AbstractLockedCommand implements VisitGeolocat } catch (WrongIpException $e) { $this->io->writeln(' [An error occurred while locating IP. Skipped]'); if ($this->io->isVerbose()) { - $this->getApplication()->renderThrowable($e, $this->io); + $this->getApplication()?->renderThrowable($e, $this->io); } throw IpCannotBeLocatedException::forError($e); diff --git a/module/Core/src/Entity/Visit.php b/module/Core/src/Entity/Visit.php index 358bedde..8174e8be 100644 --- a/module/Core/src/Entity/Visit.php +++ b/module/Core/src/Entity/Visit.php @@ -104,7 +104,7 @@ class Visit extends AbstractEntity implements JsonSerializable try { return (string) IpAddress::fromString($address)->getAnonymizedCopy(); - } catch (InvalidArgumentException $e) { + } catch (InvalidArgumentException) { return null; } } diff --git a/module/Core/test/EventDispatcher/CloseDbConnectionEventListenerTest.php b/module/Core/test/EventDispatcher/CloseDbConnectionEventListenerTest.php index 5f08e5fe..3d830cf3 100644 --- a/module/Core/test/EventDispatcher/CloseDbConnectionEventListenerTest.php +++ b/module/Core/test/EventDispatcher/CloseDbConnectionEventListenerTest.php @@ -44,7 +44,7 @@ class CloseDbConnectionEventListenerTest extends TestCase try { ($eventListener)(new stdClass()); - } catch (Throwable $e) { + } catch (Throwable) { // Ignore exceptions } diff --git a/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php b/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php index a0896976..08503757 100644 --- a/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php +++ b/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php @@ -13,7 +13,7 @@ use Psr\Http\Server\RequestHandlerInterface; use function array_shift; use function explode; -use function strpos; +use function str_contains; use function strtolower; class CreateShortUrlContentNegotiationMiddleware implements MiddlewareInterface @@ -62,7 +62,7 @@ class CreateShortUrlContentNegotiationMiddleware implements MiddlewareInterface { $accepts = explode(',', $acceptValue); $accept = strtolower(array_shift($accepts)); - return strpos($accept, 'text/plain') !== false ? self::PLAIN_TEXT : self::JSON; + return str_contains($accept, 'text/plain') ? self::PLAIN_TEXT : self::JSON; } private function determineBody(JsonResponse $resp): string diff --git a/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php index 6f8ddbb9..04ffb107 100644 --- a/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php @@ -16,8 +16,6 @@ use Shlinkio\Shlink\Core\ShortUrl\Transformer\ShortUrlDataTransformer; use Shlinkio\Shlink\Rest\Action\ShortUrl\ResolveShortUrlAction; use Shlinkio\Shlink\Rest\Entity\ApiKey; -use function strpos; - class ResolveShortUrlActionTest extends TestCase { use ProphecyTrait; @@ -46,6 +44,6 @@ class ResolveShortUrlActionTest extends TestCase $response = $this->action->handle($request); self::assertEquals(200, $response->getStatusCode()); - self::assertTrue(strpos($response->getBody()->getContents(), 'http://domain.com/foo/bar') > 0); + self::assertStringContainsString('http://domain.com/foo/bar', $response->getBody()->getContents()); } }