Skip to content

build: fix => style - #19

Merged
christeredvartsen merged 1 commit into
mainfrom
style
Jun 7, 2026
Merged

christeredvartsen merged 1 commit into
mainfrom
style

Conversation

@christeredvartsen

Copy link
Copy Markdown
Member

No description provided.

@christeredvartsen
christeredvartsen enabled auto-merge (squash) June 7, 2026 12:36
@christeredvartsen
christeredvartsen merged commit 47ac4a9 into main Jun 7, 2026
12 checks passed
@christeredvartsen
christeredvartsen deleted the style branch June 7, 2026 12:36
@imbo-automation

Copy link
Copy Markdown

Coding standard diff preview

Below is a preview of the changes that would be applied to each repository when this change is included in a new release of the coding standard. Changes to composer.json and composer.lock are excluded from the preview since they are not relevant to the coding standard changes.

The list of repositories is based on the .github/repos.json file in this repository.

imbo/behat-api-extension ⚠️ 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Context/Initializer/ApiClientAwareInitializerTest.php b/tests/Context/Initializer/ApiClientAwareInitializerTest.php
index bb2af76..a28b0cb 100644
--- a/tests/Context/Initializer/ApiClientAwareInitializerTest.php
+++ b/tests/Context/Initializer/ApiClientAwareInitializerTest.php
@@ -30,7 +30,7 @@ class ApiClientAwareInitializerTest extends TestCase
 
         $result = false;
 
-        for ($port = 8000; $port < 8079; ++$port) {
+        for ($port = 8_000; $port < 8_079; ++$port) {
             if ($result = socket_bind($sock, 'localhost', $port)) {
                 break;
             }
imbo/imbo ⚠️ 30 files changed, 185 insertions(+), 185 deletions(-)
diff --git a/adapter-sdk/Database/DatabaseTests.php b/adapter-sdk/Database/DatabaseTests.php
index bbde645..442e080 100644
--- a/adapter-sdk/Database/DatabaseTests.php
+++ b/adapter-sdk/Database/DatabaseTests.php
@@ -96,7 +96,7 @@ abstract class DatabaseTests extends TestCase
         $this->assertSame(665, $image->getWidth(), 'Image width is incorrect');
         $this->assertSame(463, $image->getHeight(), 'Image height is incorrect');
         $this->assertSame('image/jpeg', $image->getMimeType(), 'Image mime type is incorrect');
-        $this->assertSame(64828, $image->getFilesize(), 'Image filesize is incorrect');
+        $this->assertSame(64_828, $image->getFilesize(), 'Image filesize is incorrect');
         $this->assertSame('jpg', $image->getExtension(), 'Image extension is incorrect');
 
         $properties = $this->adapter->getImageProperties($user, $imageIdentifier);
@@ -112,7 +112,7 @@ abstract class DatabaseTests extends TestCase
             );
         }
 
-        $this->assertSame(64828, $properties['size'], 'Incorrect size in image properties');
+        $this->assertSame(64_828, $properties['size'], 'Incorrect size in image properties');
         $this->assertSame('jpg', $properties['extension'], 'Incorrect extension in image properties');
         $this->assertSame('image/jpeg', $properties['mime'], 'Incorrect mime in image properties');
         $this->assertEqualsWithDelta(time(), $properties['added'], 2, 'Incorrect added timestamp in image properties');
