Skip to content

Commit

Permalink
style(*): Pass through code format tools
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Jan 16, 2025
1 parent e9dd878 commit 623a9f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Block/Adminhtml/Report/Metrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Metrics extends Template
*/
private $backendUrl;

const ORIGIN_CAPI = 'CAPI';// Constants::ORIGIN_CAPI is lowercase but CrowdSec uses uppercase
private const ORIGIN_CAPI = 'CAPI';// Constants::ORIGIN_CAPI is lowercase but CrowdSec uses uppercase

/**
* @param Remediation $remediation
Expand Down Expand Up @@ -93,7 +93,7 @@ public function getOriginsCount(): array
];
$originsCount = $this->remediation->getOriginsCount();
foreach ($originsCount as $origin => $remediations) {
foreach ($remediations as $remediation => $count) {
foreach ($remediations as $count) {
if ($origin === Constants::ORIGIN) {
$result[Constants::ORIGIN] += $count;
}
Expand Down
6 changes: 5 additions & 1 deletion Observer/BounceIp.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
use Psr\Cache\CacheException;
use Psr\Cache\InvalidArgumentException;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class BounceIp implements ObserverInterface
{

Expand Down Expand Up @@ -125,7 +128,8 @@ public function execute(Observer $observer): BounceIp

$response->setBody($content)->setStatusCode(Http::STATUS_CODE_403);
$this->remediation->updateMetricsOriginsCount(
$remediationData[RemediationConstants::ORIGIN_KEY], $remediation
$remediationData[RemediationConstants::ORIGIN_KEY],
$remediation
);
}
} catch (\Exception $e) {
Expand Down

0 comments on commit 623a9f9

Please sign in to comment.