From b0bc266e074b90afe8499887ee7b67e5ae747844 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 14 Aug 2024 12:14:35 +0200 Subject: [PATCH 1/3] chore(CI): Adjust testing matrix for Nextcloud 30 on main Signed-off-by: Joas Schilling --- .github/workflows/integration.yml | 3 +++ .github/workflows/phpunit.yml | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index f2cabdae..4d47daef 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -34,6 +34,9 @@ jobs: - php-versions: 8.1 databases: mysql server-versions: stable29 + - php-versions: 8.1 + databases: mysql + server-versions: stable30 - php-versions: 8.1 databases: mysql server-versions: master diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 5dfb893f..bc470f23 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -21,10 +21,12 @@ jobs: matrix: php-versions: ['7.4', '8.0', '8.1', '8.2'] databases: ['mysql'] - server-versions: ['stable26', 'stable27', 'stable28', 'stable29', 'master'] + server-versions: ['stable26', 'stable27', 'stable28', 'stable29', 'stable30', 'master'] exclude: - php-versions: 7.4 server-versions: master + - php-versions: 7.4 + server-versions: stable30 - php-versions: 7.4 server-versions: stable29 - php-versions: 7.4 @@ -35,10 +37,18 @@ jobs: server-versions: stable26 - php-versions: 8.0 server-versions: master + - php-versions: 8.0 + server-versions: stable30 include: - php-versions: 8.3 databases: mysql server-versions: stable28 + - php-versions: 8.3 + databases: mysql + server-versions: stable29 + - php-versions: 8.3 + databases: mysql + server-versions: stable30 - php-versions: 8.3 databases: mysql server-versions: master From ee6b9b9cee8c6b787b6827165dc3c29ab4f26480 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 14 Aug 2024 16:00:45 +0200 Subject: [PATCH 2/3] chore(CI): don't use Php 7.4 in CI anymore because min support NC version is 26 Signed-off-by: Julien Veyssier --- .github/workflows/lint.yml | 4 ++-- .github/workflows/phpunit.yml | 14 +------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4b1fe823..20efa93f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - php-versions: ['7.4', '8.0', "8.1"] + php-versions: ['8.0', '8.1', '8.2', '8.3'] name: php${{ matrix.php-versions }} steps: @@ -34,7 +34,7 @@ jobs: strategy: matrix: - php-versions: ['7.4'] + php-versions: ['8.0'] name: cs php${{ matrix.php-versions }} steps: diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index bc470f23..987e9438 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -19,22 +19,10 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.4', '8.0', '8.1', '8.2'] + php-versions: ['8.0', '8.1', '8.2'] databases: ['mysql'] server-versions: ['stable26', 'stable27', 'stable28', 'stable29', 'stable30', 'master'] exclude: - - php-versions: 7.4 - server-versions: master - - php-versions: 7.4 - server-versions: stable30 - - php-versions: 7.4 - server-versions: stable29 - - php-versions: 7.4 - server-versions: stable28 - - php-versions: 7.4 - server-versions: stable27 - - php-versions: 7.4 - server-versions: stable26 - php-versions: 8.0 server-versions: master - php-versions: 8.0 From 5792a2fc83defb7db8e97ef925ef884f5c1ca1f8 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 14 Aug 2024 17:15:31 +0200 Subject: [PATCH 3/3] fix(cs): run cs:fix Signed-off-by: Julien Veyssier --- lib/Controller/LoginController.php | 2 +- lib/Controller/SettingsController.php | 2 +- lib/Db/ProviderMapper.php | 6 +++--- tests/stubs/oc_core_command_base.php | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Controller/LoginController.php b/lib/Controller/LoginController.php index 2ebfd632..bf4102e6 100644 --- a/lib/Controller/LoginController.php +++ b/lib/Controller/LoginController.php @@ -208,7 +208,7 @@ private function buildProtocolErrorResponse(?bool $throttle = null): TemplateRes * @param string|null $redirectUrl * @return DataDisplayResponse|RedirectResponse|TemplateResponse */ - public function login(int $providerId, string $redirectUrl = null) { + public function login(int $providerId, ?string $redirectUrl = null) { if ($this->userSession->isLoggedIn()) { return new RedirectResponse($redirectUrl); } diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 89fdfefc..9d1057c9 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -140,7 +140,7 @@ public function createProvider(string $identifier, string $clientId, string $cli return new JSONResponse(array_merge($provider->jsonSerialize(), ['settings' => $providerSettings])); } - public function updateProvider(int $providerId, string $identifier, string $clientId, string $discoveryEndpoint, string $clientSecret = null, + public function updateProvider(int $providerId, string $identifier, string $clientId, string $discoveryEndpoint, ?string $clientSecret = null, array $settings = [], string $scope = 'openid email profile', ?string $endSessionEndpoint = null): JSONResponse { $provider = $this->providerMapper->getProvider($providerId); diff --git a/lib/Db/ProviderMapper.php b/lib/Db/ProviderMapper.php index 324cdf58..3c65ea30 100644 --- a/lib/Db/ProviderMapper.php +++ b/lib/Db/ProviderMapper.php @@ -105,9 +105,9 @@ public function getProviders() { * @throws MultipleObjectsReturnedException * @throws Exception */ - public function createOrUpdateProvider(string $identifier, string $clientid = null, - string $clientsecret = null, string $discoveryuri = null, string $scope = 'openid email profile', - string $endsessionendpointuri = null) { + public function createOrUpdateProvider(string $identifier, ?string $clientid = null, + ?string $clientsecret = null, ?string $discoveryuri = null, string $scope = 'openid email profile', + ?string $endsessionendpointuri = null) { try { $provider = $this->findProviderByIdentifier($identifier); } catch (DoesNotExistException $eNotExist) { diff --git a/tests/stubs/oc_core_command_base.php b/tests/stubs/oc_core_command_base.php index aca5e013..3f26894a 100644 --- a/tests/stubs/oc_core_command_base.php +++ b/tests/stubs/oc_core_command_base.php @@ -15,7 +15,7 @@ class Base { protected string $defaultOutputFormat = self::OUTPUT_FORMAT_PLAIN; - public function __construct(string $name = null) { + public function __construct(?string $name = null) { } protected function configure() { @@ -36,7 +36,7 @@ public function setDescription(string $description) { /** * @return $this */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) { + public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null) { } public function getApplication(): ?Application { @@ -51,7 +51,7 @@ public function getHelper(string $name) { /** * @return $this */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null) { + public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null) { } protected function writeArrayInOutputFormat(InputInterface $input, OutputInterface $output, array $items, string $prefix = ' - '): void {