@@ -211,7 +211,7 @@ abstract class DatabaseTests extends TestCase
      */
     public static function getDataForLastModificationTest(): array
     {
-        $image = self::getImageModel('test-image.png', 1499234238, 1499234238)
+        $image = self::getImageModel('test-image.png', 1_499_234_238, 1_499_234_238)
             ->setUser('user')
             ->setImageIdentifier(uniqid());
         $image2 = clone $image;
@@ -1515,7 +1515,7 @@ abstract class DatabaseTests extends TestCase
         $num = $this->adapter->getNumBytes('user');
 
         $this->assertSame(
-            1402,
+            1_402,
             $num,
             sprintf('Expected 1402 bytes, got %d', $num),
         );
@@ -1528,7 +1528,7 @@ abstract class DatabaseTests extends TestCase
         $num = $this->adapter->getNumBytes('user2');
 
         $this->assertSame(
-            1402,
+            1_402,
             $num,
             sprintf('Expected 1402 bytes, got %d', $num),
         );
@@ -1536,7 +1536,7 @@ abstract class DatabaseTests extends TestCase
         $num = $this->adapter->getNumBytes();
 
         $this->assertSame(
-            2804,
+            2_804,
             $num,
             sprintf('Expected 2804 bytes, got %d', $num),
         );
@@ -1593,36 +1593,36 @@ abstract class DatabaseTests extends TestCase
                 'sort' => ['size'],
                 'field' => 'size',
                 'values' => [
-                    41423,
-                    64828,
-                    74337,
-                    84988,
-                    92795,
-                    95576,
+                    41_423,
+                    64_828,
+                    74_337,
+                    84_988,
+                    92_795,
+                    95_576,
                 ],
             ],
             'desc sort on size' => [
                 'sort' => ['size:desc'],
                 'field' => 'size',
                 'values' => [
-                    95576,
-                    92795,
-                    84988,
-                    74337,
-                    64828,
-                    41423,
+                    95_576,
+                    92_795,
+                    84_988,
+                    74_337,
+                    64_828,
+                    41_423,
                 ],
             ],
             'sort on multiple fields' => [
                 'sort' => ['width:asc', 'size:desc'],
                 'field' => 'size',
                 'values' => [
-                    74337,
-                    84988,
-                    92795,
-                    95576,
-                    64828,
-                    41423,
+                    74_337,
+                    84_988,
+                    92_795,
+                    95_576,
+                    64_828,
+                    41_423,
                 ],
             ],
         ];
diff --git a/adapter-sdk/EventListener/ImageVariations/Database/DatabaseTests.php b/adapter-sdk/EventListener/ImageVariations/Database/DatabaseTests.php
index b494519..a571eca 100644
--- a/adapter-sdk/EventListener/ImageVariations/Database/DatabaseTests.php
+++ b/adapter-sdk/EventListener/ImageVariations/Database/DatabaseTests.php
@@ -110,7 +110,7 @@ abstract class DatabaseTests extends TestCase
     {
         return [
             'image larger than all variations' => [
-                'imageWidth' => 1000,
+                'imageWidth' => 1_000,
                 'bestMatch' => null,
             ],
             'pick the largest variation' => [
diff --git a/features/bootstrap/imbo-configs/cors.php b/features/bootstrap/imbo-configs/cors.php
index 4c71bbc..cee581a 100644
--- a/features/bootstrap/imbo-configs/cors.php
+++ b/features/bootstrap/imbo-configs/cors.php
@@ -20,7 +20,7 @@ return [
                     'user' => ['GET', 'HEAD'],
                     'shorturl' => ['GET', 'HEAD'],
                 ],
-                'maxAge' => 1349,
+                'maxAge' => 1_349,
             ],
         ],
     ],
