From 508ca36cdb355a04e0f63aad7df5bc815d96393b Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 3 Mar 2024 22:55:15 +0100 Subject: [PATCH] Revert hack for FA 6.5.0; bump to PHP 8.2 --- .github/workflows/ci.yml | 3 +-- composer.json | 10 +++++----- src/DependencyInjection/TwigAwesomeExtension.php | 8 +------- src/IconLocator.php | 4 ++-- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6584b14..d0c3542 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,13 +64,12 @@ jobs: fail-fast: false matrix: php-version: - - '8.1' - '8.2' - '8.3' dependencies: - stable include: - - php-version: '8.1' + - php-version: '8.2' dependencies: low - php-version: '8.3' dependencies: dev diff --git a/composer.json b/composer.json index fb67737..147eb04 100644 --- a/composer.json +++ b/composer.json @@ -10,11 +10,11 @@ } ], "require": { - "php": ">= 8.1", + "php": ">= 8.2", "composer-runtime-api": "^2.1", - "fortawesome/font-awesome": "^6.3", - "symfony/dependency-injection": "^6.2 || ^7", - "symfony/http-kernel": "^6.2 || ^7", + "fortawesome/font-awesome": "^6.5.1", + "symfony/dependency-injection": "^6.4 || ^7", + "symfony/http-kernel": "^6.4 || ^7", "twig/twig": "^3.5" }, "require-dev": { @@ -22,7 +22,7 @@ "phpstan/extension-installer": "^1.3", "phpstan/phpstan": "^1.10.59", "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^10.5.10 || ^11.0.3", + "phpunit/phpunit": "^11.0.3", "symfony/filesystem": "^6.4 || ^7", "symfony/framework-bundle": "^6.4 || ^7", "symfony/twig-bundle": "^6.4 || ^7" diff --git a/src/DependencyInjection/TwigAwesomeExtension.php b/src/DependencyInjection/TwigAwesomeExtension.php index acfccc1..364d8c6 100644 --- a/src/DependencyInjection/TwigAwesomeExtension.php +++ b/src/DependencyInjection/TwigAwesomeExtension.php @@ -37,13 +37,7 @@ private function determineFaPath(): string $path = InstalledVersions::getInstallPath(self::PACKAGE_NAME) ?? throw new RuntimeException('Unable to determine FontAwesome\'s installation path.'); - $path = realpath($path) + return realpath($path) ?: throw new RuntimeException('Unable to determine FontAwesome\'s installation path.'); - - if (is_dir($path.'/free')) { - $path .= '/free'; - } - - return $path; } } diff --git a/src/IconLocator.php b/src/IconLocator.php index 364dd36..a319842 100644 --- a/src/IconLocator.php +++ b/src/IconLocator.php @@ -7,10 +7,10 @@ use Rabus\TwigAwesomeBundle\Exception\InvalidArgumentException; use Rabus\TwigAwesomeBundle\Exception\RuntimeException; -final class IconLocator +final readonly class IconLocator { public function __construct( - private readonly string $fontAwesomePath, + private string $fontAwesomePath, ) { }