Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-8470: Upgraded codebase to Symfony 6 #84

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
strategy:
matrix:
php:
- '8.0'
- '8.3'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
Expand All @@ -42,9 +42,7 @@ jobs:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.3'

steps:
- uses: actions/checkout@v2
Expand All @@ -57,7 +55,7 @@ jobs:
extensions: pdo_sqlite, gd
tools: cs2pr

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v3
with:
dependency-versions: "highest"

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": ">=8.3",
"composer-plugin-api": "^2.0",
"composer/semver": "^3.2"
},
"require-dev": {
"composer/composer": "^2.0.8",
"ibexa/code-style": "~2.0.0",
"phpstan/phpstan": "^1",
"phpstan/phpstan-phpunit": "^1",
"phpstan/phpstan-webmozart-assert": "^1",
"symfony/console": "^5.2",
"symfony/dotenv": "^5.2",
"symfony/finder": "^5.2",
"symfony/filesystem": "^5.2",
"symfony/phpunit-bridge": "^5.2",
"symfony/process": "^5.2",
"ibexa/code-style": "^1.0"
"symfony/console": "^6.4",
"symfony/dotenv": "^6.4",
"symfony/filesystem": "^6.4",
"symfony/finder": "^6.4",
"symfony/phpunit-bridge": "^6.4",
"symfony/process": "^6.4"
},
"autoload": {
"psr-4": {
Expand Down
14 changes: 11 additions & 3 deletions src/lib/Command/IbexaSetupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

class IbexaSetupCommand extends BaseCommand
{
/** @var \Composer\Semver\VersionParser */
private $versionParser;
private VersionParser $versionParser;

private const PSH_RESOURCES_PATH = __DIR__ . '/../../../resources/platformsh';

Expand All @@ -40,6 +39,9 @@ protected function configure(): void
;
}

/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
if ($input->getOption('platformsh')) {
Expand Down Expand Up @@ -108,6 +110,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return Command::SUCCESS;
}

/**
* @throws \Exception
*/
protected function getCommonFiles(string $product): Finder
{
$versionDir = $this->getVersionDirectory($product, self::PSH_RESOURCES_PATH . '/common');
Expand All @@ -122,6 +127,9 @@ protected function getCommonFiles(string $product): Finder
return $finder;
}

/**
* @throws \Exception
*/
protected function getProductSpecificFiles(string $product, string $version): Finder
{
$productDir = str_replace('/', '-', $product);
Expand Down Expand Up @@ -198,7 +206,7 @@ static function (SplFileInfo $dir): string {

private function getVersionParser(): VersionParser
{
if (null === $this->versionParser) {
if (!isset($this->versionParser)) {
$this->versionParser = new VersionParser();
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/CommandProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class CommandProvider implements \Composer\Plugin\Capability\CommandProvider
{
public function getCommands()
public function getCommands(): array
{
return [
new IbexaSetupCommand(),
Expand Down
2 changes: 1 addition & 1 deletion src/lib/PostInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function uninstall(Composer $composer, IOInterface $io): void
$io->write('[Ibexa PostInstall tool] Uninstall', true, IOInterface::DEBUG);
}

public function getCapabilities()
public function getCapabilities(): array
{
return [
CommandProvider::class => SetupToolCommandProvider::class,
Expand Down
Loading