diff --git a/features/bootstrap/imbo-configs/custom-event-listeners.php b/features/bootstrap/imbo-configs/custom-event-listeners.php
index 13b664a..9915bde 100644
--- a/features/bootstrap/imbo-configs/custom-event-listeners.php
+++ b/features/bootstrap/imbo-configs/custom-event-listeners.php
@@ -42,7 +42,7 @@ return [
     'eventListeners' => [
         'someHandler' => [
             'events' => [
-                'index.get' => 1000,
+                'index.get' => 1_000,
             ],
             'callback' => static function (EventInterface $event) {
                 $event->getResponse()->headers->set('X-Imbo-SomeHandler', (string) microtime(true));
diff --git a/features/bootstrap/imbo-configs/enforce-max-image-size.php b/features/bootstrap/imbo-configs/enforce-max-image-size.php
index 2bdcfca..69cd06f 100644
--- a/features/bootstrap/imbo-configs/enforce-max-image-size.php
+++ b/features/bootstrap/imbo-configs/enforce-max-image-size.php
@@ -9,7 +9,7 @@ return [
         'maxImageSize' => [
             'listener' => MaxImageSize::class,
             'params' => [
-                'width' => 1000,
+                'width' => 1_000,
                 'height' => 600,
             ],
         ],
diff --git a/features/bootstrap/imbo-configs/image-variations.php b/features/bootstrap/imbo-configs/image-variations.php
index 218d1c2..a20bb9f 100644
--- a/features/bootstrap/imbo-configs/image-variations.php
+++ b/features/bootstrap/imbo-configs/image-variations.php
@@ -22,7 +22,7 @@ return [
                 ],
                 'widths' => [320],
                 'minWidth' => 100,
-                'maxWidth' => 2048,
+                'maxWidth' => 2_048,
                 'minDiff' => 100,
                 'autoScale' => true,
                 'lossless' => false,
diff --git a/src/Database/MongoDB.php b/src/Database/MongoDB.php
index 2dd9fc7..fb5b883 100644
--- a/src/Database/MongoDB.php
+++ b/src/Database/MongoDB.php
@@ -121,7 +121,7 @@ class MongoDB implements DatabaseInterface
         try {
             $this->imageCollection->insertOne($data);
         } catch (BulkWriteException $e) {
-            if (11000 === $e->getCode()) {
+            if (11_000 === $e->getCode()) {
                 throw new DuplicateImageIdentifierException('Duplicate image identifier when attempting to insert image into DB.', 503);
             }
 
diff --git a/src/Database/MySQL.php b/src/Database/MySQL.php
index 7ebca7c..be7b9bf 100644
--- a/src/Database/MySQL.php
+++ b/src/Database/MySQL.php
@@ -14,6 +14,6 @@ class MySQL extends PDOAdapter
 
     protected function getUniqueConstraintExceptionCode(): int
     {
-        return 23000;
+        return 23_000;
     }
 }
diff --git a/src/Database/PostgreSQL.php b/src/Database/PostgreSQL.php
index 770cc45..6cfa239 100644
--- a/src/Database/PostgreSQL.php
+++ b/src/Database/PostgreSQL.php
@@ -14,6 +14,6 @@ class PostgreSQL extends PDOAdapter
 
     protected function getUniqueConstraintExceptionCode(): int
     {
-        return 23505;
+        return 23_505;
     }
 }
diff --git a/src/Database/SQLite.php b/src/Database/SQLite.php
index e0a5a60..2b29ca7 100644
--- a/src/Database/SQLite.php
+++ b/src/Database/SQLite.php
@@ -25,6 +25,6 @@ class SQLite extends PDOAdapter
 
     protected function getUniqueConstraintExceptionCode(): int
     {
-        return 23000;
+        return 23_000;
     }
 }
diff --git a/src/EventListener/Cors.php b/src/EventListener/Cors.php
index 0d3cd9d..b8d5a88 100644
--- a/src/EventListener/Cors.php
+++ b/src/EventListener/Cors.php
@@ -36,7 +36,7 @@ class Cors implements ListenerInterface
             'shorturl' => ['GET', 'HEAD'],
             'shorturls' => ['GET', 'HEAD'],
         ],
-        'maxAge' => 3600,
+        'maxAge' => 3_600,
     ];
 
     /**
@@ -85,7 +85,7 @@ class Cors implements ListenerInterface
         foreach ($this->params['allowedMethods'] as $resource => $methods) {
             foreach ($methods as $method) {
                 $eventName = $resource.'.'.strtolower($method);
-                $events[$eventName] = ['invoke' => 1000];
+                $events[$eventName] = ['invoke' => 1_000];
             }
 
             // Always enable the listener for the OPTIONS method
diff --git a/src/EventListener/ExifMetadata.php b/src/EventListener/ExifMetadata.php
index d26fcf9..70ac693 100644
--- a/src/EventListener/ExifMetadata.php
+++ b/src/EventListener/ExifMetadata.php
@@ -195,7 +195,7 @@ class ExifMetadata implements ListenerInterface
         }
 
         $sign = ('W' === $hemisphere || 'S' === $hemisphere) ? -1 : 1;
-        $degrees = ($coordinates[0] + ($coordinates[1] / 60) + ($coordinates[2] / 3600));
+        $degrees = ($coordinates[0] + ($coordinates[1] / 60) + ($coordinates[2] / 3_600));
 
         return $sign * $degrees;
     }
diff --git a/src/EventListener/ImageVariations.php b/src/EventListener/ImageVariations.php
index 9647c6f..f163c23 100644
--- a/src/EventListener/ImageVariations.php
+++ b/src/EventListener/ImageVariations.php
@@ -45,7 +45,7 @@ class ImageVariations implements ListenerInterface
         'minWidth' => 100,
 
         // Don't start resizing until the size falls below this limit
-        'maxWidth' => 1024,
+        'maxWidth' => 1_024,
 
         // Specific widths to generate, in addition to the auto scaling
         'widths' => [],
diff --git a/src/Resource/Image.php b/src/Resource/Image.php
index 18fbe69..9c7834f 100644
--- a/src/Resource/Image.php
+++ b/src/Resource/Image.php
@@ -63,7 +63,7 @@ class Image implements ResourceInterface
         $eventManager->trigger('db.image.load');
 
         // Set a long max age as the image itself won't change
-        $response->setMaxAge(31536000);
+        $response->setMaxAge(31_536_000);
 
         // Custom Imbo headers, based on original
         $response->headers->add([
diff --git a/tests/Behat/FeatureContextTest.php b/tests/Behat/FeatureContextTest.php
index 46b607a..c70f84d 100644
--- a/tests/Behat/FeatureContextTest.php
+++ b/tests/Behat/FeatureContextTest.php
@@ -2535,8 +2535,8 @@ class FeatureContextTest extends TestCase
                 ],
                 'match' => new TableNode([
                     ['response', 'image width', 'image height'],
-                    ['1',        1024,          256],
-                    ['2',        256,           1024],
+                    ['1',        1_024,          256],
+                    ['2',        256,           1_024],
                 ]),
             ],
             'body is' => [
@@ -2606,8 +2606,8 @@ class FeatureContextTest extends TestCase
                 ],
                 'match' => new TableNode([
                     ['response', 'image width', 'image height'],
-                    ['1',        1024,          256],
-                    ['2',        255,           1024],
+                    ['1',        1_024,          256],
+                    ['2',        255,           1_024],
                 ]),
                 'exceptionMessage' => 'Expected image in response 2 to be 255 pixel(s) wide, actual: 256.',
             ],
@@ -2618,8 +2618,8 @@ class FeatureContextTest extends TestCase
                 ],
                 'match' => new TableNode([
                     ['response', 'image width', 'image height'],
-                    ['1',        1024,          256],
-                    ['2',        256,           1023],
+                    ['1',        1_024,          256],
+                    ['2',        256,           1_023],
                 ]),
                 'exceptionMessage' => 'Expected image in response 2 to be 1023 pixel(s) high, actual: 1024.',
             ],
diff --git a/tests/EventListener/CorsTest.php b/tests/EventListener/CorsTest.php
index d3d5b20..4c228a9 100644
--- a/tests/EventListener/CorsTest.php
+++ b/tests/EventListener/CorsTest.php
@@ -414,48 +414,48 @@ class CorsTest extends ListenerTests
             'default' => [
                 'params' => [],
                 'events' => [
-                    'index.get' => ['invoke' => 1000],
-                    'index.head' => ['invoke' => 1000],
+                    'index.get' => ['invoke' => 1_000],
+                    'index.head' => ['invoke' => 1_000],
                     'index.options' => ['options' => 20],
 
-                    'image.get' => ['invoke' => 1000],
-                    'image.head' => ['invoke' => 1000],
+                    'image.get' => ['invoke' => 1_000],
+                    'image.head' => ['invoke' => 1_000],
                     'image.options' => ['options' => 20],
 
-                    'images.get' => ['invoke' => 1000],
-                    'images.head' => ['invoke' => 1000],
+                    'images.get' => ['invoke' => 1_000],
+                    'images.head' => ['invoke' => 1_000],
                     'images.options' => ['options' => 20],
 
-                    'globalimages.get' => ['invoke' => 1000],
-                    'globalimages.head' => ['invoke' => 1000],
+                    'globalimages.get' => ['invoke' => 1_000],
+                    'globalimages.head' => ['invoke' => 1_000],
                     'globalimages.options' => ['options' => 20],
 
-                    'metadata.get' => ['invoke' => 1000],
-                    'metadata.head' => ['invoke' => 1000],
+                    'metadata.get' => ['invoke' => 1_000],
+                    'metadata.head' => ['invoke' => 1_000],
                     'metadata.options' => ['options' => 20],
 
-                    'status.get' => ['invoke' => 1000],
-                    'status.head' => ['invoke' => 1000],
+                    'status.get' => ['invoke' => 1_000],
+                    'status.head' => ['invoke' => 1_000],
                     'status.options' => ['options' => 20],
 
-                    'stats.get' => ['invoke' => 1000],
-                    'stats.head' => ['invoke' => 1000],
+                    'stats.get' => ['invoke' => 1_000],
+                    'stats.head' => ['invoke' => 1_000],
                     'stats.options' => ['options' => 20],
 
-                    'user.get' => ['invoke' => 1000],
-                    'user.head' => ['invoke' => 1000],
+                    'user.get' => ['invoke' => 1_000],
+                    'user.head' => ['invoke' => 1_000],
                     'user.options' => ['options' => 20],
 
-                    'globalshorturl.get' => ['invoke' => 1000],
-                    'globalshorturl.head' => ['invoke' => 1000],
+                    'globalshorturl.get' => ['invoke' => 1_000],
+                    'globalshorturl.head' => ['invoke' => 1_000],
                     'globalshorturl.options' => ['options' => 20],
 
-                    'shorturl.get' => ['invoke' => 1000],
-                    'shorturl.head' => ['invoke' => 1000],
+                    'shorturl.get' => ['invoke' => 1_000],
+                    'shorturl.head' => ['invoke' => 1_000],
                     'shorturl.options' => ['options' => 20],
 
-                    'shorturls.get' => ['invoke' => 1000],
-                    'shorturls.head' => ['invoke' => 1000],
+                    'shorturls.get' => ['invoke' => 1_000],
+                    'shorturls.head' => ['invoke' => 1_000],
                     'shorturls.options' => ['options' => 20],
                 ],
             ],
@@ -467,9 +467,9 @@ class CorsTest extends ListenerTests
                     ],
                 ],
                 'events' => [
-                    'stats.get' => ['invoke' => 1000],
+                    'stats.get' => ['invoke' => 1_000],
                     'stats.options' => ['options' => 20],
-                    'images.post' => ['invoke' => 1000],
+                    'images.post' => ['invoke' => 1_000],
                     'images.options' => ['options' => 20],
                 ],
             ],
diff --git a/tests/EventListener/DatabaseOperationsTest.php b/tests/EventListener/DatabaseOperationsTest.php
index c42c476..1e55b89 100644
--- a/tests/EventListener/DatabaseOperationsTest.php
+++ b/tests/EventListener/DatabaseOperationsTest.php
@@ -225,8 +225,8 @@ class DatabaseOperationsTest extends ListenerTests
         $this->request->query = new InputBag([
             'page' => 1,
             'limit' => 5,
-            'from' => 1355156488,
-            'to' => 1355176488,
+            'from' => 1_355_156_488,
+            'to' => 1_355_176_488,
             'sort' => ['size:desc'],
             'ids' => ['identifier1', 'identifier2', 'identifier3'],
             'checksums' => ['checksum1', 'checksum2', 'checksum3'],
diff --git a/tests/EventListener/ExifMetadataTest.php b/tests/EventListener/ExifMetadataTest.php
index a65db4a..1f10a42 100644
--- a/tests/EventListener/ExifMetadataTest.php
+++ b/tests/EventListener/ExifMetadataTest.php
@@ -180,8 +180,8 @@ class ExifMetadataTest extends ListenerTests
         /** @var array{"gps:location":array<float>,"gps:altitude":float} */
         $properties = $listener->populate($event);
 
-        $this->assertEqualsWithDelta(9.0841802, $properties['gps:location'][0], 0.05);
-        $this->assertEqualsWithDelta(63.680437300003, $properties['gps:location'][1], 0.05);
+        $this->assertEqualsWithDelta(9.084_180_2, $properties['gps:location'][0], 0.05);
+        $this->assertEqualsWithDelta(63.680_437_300_003, $properties['gps:location'][1], 0.05);
         $this->assertEqualsWithDelta(50.8, $properties['gps:altitude'], 0.05);
     }
 
@@ -265,7 +265,7 @@ class ExifMetadataTest extends ListenerTests
                 'data' => $data,
                 'tags' => ['*'],
                 'expectedData' => array_merge($data, [
-                    'gps:location' => [9.0841802, 63.68043730000316],
+                    'gps:location' => [9.084_180_2, 63.680_437_300_003_16],
                     'gps:altitude' => 50.8,
                 ]),
             ],
