Skip to content

Commit 8b28331

Browse files
committed
increase phpstan level
1 parent 6733ab0 commit 8b28331

30 files changed

+87
-47
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
level: 6
2+
level: 7
33
paths:
44
- src
55
- tests

rector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
SwitchNegatedTernaryRector::class,
2525
DisallowedEmptyRuleFixerRector::class,
2626
\Rector\Php81\Rector\Array_\FirstClassCallableRector::class,
27+
ExplicitBoolCompareRector::class,
2728
]);
2829

2930
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);

src/Bootstrap/AbstractBootstrap.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,4 @@ final public function setContainer(ContainerInterface $container): void
107107
{
108108
$this->container = $container;
109109
}
110-
111-
final protected function getPluginPath(): string
112-
{
113-
return $this->container->getParameter('kernel.root_dir') . DIRECTORY_SEPARATOR . $this->plugin->getPath();
114-
}
115110
}

src/Bootstrap/Database.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Database extends AbstractBootstrap
2020

2121
public function injectServices(): void
2222
{
23+
/* @phpstan-ignore-next-line */
2324
$this->connection = $this->container->get(Connection::class);
2425
}
2526

src/Bootstrap/PaymentMethods.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ class PaymentMethods extends AbstractBootstrap
6767

6868
public function injectServices(): void
6969
{
70+
/* @phpstan-ignore-next-line */
7071
$this->paymentRepository = $this->container->get('payment_method.repository');
72+
/* @phpstan-ignore-next-line */
7173
$this->paymentMethodDefinition = $this->container->get(PaymentMethodDefinition::class);
74+
/* @phpstan-ignore-next-line */
7275
$this->connection = $this->container->get(Connection::class);
7376
}
7477

src/Bootstrap/PluginConfiguration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class PluginConfiguration extends AbstractBootstrap
1818

1919
public function injectServices(): void
2020
{
21+
/* @phpstan-ignore-next-line */
2122
$this->configService = $this->container->get(SystemConfigService::class);
2223
}
2324

src/Components/AdminOrders/Controller/TokenController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function login(Request $request): Response
6161
],
6262
], $context);
6363

64+
/** @var array{scheme: string, host: string, path: ?string} $urlInfo */
6465
$urlInfo = parse_url((string) $saleChannelDomain->getUrl());
6566
$routerContext = $this->router->getContext();
6667
$routerContext

src/Components/Checkout/SalesChannel/HandlePaymentMethodRoute.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ public function load(Request $request, SalesChannelContext $context): HandlePaym
4646

4747
$paymentHandlerIdentifier = null;
4848
if ($request->request->getBoolean('updatePayment')) {
49+
/** @var string $orderId */
4950
$orderId = $request->request->get('orderId');
5051

52+
/** @var OrderEntity|null $order */
5153
$order = $this->orderRepository->search(CriteriaHelper::getCriteriaForOrder($orderId), $context->getContext())->first();
5254
if ($order instanceof OrderEntity && ($transaction = $order->getTransactions()->last()) instanceof OrderTransactionEntity) {
5355
$paymentHandlerIdentifier = $transaction->getPaymentMethod()->getHandlerIdentifier();

src/Components/DeviceFingerprint/Subscriber/DeviceFingerprintSubscriber.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ public static function getSubscribedEvents(): array
5050
];
5151
}
5252

53+
/**
54+
* @param BuildEvent<Head> $buildEvent
55+
*/
5356
public function onPaymentRequest(BuildEvent $buildEvent): void
5457
{
5558
/** @var PaymentRequestData $requestData */
5659
$requestData = $buildEvent->getRequestData();
57-
/** @var Head $head */
5860
$head = $buildEvent->getBuildData();
5961

6062
$ratepayData = RequestHelper::getRatepayData($requestData->getRequestDataBag());

src/Components/InstallmentCalculator/Controller/InstallmentRoute.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ public function __construct(
4141
], methods: ['GET'])]
4242
public function calculateInstallment(Request $request, SalesChannelContext $salesChannelContext, ?string $orderId = null): InstallmentCalculationResponse
4343
{
44-
$type = $request->query->get('type');
45-
$value = (int) $request->query->get('value');
46-
$value = $value ?: 1; // RATESWSX-186: fix that no "0" values can be provided
44+
$type = $request->query->getAlpha('type');
45+
$value = $request->query->getInt('value', 1); // RATESWSX-186: fix that no "0" values can be provided
4746

4847
if ($orderId) {
4948
$order = $this->orderRepository->search(CriteriaHelper::getCriteriaForOrder($orderId), $salesChannelContext->getContext())->first();

0 commit comments

Comments
 (0)