Skip to content

Commit

Permalink
refactor: Update codebase for PHP 8 and Symfony 6.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Aug 29, 2022
1 parent 9de0a39 commit a0e10f6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 41 deletions.
15 changes: 4 additions & 11 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@ build:
environment:
php:
version: 8.1
dependencies:
before:
- pecl install pcov
tests:
override:
- php-scrutinizer-run
coverage:
dependencies:
before:
- pecl install pcov
pecl_extensions:
- pcov

filter:
paths:
- 'src/*'
- "src/*"

tools:
external_code_coverage:
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
"sso"
],
"require": {
"php": ">= 7.4",
"php": ">= 8.0.2",
"ext-json": "*",
"ext-simplexml": "*",
"ecphp/cas-bundle": "2.4.*",
"ecphp/ecas": "2.2.*",
"symfony/framework-bundle": "^5.4"
"ecphp/cas-bundle": "^2.5",
"ecphp/ecas": "^2.3",
"symfony/framework-bundle": "^6.0"
},
"require-dev": {
"ext-pcov": "*",
"ecphp/php-conventions": "^1",
"friends-of-phpspec/phpspec-code-coverage": "^6",
"infection/infection": "^0.24",
"infection/phpspec-adapter": "^0.1",
"nyholm/psr7": "^1.5",
"infection/infection": "^0.26",
"infection/phpspec-adapter": "^0.2",
"nyholm/psr7": "^1",
"phpspec/phpspec": "^7",
"symfony/security-core": "^5.4"
"symfony/security-core": "^6.0"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 5 additions & 3 deletions infection.json.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"timeout": 10,
"timeout": 30,
"source": {
"directories": [
"src"
]
},
"logs": {
"github": true,
"text": "build/infection.log",
"summary": "build/summary.log",
"debug": "build/debug.log",
"perMutator": "build/per-mutator.md",
"badge": {
"branch": "master"
"html": "build/report.html",
"stryker": {
"report": "master"
}
},
"testFramework":"phpspec"
Expand Down
21 changes: 3 additions & 18 deletions src/Security/Core/User/EuLoginUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function getProxyGrantingProtocol(): ?string
return $this->user->getAttribute('proxyGrantingProtocol');
}

public function getRoles()
public function getRoles(): array
{
$default = ['ROLE_CAS_AUTHENTICATED'];

Expand Down Expand Up @@ -256,7 +256,7 @@ public function getUid(): ?string
return $this->user->getAttribute('uid');
}

public function getUserIdentifier()
public function getUserIdentifier(): string
{
return $this->user->getUserIdentifier();
}
Expand All @@ -266,22 +266,7 @@ public function getUserManager(): ?string
return $this->user->getAttribute('userManager');
}

/**
* @deprecated since Symfony 5.3, use getUserIdentifier() instead
*/
public function getUsername()
{
trigger_deprecation(
'ecphp/eu-login-bundle',
'2.3.8',
'The method "%s::getUsername()" is deprecated, use %s::getUserIdentifier() instead.',
EuLoginUser::class
);

return $this->user->getUsername();
}

public function isEqualTo(UserInterface $user)
public function isEqualTo(UserInterface $user): bool
{
return $this->user->isEqualTo($user);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Security/Core/User/EuLoginUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(CasUserProviderInterface $casUserProvider)
$this->casUserProvider = $casUserProvider;
}

public function loadUserByIdentifier($identifier)
public function loadUserByIdentifier($identifier): UserInterface
{
throw new UnsupportedUserException('Unsupported operation.');
}
Expand Down

0 comments on commit a0e10f6

Please sign in to comment.