@@ -294,7 +294,7 @@ class ExifMetadataTest extends ListenerTests
                     'exif:GPSVersionID' => '2, 2, 0, 0',
                     'exif:Make' => 'SAMSUNG',
                     'exif:Model' => 'GT-I9100',
-                    'gps:location' => [9.0841802, 63.68043730000316],
+                    'gps:location' => [9.084_180_2, 63.680_437_300_003_16],
                     'gps:altitude' => 50.8,
                 ],
             ],
diff --git a/tests/EventListener/ImageVariationsTest.php b/tests/EventListener/ImageVariationsTest.php
index e3e1498..bf06551 100644
--- a/tests/EventListener/ImageVariationsTest.php
+++ b/tests/EventListener/ImageVariationsTest.php
@@ -250,7 +250,7 @@ class ImageVariationsTest extends ListenerTests
     #[AllowMockObjectsWithoutExpectations]
     public function testFallsBackIfNoRelevantTransformationsApplied(): void
     {
-        $width = 1024;
+        $width = 1_024;
         $height = 768;
         $transformations = [
             [
@@ -286,12 +286,12 @@ class ImageVariationsTest extends ListenerTests
     #[AllowMockObjectsWithoutExpectations]
     public function testFallsBackIfSizeIsLargerThanOriginal(): void
     {
-        $width = 1024;
+        $width = 1_024;
         $height = 768;
         $transformations = [
             [
                 'name' => 'maxSize',
-                'params' => ['width' => 2048],
+                'params' => ['width' => 2_048],
             ],
         ];
 
@@ -312,7 +312,7 @@ class ImageVariationsTest extends ListenerTests
             ->method('getMinimumImageInputSize')
             ->willReturn([
                 'index' => 0,
-                'width' => 2048,
+                'width' => 2_048,
             ]);
 
         $this->eventManager
@@ -325,7 +325,7 @@ class ImageVariationsTest extends ListenerTests
     #[AllowMockObjectsWithoutExpectations]
     public function testFallsBackIfDatabaseDoesNotReturnAnyVariation(): void

Diff truncated (showing 500 of 1255 lines).

imbo/imbo-b2-adapters ⚠️ 5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/B2.php b/src/B2.php
index d627c33..c95c26e 100644
--- a/src/B2.php
+++ b/src/B2.php
@@ -86,9 +86,9 @@ class B2 implements StorageInterface
 
         $timestamp = isset($info['x-bz-info-src_last_modified_millis'])
             ? (int) $info['x-bz-info-src_last_modified_millis']
-            : (time() * 1000);
+            : (time() * 1_000);
 
-        return new DateTime('@'.(int) ($timestamp / 1000));
+        return new DateTime('@'.(int) ($timestamp / 1_000));
     }
 
     public function getStatus(): bool
diff --git a/src/Client.php b/src/Client.php
index 77714c5..3eaed60 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -95,7 +95,7 @@ class Client
                         'Content-Length' => strlen($data),
                         'X-Bz-Content-Sha1' => sha1($data),
                         'X-Bz-File-Name' => $fileName,
-                        'X-Bz-Info-src_last_modified_millis' => time() * 1000,
+                        'X-Bz-Info-src_last_modified_millis' => time() * 1_000,
                     ],
                     RequestOptions::BODY => $data,
                 ]);
