Skip to content

Commit 0b82867

Browse files
Rafikooopierredup
authored andcommitted
Apply review suggestions
- Use getString() instead of get() for typed parameter access - Use dirname(__DIR__, N) instead of __DIR__.'/..' concatenation
1 parent fe0cbf2 commit 0b82867

7 files changed

Lines changed: 7 additions & 7 deletions

File tree

Controller/NotifyController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class NotifyController extends PayumController
99
{
1010
public function doUnsafeAction(Request $request): Response
1111
{
12-
$gateway = $this->getPayum()->getGateway($request->attributes->get('gateway'));
12+
$gateway = $this->getPayum()->getGateway($request->attributes->getString('gateway'));
1313

1414
$gateway->execute(new Notify(null));
1515

DependencyInjection/Factory/Storage/DoctrineStorageFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function addConfiguration(ArrayNodeDefinition $builder): void
3232

3333
protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition
3434
{
35-
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage'));
35+
$loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__, 3).'/Resources/config/storage'));
3636
$loader->load('doctrine.'.$config['driver'].'.php');
3737

3838
$storage = new ChildDefinition(sprintf('payum.storage.doctrine.%s', $config['driver']));

DependencyInjection/Factory/Storage/FilesystemStorageFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function addConfiguration(ArrayNodeDefinition $builder): void
2929

3030
protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition
3131
{
32-
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage'));
32+
$loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__, 3).'/Resources/config/storage'));
3333
$loader->load('filesystem.php');
3434

3535
$storage = new ChildDefinition('payum.storage.filesystem.prototype');

DependencyInjection/Factory/Storage/Propel1StorageFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function getName(): string
1818

1919
protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition
2020
{
21-
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage'));
21+
$loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__, 3).'/Resources/config/storage'));
2222
$loader->load('propel1.php');
2323

2424
$storage = new ChildDefinition('payum.storage.propel1');

DependencyInjection/Factory/Storage/Propel2StorageFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function getName(): string
1818

1919
protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition
2020
{
21-
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage'));
21+
$loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__, 3).'/Resources/config/storage'));
2222
$loader->load('propel2.php');
2323

2424
$storage = new ChildDefinition('payum.storage.propel2');

DependencyInjection/PayumExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function load(array $configs, ContainerBuilder $container): void
5252
$config = $this->processConfiguration($mainConfig, $configs);
5353

5454
// load services
55-
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
55+
$loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config'));
5656
$loader->load('payum.php');
5757
$loader->load('commands.php');
5858
$loader->load('controller.php');

Security/HttpRequestVerifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function verify($httpRequest)
3636
));
3737
}
3838

39-
if (! $hash = $httpRequest->attributes->get('payum_token', $httpRequest->query->get('payum_token', $httpRequest->request->get('payum_token')))) {
39+
if (! $hash = $httpRequest->attributes->getString('payum_token', $httpRequest->query->getString('payum_token', $httpRequest->request->getString('payum_token')))) {
4040
throw new NotFoundHttpException('Token parameter not set in request');
4141
}
4242

0 commit comments

Comments
 (0)