Skip to content
Merged
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
19 changes: 8 additions & 11 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: test-integration
on: [ push ]
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php-versions: [ '8.2' ]
experimental: [ false ]
include:
- php-versions: '8.3'
experimental: true
php: ['8.2', '8.5']
timeout-minutes: 30
name: PHP ${{ matrix.php-versions }} on Ubuntu latest. Experimental == ${{ matrix.experimental }}
name: PHP ${{ matrix.php-versions }} on Ubuntu latest.
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -22,10 +21,8 @@ jobs:
uses: actions/checkout@master
- name: Install dependencies
run: composer install
continue-on-error: ${{ matrix.experimental }}
- name: Run CI tests
run: composer check
continue-on-error: ${{ matrix.experimental }}
run: composer check-ci
- name: Output log files on failure
if: failure()
run: tail -2000 /var/log/syslog
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
composer.lock
.phpunit.result.cache
ci/qa/.phpunit.result.cache
var/cache
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 6.0.0

Make Symfony 7.4 compatible

# 5.0.1 .. 5.0.11
Make the bundle SF6 proof. And upgrade code to be PHP 8.2 compatible
All homestead and vagrant references have been removed.
Expand Down
7 changes: 0 additions & 7 deletions ci/qa/phpcpd

This file was deleted.

1 change: 0 additions & 1 deletion ci/qa/phplint
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

cd $(dirname $0)/../../
mkdir -p var/qa

# https://github.com/overtrue/phplint
./vendor/bin/phplint --configuration=ci/qa/phplint.yaml $1
2 changes: 1 addition & 1 deletion ci/qa/phplint.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
path: [./src, ./tests]
jobs: 10
cache: /var/qa/phplint.cache
cache-dir: var/cache/qa/phplint.cache
extensions:
- php
exclude:
Expand Down
43 changes: 22 additions & 21 deletions ci/qa/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,66 +1,67 @@
parameters:
ignoreErrors:
-
message: "#^Method Surfnet\\\\GsspBundle\\\\Logger\\\\StepupRequestIdSariLogger\\:\\:log\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: ../../src/Logger/StepupRequestIdSariLogger.php

-
message: "#^Cannot access offset 'request_id' on array\\|DateTimeImmutable\\|int\\|string\\|null\\.$#"
count: 1
path: ../../src/Monolog/Processor/RequestIdProcessor.php

-
message: "#^Method Surfnet\\\\GsspBundle\\\\Saml\\\\ResponseContext\\:\\:getErrorStatus\\(\\) return type has no value type specified in iterable type array\\.$#"
message: '#^Method Surfnet\\GsspBundle\\Saml\\ResponseContext\:\:getErrorStatus\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../../src/Saml/ResponseContext.php

-
message: "#^Method Surfnet\\\\GsspBundle\\\\Saml\\\\ResponseContextInterface\\:\\:getErrorStatus\\(\\) return type has no value type specified in iterable type array\\.$#"
message: '#^Method Surfnet\\GsspBundle\\Saml\\ResponseContextInterface\:\:getErrorStatus\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../../src/Saml/ResponseContextInterface.php

-
message: "#^Method Surfnet\\\\GsspBundle\\\\Service\\\\StateHandler\\:\\:getErrorStatus\\(\\) return type has no value type specified in iterable type array\\.$#"
message: '#^Method Surfnet\\GsspBundle\\Service\\StateHandler\:\:getErrorStatus\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../../src/Service/StateHandler.php

-
message: "#^Method Surfnet\\\\GsspBundle\\\\Service\\\\StateHandler\\:\\:getScopingRequesterIds\\(\\) return type has no value type specified in iterable type array\\.$#"
message: '#^Method Surfnet\\GsspBundle\\Service\\StateHandler\:\:getScopingRequesterIds\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../../src/Service/StateHandler.php