diff --git a/tests/B2Test.php b/tests/B2Test.php
index 223a661..082f9e8 100644
--- a/tests/B2Test.php
+++ b/tests/B2Test.php
@@ -270,12 +270,12 @@ class B2Test extends TestCase
     {
         return [
             'with timestamp' => [
-                'fileInfo' => ['x-bz-info-src_last_modified_millis' => 1462212185001],
-                'expectedTimestamp' => '@'. 1462212185,
+                'fileInfo' => ['x-bz-info-src_last_modified_millis' => 1_462_212_185_001],
+                'expectedTimestamp' => '@'. 1_462_212_185,
             ],
 
             'missing timestamp' => [
-                'fileInfo' => ['Last-Modified' => 1462212185001],
+                'fileInfo' => ['Last-Modified' => 1_462_212_185_001],
                 'expectedTimestamp' => 'now',
             ],
         ];
diff --git a/tests/ClientIntegrationTest.php b/tests/ClientIntegrationTest.php
index 8ddb03d..de1a320 100644
--- a/tests/ClientIntegrationTest.php
+++ b/tests/ClientIntegrationTest.php
@@ -50,9 +50,9 @@ class ClientIntegrationTest extends TestCase
         );
 
         $this->assertEqualsWithDelta(
-            time() * 1000,
+            time() * 1_000,
             (int) $info['x-bz-info-src_last_modified_millis'],
-            5000,
+            5_000,
             'Last modification timestamp is off',
         );
     }
