Skip to content

Commit

Permalink
Merge pull request #17 from fulll/sf7
Browse files Browse the repository at this point in the history
Allow symfony >= 5.4
  • Loading branch information
Azoog authored Jun 20, 2024
2 parents 112ceae + 004afc7 commit 25eebf5
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 70 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,37 @@ jobs:
php-cs-fixer:
name: PHP Coding Standards Fixer
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- uses: actions/checkout@v4
- name: Add HTTP basic auth credentials
run: echo '${{ secrets.COMPOSER_AUTH }}' > $GITHUB_WORKSPACE/auth.json
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: 8.3
args: --no-scripts --dev
- name: Php cs fixer
uses: fulll/actions/php-cs-fixer@master
run: bin/php-cs-fixer fix

phpstan:
name: PHPStan Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Add HTTP basic auth credentials
run: echo '${{ secrets.COMPOSER_AUTH }}' > $GITHUB_WORKSPACE/auth.json
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Install dependencies
uses: php-actions/composer@v5
uses: php-actions/composer@v6
with:
php_version: 8.0
args: --no-scripts
php_version: 8.3
args: --no-scripts --dev
- name: PHPStan Static Analysis
uses: php-actions/phpstan@v3
with:
version: 1.9.4
memory_limit: 1G
php_version: 8.0
args: --error-format=github
run: bin/phpstan --memory-limit=1G
3 changes: 0 additions & 3 deletions Controller/Annotations/ObfuscateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class ObfuscateRequest
*/
private $obfuscatedPatterns;

/**
* @param array $data data
*/
public function __construct(array $obfuscatedPatterns)
{
$this->obfuscatedPatterns = $obfuscatedPatterns;
Expand Down
2 changes: 1 addition & 1 deletion DataCollector/RequestDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(private AnnotationReader $annotationReader, private
{
}

public function collect(Request $request, Response $response, \Throwable $exception = null): void
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
parent::collect($request, $response, $exception);

Expand Down
3 changes: 0 additions & 3 deletions DependencyInjection/Compiler/ObfuscatorCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

class ObfuscatorCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
// request obfuscator is not enabled.
Expand Down
3 changes: 0 additions & 3 deletions DependencyInjection/RezzzaSecurityExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
*/
class RezzzaSecurityExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container): void
{
$processor = new Processor();
Expand Down
3 changes: 0 additions & 3 deletions Request/Obfuscator/RequestObfuscator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ class RequestObfuscator implements ObfuscatorInterface
public const TOKEN_REPLACE = 'X';
public const TOKEN_ALL = '*';

/**
* {@inheritdoc}
*/
public function obfuscate(array $data, array $obfuscatedPatterns)
{
foreach ($obfuscatedPatterns as $key => $pattern) {
Expand Down
3 changes: 0 additions & 3 deletions RezzzaSecurityBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
*/
class RezzzaSecurityBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container): void
{
parent::build($container);
Expand Down
6 changes: 0 additions & 6 deletions Security/Firewall/RequestSignatureProdiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

class RequestSignatureProdiver implements UserProviderInterface
{
/**
* {@inheritdoc}
*/
public function loadUserByUsername($username): UserInterface
{
throw new \LogicException(sprintf('Method %s should never be called.', __METHOD__));
Expand All @@ -33,9 +30,6 @@ public function refreshUser(UserInterface $user): UserInterface
return $user;
}

/**
* {@inheritdoc}
*/
public function supportsClass($class): bool
{
return SignatureValidUser::class === $class;
Expand Down
3 changes: 0 additions & 3 deletions Security/SignatureValidToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ public function __construct(SignatureValidUser $user)
$this->setUser($user);
}

/**
* {@inheritdoc}
*/
public function getCredentials(): string
{
return '';
Expand Down
18 changes: 0 additions & 18 deletions Security/SignatureValidUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,30 @@

class SignatureValidUser implements UserInterface
{
/**
* {@inheritdoc}
*/
public function getRoles(): array
{
return [];
}

/**
* {@inheritdoc}
*/
public function getPassword(): ?string
{
return null;
}

/**
* {@inheritdoc}
*/
public function getSalt(): ?string
{
return null;
}

/**
* {@inheritdoc}
*/
public function eraseCredentials(): void
{
}

/**
* {@inheritdoc}
*/
public function getUsername(): ?string
{
return '';
}

/**
* {@inheritdoc}
*/
public function getUserIdentifier(): string
{
return '';
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
}],
"require": {
"php": ">=8.0",
"symfony/framework-bundle": "~5.4|~6.0",
"symfony/security-bundle" : "~5.4|~6.0",
"symfony/framework-bundle": ">=5.4",
"symfony/security-bundle" : ">=5.4",
"doctrine/common": "~2.2|~3.0"
},
"require-dev": {
"atoum/atoum": "~4.0",
"phpstan/phpstan": "^1.9"
"phpstan/phpstan": "1.11.5",
"friendsofphp/php-cs-fixer": "v3.59.3"
},
"suggest": {
"psr/http-message": "Required by \\Rezzza\\SecurityBundle\\Request\\Psr7RequestSigner"
Expand Down
15 changes: 5 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ parameters:
count: 1
path: Controller/Annotations/ObfuscateRequest.php

-
message: "#^PHPDoc tag @param references unknown parameter\\: \\$data$#"
count: 1
path: Controller/Annotations/ObfuscateRequest.php

-
message: "#^Call to method getMethodAnnotation\\(\\) on an unknown class Doctrine\\\\Common\\\\Annotations\\\\Reader\\.$#"
count: 1
Expand Down Expand Up @@ -55,11 +50,6 @@ parameters:
count: 1
path: DependencyInjection/Security/Factory/RequestSignatureFactory.php

-
message: "#^Method Rezzza\\\\SecurityBundle\\\\DependencyInjection\\\\Security\\\\Factory\\\\RequestSignatureFactory\\:\\:createAuthenticator\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
count: 1
path: DependencyInjection/Security/Factory/RequestSignatureFactory.php

-
message: "#^Method Rezzza\\\\SecurityBundle\\\\DependencyInjection\\\\Security\\\\Factory\\\\RequestSignatureFactory\\:\\:createReplayProtection\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -205,6 +195,11 @@ parameters:
count: 1
path: Security/Firewall/RequestSignatureListener.php

-
message: "#^Class Rezzza\\\\SecurityBundle\\\\Security\\\\Firewall\\\\RequestSignatureProdiver implements generic interface Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserProviderInterface but does not specify its types\\: TUser$#"
count: 1
path: Security/Firewall/RequestSignatureProdiver.php

-
message: "#^Method Rezzza\\\\SecurityBundle\\\\Security\\\\Firewall\\\\RequestSignatureProdiver\\:\\:loadUserByUsername\\(\\) has parameter \\$username with no type specified\\.$#"
count: 1
Expand Down

0 comments on commit 25eebf5

Please sign in to comment.