-
message: "#^Parameter \\#1 \\$serviceProvider of method Surfnet\\\\GsspBundle\\\\Service\\\\StateHandler\\:\\:setRequestServiceProvider\\(\\) expects string, string\\|null given\\.$#"
message: '#^Parameter \#1 \$serviceProvider of method Surfnet\\GsspBundle\\Service\\StateHandler\:\:setRequestServiceProvider\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 2
path: ../../src/Service/StateHandler.php

-
message: "#^Method Surfnet\\\\GsspBundle\\\\Service\\\\StateHandlerInterface\\:\\:getErrorStatus\\(\\) return type has no value type specified in iterable type array\\.$#"
message: '#^Method Surfnet\\GsspBundle\\Service\\StateHandlerInterface\:\:getErrorStatus\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../../src/Service/StateHandlerInterface.php

-
message: "#^Method Surfnet\\\\GsspBundle\\\\Service\\\\StateHandlerInterface\\:\\:getScopingRequesterIds\\(\\) return type has no value type specified in iterable type array\\.$#"
message: '#^Method Surfnet\\GsspBundle\\Service\\StateHandlerInterface\:\:getScopingRequesterIds\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../../src/Service/StateHandlerInterface.php

-
message: "#^Cannot call method clear\\(\\) on Symfony\\\\Component\\\\HttpFoundation\\\\Session\\\\SessionInterface\\|null\\.$#"
message: '#^Cannot call method clear\(\) on Symfony\\Component\\HttpFoundation\\Session\\SessionInterface\|null\.$#'
identifier: method.nonObject
count: 1
path: ../../src/Service/ValueStore/SessionValueStore.php

-
message: "#^Cannot call method get\\(\\) on Symfony\\\\Component\\\\HttpFoundation\\\\Session\\\\SessionInterface\\|null\\.$#"
message: '#^Cannot call method get\(\) on Symfony\\Component\\HttpFoundation\\Session\\SessionInterface\|null\.$#'
identifier: method.nonObject
count: 1
path: ../../src/Service/ValueStore/SessionValueStore.php

-
message: "#^Cannot call method has\\(\\) on Symfony\\\\Component\\\\HttpFoundation\\\\Session\\\\SessionInterface\\|null\\.$#"
message: '#^Cannot call method has\(\) on Symfony\\Component\\HttpFoundation\\Session\\SessionInterface\|null\.$#'
identifier: method.nonObject
count: 1
path: ../../src/Service/ValueStore/SessionValueStore.php

-
message: "#^Cannot call method set\\(\\) on Symfony\\\\Component\\\\HttpFoundation\\\\Session\\\\SessionInterface\\|null\\.$#"
message: '#^Cannot call method set\(\) on Symfony\\Component\\HttpFoundation\\Session\\SessionInterface\|null\.$#'
identifier: method.nonObject
count: 1
path: ../../src/Service/ValueStore/SessionValueStore.php
48 changes: 23 additions & 25 deletions ci/qa/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.5/phpunit.xsd"
backupGlobals="false"
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
backupGlobals="false" colors="true"
bootstrap="../../vendor/autoload.php"
beStrictAboutTestsThatDoNotTestAnything="true"
failOnRisky="true">

<php>
<ini name="error_reporting" value="-1" />
</php>