diff --git a/tests/ClientTest.php b/tests/ClientTest.php
index 5a9a868..1afcfe7 100644
--- a/tests/ClientTest.php
+++ b/tests/ClientTest.php
@@ -165,9 +165,9 @@ class ClientTest extends TestCase
             'Incorrect filename for the upload',
         );
         $this->assertEqualsWithDelta(
-            time() * 1000,
+            time() * 1_000,
             (int) $history[4]['request']->getHeaderLine('X-Bz-Info-src_last_modified_millis'),
-            1000,
+            1_000,
             'Incorrect last modification timestamp for the upload',
         );
         $this->assertSame(
imbo/imbo-metadata-cache ✅

No changes.

imbo/imbo-s3-adapters ⚠️ 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/Storage/S3Test.php b/tests/Storage/S3Test.php
index e583faa..37e9487 100644
--- a/tests/Storage/S3Test.php
+++ b/tests/Storage/S3Test.php
@@ -142,7 +142,7 @@ class S3Test extends TestCase
     public function testCanGetImageLastModified(): void
     {
         $handler = new MockHandler();
-        $handler->append(new Result(['LastModified' => DateTimeResult::fromEpoch(1594895257)]));
+        $handler->append(new Result(['LastModified' => DateTimeResult::fromEpoch(1_594_895_257)]));
 
         $this->assertEquals(
             new DateTime('@1594895257'),
@@ -233,7 +233,7 @@ class S3Test extends TestCase
     public function testThrowsExceptionWhenResultDoesNotHaveValidLastModified(): void
     {
         $handler = new MockHandler();
-        $handler->append(new Result(['LastModified' => 1594895257]));
+        $handler->append(new Result(['LastModified' => 1_594_895_257]));
 
         $this->expectExceptionObject(new StorageException('Unable to get image metadata', 500));
         $this->getAdapter($handler)->getLastModified('user', 'image-id');
imbo/imboclient-php ⚠️ 5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/tests/Response/AddedImageTest.php b/tests/Response/AddedImageTest.php
index d4a23d4..bb7fe43 100644
--- a/tests/Response/AddedImageTest.php
+++ b/tests/Response/AddedImageTest.php
@@ -28,7 +28,7 @@ class AddedImageTest extends TestCase
         ]);
         $addedImage = AddedImage::fromHttpResponse($response);
         $this->assertSame('image-id', $addedImage->getImageIdentifier());
-        $this->assertSame(1024, $addedImage->getWidth());
+        $this->assertSame(1_024, $addedImage->getWidth());
         $this->assertSame(768, $addedImage->getHeight());
         $this->assertSame('jpg', $addedImage->getExtension());
         $this->assertSame($response, $addedImage->getResponse());
@@ -58,7 +58,7 @@ class AddedImageTest extends TestCase
         $this->assertArrayNotHasKey('foobar', $addedImage);
 
         $this->assertSame('image-id', $addedImage['imageIdentifier']);
-        $this->assertSame(1024, $addedImage['width']);
+        $this->assertSame(1_024, $addedImage['width']);
         $this->assertSame(768, $addedImage['height']);
         $this->assertSame('jpg', $addedImage['extension']);
         $this->assertNull($addedImage['foobar']);
@@ -66,7 +66,7 @@ class AddedImageTest extends TestCase
 
     public function testArrayAccessSetNotSupported(): void
     {
-        $response = new AddedImage('image-id', 1024, 768, 'jpg');
+        $response = new AddedImage('image-id', 1_024, 768, 'jpg');
 
         $this->expectException(RuntimeException::class);
         $this->expectExceptionMessage('Not supported');
@@ -75,7 +75,7 @@ class AddedImageTest extends TestCase
 
     public function testArrayAccessUnsetNotSupported(): void
     {
-        $response = new AddedImage('image-id', 1024, 768, 'jpg');
+        $response = new AddedImage('image-id', 1_024, 768, 'jpg');
 
         $this->expectException(RuntimeException::class);
         $this->expectExceptionMessage('Not supported');
diff --git a/tests/Response/Images/ImageTest.php b/tests/Response/Images/ImageTest.php
index 8e761de..98d0d67 100644
--- a/tests/Response/Images/ImageTest.php
+++ b/tests/Response/Images/ImageTest.php
@@ -54,8 +54,8 @@ class ImageTest extends TestCase
         $this->assertSame('checksum', $image['checksum']);
         $this->assertSame('original-checksum', $image['originalChecksum']);
         $this->assertSame('user', $image['user']);
-        $this->assertSame(1632170037, $added->getTimestamp());
-        $this->assertSame(1632170038, $updated->getTimestamp());
+        $this->assertSame(1_632_170_037, $added->getTimestamp());
+        $this->assertSame(1_632_170_038, $updated->getTimestamp());
         $this->assertSame(1, $image['size']);
         $this->assertSame(2, $image['width']);
         $this->assertSame(3, $image['height']);
diff --git a/tests/Response/StatsTest.php b/tests/Response/StatsTest.php
index 79b1f69..675a013 100644
--- a/tests/Response/StatsTest.php
+++ b/tests/Response/StatsTest.php
@@ -20,7 +20,7 @@ class StatsTest extends TestCase
         $stats = Stats::fromHttpResponse($response);
         $this->assertSame(123, $stats->getNumImages());
         $this->assertSame(10, $stats->getNumUsers());
-        $this->assertSame(123123123, $stats->getNumBytes());
+        $this->assertSame(123_123_123, $stats->getNumBytes());
         $this->assertSame(['my-stats' => 200], $stats->getCustomStats());
     }
 
@@ -41,7 +41,7 @@ class StatsTest extends TestCase
 
         $this->assertSame(123, $stats['numImages']);
         $this->assertSame(10, $stats['numUsers']);
-        $this->assertSame(123123123, $stats['numBytes']);
+        $this->assertSame(123_123_123, $stats['numBytes']);
         $this->assertSame(['my-stats' => 200], $stats['custom']);
     }
 }
diff --git a/tests/Response/StatusTest.php b/tests/Response/StatusTest.php
index 3b881db..9a4f26d 100644
--- a/tests/Response/StatusTest.php
+++ b/tests/Response/StatusTest.php
@@ -19,7 +19,7 @@ class StatusTest extends TestCase
             ]),
         ]);
         $status = Status::fromHttpResponse($response);
