diff --git a/composer.json b/composer.json index 63ccbba..789aafa 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "roave/security-advisories": "dev-master", "webware/webware-console": "1.0.x-dev", "webware/webware-event": "1.0.0-alpha.3", - "webware/webware-tools": "^1.0.0-rc.5" + "webware/webware-tools": "^1.0.0-rc.6" }, "suggest": { "mezzio/mezzio-session": "Required to use the database-backed session persistence", diff --git a/composer.lock b/composer.lock index 1481f38..83a9cfe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2b06e28c322c09ee7eced0ff0dfe7c4f", + "content-hash": "e37b3a6d7edce15b2b5b32f1f25097b1", "packages": [ { "name": "brick/varexporter", @@ -10860,16 +10860,16 @@ }, { "name": "webware/webware-tools", - "version": "1.0.0-rc.5", + "version": "1.0.0-rc.6", "source": { "type": "git", "url": "https://github.com/webinertia/webware-tools.git", - "reference": "46caed444973f45ae81c27909d55ffc5602e3175" + "reference": "d005c08ff563a5086d50c2ea4a9cb36b9052192a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webinertia/webware-tools/zipball/46caed444973f45ae81c27909d55ffc5602e3175", - "reference": "46caed444973f45ae81c27909d55ffc5602e3175", + "url": "https://api.github.com/repos/webinertia/webware-tools/zipball/d005c08ff563a5086d50c2ea4a9cb36b9052192a", + "reference": "d005c08ff563a5086d50c2ea4a9cb36b9052192a", "shasum": "" }, "require": { @@ -10898,9 +10898,9 @@ ], "support": { "issues": "https://github.com/webinertia/webware-tools/issues", - "source": "https://github.com/webinertia/webware-tools/tree/1.0.0-rc.5" + "source": "https://github.com/webinertia/webware-tools/tree/1.0.0-rc.6" }, - "time": "2026-10-10T04:07:50+00:00" + "time": "2026-10-15T06:56:25+00:00" } ], "aliases": [], diff --git a/src/Session/DbSessionHandler.php b/src/Session/DbSessionHandler.php index 883652e..4cf14e4 100644 --- a/src/Session/DbSessionHandler.php +++ b/src/Session/DbSessionHandler.php @@ -88,7 +88,8 @@ public function open(string $path, string $name): bool #[Override] public function read(string $id): string|false { - $select = $this->sql->select() + $select = $this->sql + ->select() ->columns(['payload']) ->where(['id' => $id]); $select->where->greaterThan('expires_at', date(format: self::TIMESTAMP_FORMAT)); @@ -112,14 +113,15 @@ public function write(string $id, string $data): bool ); $now = date(format: self::TIMESTAMP_FORMAT); - $this->sql->prepareStatementForSqlObject( - new Insert(table: SessionTable::Session->value)->values([ - 'id' => $id, - 'payload' => $data, - 'expires_at' => $expiresAt, - 'modified_at' => $now, - ]), - ) + $this->sql + ->prepareStatementForSqlObject( + new Insert(table: SessionTable::Session->value)->values([ + 'id' => $id, + 'payload' => $data, + 'expires_at' => $expiresAt, + 'modified_at' => $now, + ]), + ) ->execute(); return true; diff --git a/src/Session/PhpDbSessionPersistence.php b/src/Session/PhpDbSessionPersistence.php index 44bc738..36ba730 100644 --- a/src/Session/PhpDbSessionPersistence.php +++ b/src/Session/PhpDbSessionPersistence.php @@ -127,7 +127,8 @@ public function initializeSessionFromRequest(ServerRequestInterface $request): S return new Session([], ''); } - $select = $this->sql->select() + $select = $this->sql + ->select() ->columns(['payload']) ->where(['id' => $id]); $select->where->greaterThan('expires_at', date(format: self::TIMESTAMP_FORMAT)); @@ -185,14 +186,15 @@ public function persistSession(SessionInterface $session, ResponseInterface $res $now = date(format: self::TIMESTAMP_FORMAT); $payload = SessionPayload::encode(data: $session->toArray()); - $this->sql->prepareStatementForSqlObject( - new Insert(table: SessionTable::Session->value)->values([ - 'id' => $id, - 'payload' => $payload, - 'expires_at' => $expiresAt, - 'modified_at' => $now, - ]), - ) + $this->sql + ->prepareStatementForSqlObject( + new Insert(table: SessionTable::Session->value)->values([ + 'id' => $id, + 'payload' => $payload, + 'expires_at' => $expiresAt, + 'modified_at' => $now, + ]), + ) ->execute(); $response = $this->addSessionCookieHeaderToResponse($response, $id, $session); diff --git a/test/integration/Support/MysqlSessionTestCase.php b/test/integration/Support/MysqlSessionTestCase.php index 3852f49..6d2353a 100644 --- a/test/integration/Support/MysqlSessionTestCase.php +++ b/test/integration/Support/MysqlSessionTestCase.php @@ -51,9 +51,10 @@ protected function expiresAtOf(string $id): ?string protected function insertRow(string $id, string $payload, string $expiresAt): void { - $this->pdo->prepare( - query: 'INSERT INTO `session` (id, payload, modified_at, expires_at) VALUES (?, ?, NOW(), ?)', - ) + $this->pdo + ->prepare( + query: 'INSERT INTO `session` (id, payload, modified_at, expires_at) VALUES (?, ?, NOW(), ?)', + ) ->execute([$id, $payload, $expiresAt]); } diff --git a/test/unit/Session/Console/Container/InitDbCommandFactoryTest.php b/test/unit/Session/Console/Container/InitDbCommandFactoryTest.php index 7d20423..c6d810d 100644 --- a/test/unit/Session/Console/Container/InitDbCommandFactoryTest.php +++ b/test/unit/Session/Console/Container/InitDbCommandFactoryTest.php @@ -27,7 +27,8 @@ public function invokeBuildsACommandForTheSessionTable(): void $executed = []; $adapter = $this->ddlAdapter($executed); $container = $this->createStub(ContainerInterface::class); - $container->method('get') + $container + ->method('get') ->willReturnCallback( static fn(string $id): AdapterInterface => $adapter, ); diff --git a/test/unit/Session/Console/Schema/SessionSchemaTest.php b/test/unit/Session/Console/Schema/SessionSchemaTest.php index 7ce328e..6374117 100644 --- a/test/unit/Session/Console/Schema/SessionSchemaTest.php +++ b/test/unit/Session/Console/Schema/SessionSchemaTest.php @@ -63,7 +63,8 @@ public function sessionTableHasExactlyTheColumnsBothClassesWrite(): void #[Test] public function sessionTableOptionsSetEngineCharsetAndCollation(): void { - $options = new SessionSchema()->sessionTable('session') + $options = new SessionSchema() + ->sessionTable('session') ->getOptions(); self::assertSame(['engine', 'default charset', 'collate'], array_keys($options)); diff --git a/test/unit/Session/Container/SessionFactoriesTest.php b/test/unit/Session/Container/SessionFactoriesTest.php index 3077985..6221d59 100644 --- a/test/unit/Session/Container/SessionFactoriesTest.php +++ b/test/unit/Session/Container/SessionFactoriesTest.php @@ -60,11 +60,13 @@ private function container(array $services): ContainerInterface $services[AdapterInterface::class] = $this->createStub(AdapterInterface::class); $container = $this->createStub(ContainerInterface::class); - $container->method('has') + $container + ->method('has') ->willReturnCallback( static fn(string $id): bool => array_key_exists($id, $services), ); - $container->method('get') + $container + ->method('get') ->willReturnCallback( static fn(string $id): mixed => $services[$id], ); diff --git a/test/unit/Support/DdlAdapterTrait.php b/test/unit/Support/DdlAdapterTrait.php index 86f4b1b..1253a19 100644 --- a/test/unit/Support/DdlAdapterTrait.php +++ b/test/unit/Support/DdlAdapterTrait.php @@ -28,7 +28,8 @@ private function ddlAdapter(array &$executed): AdapterInterface $adapter = $this->createStub(AdapterInterface::class); $adapter->method('getDriver')->willReturn($driver); $adapter->method('getPlatform')->willReturn(new AdapterPlatform($driver)); - $adapter->method('query') + $adapter + ->method('query') ->willReturnCallback( function (string $sql) use (&$executed): ResultInterface { $executed[] = $sql; diff --git a/test/unit/TableGateway/Feature/EventDispatcherFeatureTest.php b/test/unit/TableGateway/Feature/EventDispatcherFeatureTest.php index 5f922a3..5566f06 100644 --- a/test/unit/TableGateway/Feature/EventDispatcherFeatureTest.php +++ b/test/unit/TableGateway/Feature/EventDispatcherFeatureTest.php @@ -146,7 +146,8 @@ public function itTargetsEveryPublishedEventAtTheTableGateway(): void private function feature(AbstractTableGateway $gateway): EventDispatcherFeature { $dispatcher = $this->createStub(EventDispatcherInterface::class); - $dispatcher->method('dispatch') + $dispatcher + ->method('dispatch') ->willReturnCallback( function (object $event): object { if ($event instanceof TableGatewayEvent) {