Skip to content

Commit b3cab67

Browse files
committed
refactor: Remove deprecated stuff from Symfony 5.
Now requires Symfony 6 and PHP 8.
1 parent 01ec7b1 commit b3cab67

File tree

9 files changed

+25
-231
lines changed

9 files changed

+25
-231
lines changed

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@
1111
"sso"
1212
],
1313
"require": {
14-
"php": ">= 7.4",
14+
"php": ">= 8.0.2",
1515
"ext-filter": "*",
1616
"ext-json": "*",
1717
"ext-simplexml": "*",
1818
"ecphp/cas-lib": "1.1.*",
1919
"psr/http-client": "^1.0",
2020
"psr/http-message": "^1.0",
21-
"symfony/framework-bundle": "^5.4",
22-
"symfony/psr-http-message-bridge": "^1 || ^2"
21+
"symfony/framework-bundle": "^6.0",
22+
"symfony/psr-http-message-bridge": "^2"
2323
},
2424
"require-dev": {
2525
"ecphp/php-conventions": "^1",
2626
"friends-of-phpspec/phpspec-code-coverage": "^6",
27-
"infection/infection": "^0.25",
27+
"infection/infection": "^0.26",
2828
"infection/phpspec-adapter": "^0.2",
2929
"loophp/unaltered-psr-http-message-bridge-bundle": "^2.0",
3030
"nyholm/psr7": "^1.2",
3131
"phpspec/phpspec": "^7",
3232
"phpstan/phpstan-symfony": "^1.1",
33-
"symfony/cache": "^5.4",
34-
"symfony/dependency-injection": "^5.4",
35-
"symfony/http-client": "^5.4",
33+
"symfony/cache": "^6.0",
34+
"symfony/dependency-injection": "^6.0",
35+
"symfony/http-client": "^6.0",
3636
"symfony/monolog-bundle": "^3.5",
37-
"symfony/routing": "^5.4",
38-
"symfony/security-bundle": "^5.4"
37+
"symfony/routing": "^6.0",
38+
"symfony/security-bundle": "^6.0"
3939
},
4040
"suggest": {
4141
"loophp/unaltered-psr-http-message-bridge-bundle": "A drop-in replacement for symfony/psr-http-message-bridge, that does not alter query parameters.",

docs/pages/installation.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,6 @@ This is the crucial part of your application's security.
3333

3434
Edit the security settings of your application, usually in `config/packages/security.yaml`.
3535

36-
.. code-block:: yaml
37-
38-
security:
39-
firewalls:
40-
main:
41-
anonymous: ~
42-
guard:
43-
provider: cas
44-
authenticators:
45-
- EcPhp\CasBundle\Security\CasGuardAuthenticator
46-
47-
access_control:
48-
- { path: ^/api, role: ROLE_CAS_AUTHENTICATED }
49-
- { path: ^/admin, role: ROLE_CAS_AUTHENTICATED }
50-
51-
If you're using Symfony >= 5.3, it is already possible to use the new security
52-
system (`more information`_). This is the default in Symfony 6.1.
53-
5436
.. code-block:: yaml
5537
5638
security:
@@ -134,6 +116,5 @@ The quickest solution for a working CAS server on any platform is this `Docker p
134116
.. _Docker project: https://github.com/crpeck/cas-overlay-docker
135117
.. _Apereo: https://www.apereo.org/
136118
.. _https://casserver.herokuapp.com/cas/: https://casserver.herokuapp.com/cas/
137-
.. _more information: https://symfony.com/blog/new-in-symfony-5-1-updated-security-system
138119
.. _loophp/unaltered-psr-http-message-bridge-bundle: https://github.com/loophp/unaltered-psr-http-message-bridge-bundle
139120
.. _API Platform: https://api-platform.com/

grumphp.yml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ parameters:
88
verbose: true
99
clover_coverage:
1010
clover_file: build/logs/clover.xml
11-
level: 50
11+
level: 75
1212
infection:
1313
threads: 10
1414
test_framework: phpspec
1515
configuration: infection.json.dist
16-
min_msi: 40
16+
min_msi: 60
1717
min_covered_msi: 90

infection.json.dist

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
2-
"timeout": 10,
2+
"timeout": 30,
33
"source": {
44
"directories": [
55
"src"
66
]
77
},
88
"logs": {
9+
"github": true,
910
"text": "build/infection.log",
1011
"summary": "build/summary.log",
1112
"debug": "build/debug.log",
1213
"perMutator": "build/per-mutator.md",
13-
"badge": {
14-
"branch": "master"
14+
"html": "build/report.html",
15+
"stryker": {
16+
"report": "master"
1517
}
1618
},
1719
"testFramework":"phpspec"

psalm-baseline.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

psalm.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xmlns="https://getpsalm.org/schema/config"
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8-
errorBaseline="psalm-baseline.xml"
98
>
109
<projectFiles>
1110
<directory name="src" />

spec/EcPhp/CasBundle/Cas.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ public static function getHttpClientMock()
3838
case 'http://local/cas/serviceValidate?ticket=ST-ticket&service=http%3A%2F%2Flocal%2Fcas%2FserviceValidate%3Fservice%3Dservice':
3939
case 'http://local/cas/serviceValidate?ticket=PT-ticket&service=http%3A%2F%2Flocal%2Fcas%2FproxyValidate%3Fservice%3Dservice':
4040
case 'http://local/cas/serviceValidate?ticket=PT-ticket&service=http%3A%2F%2Ffrom':
41-
$body = <<< 'EOF'
42-
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
43-
<cas:authenticationSuccess>
44-
<cas:user>username</cas:user>
45-
</cas:authenticationSuccess>
46-
</cas:serviceResponse>
47-
EOF;
48-
49-
break;
41+
$body = <<< 'EOF'
42+
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
43+
<cas:authenticationSuccess>
44+
<cas:user>username</cas:user>
45+
</cas:authenticationSuccess>
46+
</cas:serviceResponse>
47+
EOF;
48+
49+
break;
5050

5151
case 'http://local/cas/serviceValidate?service=service&ticket=ticket-failure':
5252
$body = <<< 'EOF'

src/Resources/config/services.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use EcPhp\CasBundle\Controller\Logout;
1818
use EcPhp\CasBundle\Controller\ProxyCallback;
1919
use EcPhp\CasBundle\Security\CasAuthenticator;
20-
use EcPhp\CasBundle\Security\CasGuardAuthenticator;
2120
use EcPhp\CasBundle\Security\Core\User\CasUserProvider;
2221
use EcPhp\CasLib\Cas;
2322
use EcPhp\CasLib\CasInterface;
@@ -50,10 +49,6 @@
5049
$services->set('cas.authenticator', CasAuthenticator::class);
5150
$services->alias(CasAuthenticator::class, 'cas.authenticator');
5251

53-
// The GuardAuthenticator will be removed in version 3.0
54-
$services->set('cas.guardauthenticator', CasGuardAuthenticator::class);
55-
$services->alias(CasGuardAuthenticator::class, 'cas.guardauthenticator');
56-
5752
$services
5853
->set(Homepage::class)
5954
->tag('controller.service_arguments');

src/Security/CasGuardAuthenticator.php

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)