-        $this->assertSame(1632170037, $status->getDate()->getTimestamp());
+        $this->assertSame(1_632_170_037, $status->getDate()->getTimestamp());
         $this->assertTrue($status->isDatabaseHealthy());
         $this->assertFalse($status->isStorageHealthy());
         $this->assertFalse($status->isHealthy());
@@ -45,7 +45,7 @@ class StatusTest extends TestCase
         /** @var DateTime */
         $date = $status['date'];
 
-        $this->assertSame(1632170037, $date->getTimestamp());
+        $this->assertSame(1_632_170_037, $date->getTimestamp());
         $this->assertTrue($status['database']);
         $this->assertFalse($status['storage']);
     }
diff --git a/tests/Response/UserTest.php b/tests/Response/UserTest.php
index aac12ea..fecc7c5 100644
--- a/tests/Response/UserTest.php
+++ b/tests/Response/UserTest.php
@@ -21,7 +21,7 @@ class UserTest extends TestCase
         $user = User::fromHttpResponse($response);
         $this->assertSame('user', $user->getUser());
         $this->assertSame(3, $user->getNumImages());
-        $this->assertSame(1632170037, $user->getLastModified()->getTimestamp());
+        $this->assertSame(1_632_170_037, $user->getLastModified()->getTimestamp());
     }
 
     public function testArrayAccess(): void
