Skip to content

Commit

Permalink
Fix cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Azoog committed Jun 20, 2024
1 parent dfc8543 commit 828ce3d
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 47 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ jobs:
php-cs-fixer:
name: PHP Coding Standards Fixer
runs-on: ubuntu-latest

steps:
- 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.0
- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: 8.0
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
Expand Down
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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"require-dev": {
"atoum/atoum": "~4.0",
"phpstan/phpstan": "^1.9"
"phpstan/phpstan": "^1.9",
"friendsofphp/php-cs-fixer": "v3.59.3"
},
"suggest": {
"psr/http-message": "Required by \\Rezzza\\SecurityBundle\\Request\\Psr7RequestSigner"
Expand Down

0 comments on commit 828ce3d

Please sign in to comment.