<testsuites>
<testsuite name="unit">
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>../../src</directory>
<exclude>
<directory>../../src/*Bundle/Resources</directory>
<directory>../../src/*/*Bundle/Resources</directory>
<directory>../../src/*/Bundle/*Bundle/Resources</directory>
</exclude>
</whitelist>
</filter>
failOnRisky="true"
cacheDirectory="../../var/cache/qa/phpunit.cache"
>
<coverage>
<include>
<directory>../../src</directory>
</include>
<exclude>
<directory>../../src/*Bundle/Resources</directory>
<directory>../../src/*/*Bundle/Resources</directory>
<directory>../../src/*/Bundle/*Bundle/Resources</directory>
</exclude>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
</php>
<testsuites>
<testsuite name="unit">
<directory>../../tests</directory>
</testsuite>
</testsuites>
</phpunit>
17 changes: 17 additions & 0 deletions ci/qa/rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;

return RectorConfig::configure()
->withPaths([
__DIR__ . '/../../src',
__DIR__ . '/../../tests',
])
->withPhpSets()
->withAttributesSets(all: true)
->withComposerBased(twig: true, phpunit: true, symfony: true)
->withPHPStanConfigs([__DIR__.'/phpstan.neon'])
->withPreparedSets(deadCode: true)
;
5 changes: 5 additions & 0 deletions ci/qa/rector.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

# Ensure we run from project root
cd "$(dirname "$0")/../../" || exit 1
./vendor/bin/rector --config=ci/qa/rector.php "$@"
37 changes: 20 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,35 @@
"php": "^8.2",
"ext-openssl": "*",
"beberlei/assert": "^3",
"symfony/monolog-bundle": "^3.8",
"surfnet/stepup-saml-bundle": "^6.0",
"symfony/dependency-injection": "^6.4",
"symfony/framework-bundle": "^6.4"
"surfnet/stepup-saml-bundle": "^7.0",
"symfony/dependency-injection": "^7.4",
"symfony/framework-bundle": "^7.4",
"symfony/monolog-bundle": "^4.0"
},
"require-dev": {
"behat/behat": "^3.13",
"jakub-onderka/php-parallel-lint": "^1",
"malukenho/docheader": "^0",
"malukenho/docheader": "^1.1.0",
"mockery/mockery": "^1.5",
"overtrue/phplint": "*",
"overtrue/phplint": "^9.0",
"phpmd/phpmd": "^2.13",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-symfony": "^1.3",
"phpunit/phpcov": "^8.2",
"phpunit/phpunit": "^9.6",
"sebastian/phpcpd": "^6.0",
"slevomat/coding-standard": "^8.13",
"squizlabs/php_codesniffer": "^3.7.1",
"symfony/phpunit-bridge": "^6.4"
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpcov": "^10.0",
"phpunit/phpunit": "^11",
"rector/rector": "^2.3",
"slevomat/coding-standard": "^8.26",
"squizlabs/php_codesniffer": "^4.0",
"symfony/phpunit-bridge": "^7.4"
},
"scripts": {
"check": [
"@check-ci",
"@rector"
],
"check-ci": [
"@composer-validate",
"@docheader",
"@phplint",
"@phpcpd",
"@phpcs",
"@phpmd",
"@phpstan",
Expand All @@ -52,9 +54,10 @@
],
"behat": "./ci/qa/behat",
"composer-validate": "./ci/qa/validate",
"rector": "./ci/qa/rector.sh --dry-run",
"rector-fix": "./ci/qa/rector.sh",
"phplint": "./ci/qa/phplint",
"phpcs": "./ci/qa/phpcs",
"phpcpd": "./ci/qa/phpcpd",
"phpmd": "./ci/qa/phpmd",
"phpstan": "./ci/qa/phpstan",
"phpstan-baseline": "./ci/qa/phpstan-update-baseline",
Expand Down
6 changes: 3 additions & 3 deletions src/Controller/MetadataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

use Surfnet\SamlBundle\Http\XMLResponse;
use Surfnet\SamlBundle\Metadata\MetadataFactory;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

final class MetadataController
final readonly class MetadataController
{
public function __construct(private readonly MetadataFactory $metadataFactory)
public function __construct(private MetadataFactory $metadataFactory)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/SSOController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

/**
* Handles the SAML AuthnRequest from the service provider.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
*/
final class SSOController extends AbstractController
{
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/SSOReturnController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

/**
* Sends back the SAML return response to the service provider.
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Configuration implements ConfigurationInterface
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('surfnet_gssp');
$rootNode = $treeBuilder->getRootNode();
Expand Down
Loading