@@ -41,7 +41,7 @@ class UserTest extends TestCase
         /** @var DateTime */
         $date = $user['lastModified'];
 
-        $this->assertSame(1632170037, $date->getTimestamp());
+        $this->assertSame(1_632_170_037, $date->getTimestamp());
         $this->assertSame('user', $user['user']);
         $this->assertSame(3, $user['numImages']);
     }
imbo/releaser ⚠️ 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/GitHub/ClientTest.php b/tests/GitHub/ClientTest.php
index 8131480..49e12fc 100644
--- a/tests/GitHub/ClientTest.php
+++ b/tests/GitHub/ClientTest.php
@@ -367,7 +367,7 @@ class ClientTest extends TestCase
     public function testDeleteRelease(): void
     {
         [$guzzleClient, $history] = $this->getGuzzleClient(
-            new Response(200, [], $this->json(['id' => 12345, 'tag_name' => '1.0.0'])),
+            new Response(200, [], $this->json(['id' => 12_345, 'tag_name' => '1.0.0'])),
             new Response(204),
         );
 
@@ -405,7 +405,7 @@ class ClientTest extends TestCase
     public function testDeleteReleaseWithServerErrorWhenDeletingRelease(): void
     {
         [$guzzleClient] = $this->getGuzzleClient(
-            new Response(200, [], $this->json(['id' => 12345, 'tag_name' => '1.0.0'])),
+            new Response(200, [], $this->json(['id' => 12_345, 'tag_name' => '1.0.0'])),
             new Response(403),
         );
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant