Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return (new PhpCsFixer\Config())
->setRules([
'@PHP7x1Migration' => true,
Expand All @@ -10,6 +12,7 @@
'native_constant_invocation' => ['strict' => false],
'nullable_type_declaration_for_default_null_value' => true,
'modernize_strpos' => true,
'declare_strict_types' => ['strategy' => 'enforce'],
])
->setRiskyAllowed(true)
->setFinder(
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"symfony/console": "^7 || ^8"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "3.92.5",
"friendsofphp/php-cs-fixer": "3.95.1",
"phpunit/phpunit": "^11 || ^12 || ^13",
"guzzlehttp/guzzle": "^7.0",
"humbug/box": "^4.6",
Expand Down
2 changes: 2 additions & 0 deletions src/Initiator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Deviantintegral\Har;

use JMS\Serializer\Annotation as Serializer;
Expand Down
4 changes: 2 additions & 2 deletions src/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ public function __clone(): void

// Deep clone arrays of objects
if (isset($this->pages)) {
$this->pages = array_map(fn (Page $page) => clone $page, $this->pages);
$this->pages = array_map(static fn (Page $page) => clone $page, $this->pages);
}

if (isset($this->entries)) {
$this->entries = array_map(fn (Entry $entry) => clone $entry, $this->entries);
$this->entries = array_map(static fn (Entry $entry) => clone $entry, $this->entries);
}
}
}
2 changes: 1 addition & 1 deletion src/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getSerializerBuilder(): SerializerBuilder
$builder = SerializerBuilder::create()
->setPropertyNamingStrategy(new IdenticalPropertyNamingStrategy())
->configureHandlers(
function (HandlerRegistryInterface $registry) {
static function (HandlerRegistryInterface $registry) {
$registry->registerSubscribingHandler(
new DateFormatInterfaceHandler(Log::ISO_8601_MICROSECONDS)
);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Unit/Handler/TruncatingDateTimeHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function testGetSubscribingMethods(): void
$this->assertContains('xml', $formats);

// Verify method names are correctly formed for DateTimeInterface
$dateTimeInterfaceMethods = array_filter($methods, fn ($m) => 'DateTimeInterface' === $m['type']);
$dateTimeInterfaceMethods = array_filter($methods, static fn ($m) => 'DateTimeInterface' === $m['type']);
$methodNames = array_column($dateTimeInterfaceMethods, 'method');

// Method names should be deserializeDateTimeFromJson and deserializeDateTimeFromXml
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Unit/HarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private function removeCustomFields(array &$a): void
}
}

$a = array_filter($a, function ($key): bool {
$a = array_filter($a, static function ($key): bool {
return !\is_string($key) || !str_starts_with($key, '_');
}, \ARRAY_FILTER_USE_KEY);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Unit/PostDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function testGetBodySizeWithoutParamsDoesNotError(): void

// Set up error handler to catch any warnings
$warningTriggered = false;
$previousHandler = set_error_handler(function ($errno, $errstr) use (&$warningTriggered) {
$previousHandler = set_error_handler(static function ($errno, $errstr) use (&$warningTriggered) {
if (str_contains($errstr, 'foreach') || str_contains($errstr, 'null')) {
$warningTriggered = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Unit/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function testFromPsr7ServerRequest(): void

// Verify headers
$headers = $har_request->getHeaders();
$headerNames = array_map(fn ($h) => $h->getName(), $headers);
$headerNames = array_map(static fn ($h) => $h->getName(), $headers);
$this->assertContains('Host', $headerNames);
$this->assertContains('Accept', $headerNames);

Expand Down
Loading