Skip to content

Commit 6452b74

Browse files
committed
style(core): Fixing failing static analysis
1 parent a63bbfd commit 6452b74

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

src/RunOpenCode/Bundle/QueryResourcesLoader/Cache/CacheMiddleware.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __invoke(string $query, Parameters $parameters, Options $options
4949
$identity = $options->cache instanceof CacheIdentifiableInterface ?
5050
$options->cache->getCacheIdentity()
5151
: $options->cache;
52-
52+
5353

5454
// ensure TTL is set
5555
$identity = $identity->withTtl($identity->getTtl() ?? $this->defaultTtl);

src/RunOpenCode/Bundle/QueryResourcesLoader/DependencyInjection/CompilerPass/ConfigureCacheMiddleware.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function process(ContainerBuilder $container): void
2525
$pool = $container->getParameter(Extension::CACHE_POOL);
2626
/** @var int|null $ttl */
2727
$ttl = $container->getParameter(Extension::CACHE_DEFAULT_TTL);
28-
28+
2929
// nothing to reconfigure.
3030
if (null === $pool && null === $ttl) {
3131
return;

src/RunOpenCode/Bundle/QueryResourcesLoader/Executor/Dbal/ResultProxy.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function __serialize(): array
192192
for ($index = 0; $index < $this->columnCount(); ++$index) {
193193
$columnNames[] = $this->result->getColumnName($index);
194194
}
195-
195+
196196
// Replace result with array result so this resultset can be reused.
197197
$this->result = new ArrayResult($columnNames, $rows);
198198

tests/Cache/CacheIntegrationTest.php

+11-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace RunOpenCode\Bundle\QueryResourcesLoader\Tests\Cache;
66

7+
use Doctrine\DBAL\Driver\Result;
78
use RunOpenCode\Bundle\QueryResourcesLoader\Cache\CacheIdentity;
89
use RunOpenCode\Bundle\QueryResourcesLoader\Contract\QueryResourcesLoaderInterface;
910
use RunOpenCode\Bundle\QueryResourcesLoader\Model\Options;
@@ -15,8 +16,10 @@ public function testCacheIntegration(): void
1516
{
1617
$this->createFixtures();
1718

19+
/** @var QueryResourcesLoaderInterface $loader */
1820
$loader = $this->getContainer()->get(QueryResourcesLoaderInterface::class);
19-
$data = $loader->execute('SELECT id, title FROM bar ORDER BY id', null, Options::cached(new CacheIdentity(
21+
/** @var Result $resultSet */
22+
$resultSet = $loader->execute('SELECT id, title FROM bar ORDER BY id', null, Options::cached(new CacheIdentity(
2023
'foo',
2124
)));
2225

@@ -26,13 +29,15 @@ public function testCacheIntegration(): void
2629
['id' => 3, 'title' => 'Bar title 3'],
2730
['id' => 4, 'title' => 'Bar title 4'],
2831
['id' => 5, 'title' => 'Bar title 5'],
29-
], $data->fetchAllAssociative());
30-
32+
], $resultSet->fetchAllAssociative());
33+
3134
$this->ensureKernelShutdown();
3235
$this->bootKernel();
33-
36+
37+
/** @var QueryResourcesLoaderInterface $loader */
3438
$loader = $this->getContainer()->get(QueryResourcesLoaderInterface::class);
35-
$data = $loader->execute('SELECT * FROM bar', null, Options::cached(new CacheIdentity(
39+
/** @var Result $resultSet */
40+
$resultSet = $loader->execute('SELECT * FROM bar', null, Options::cached(new CacheIdentity(
3641
'foo',
3742
)));
3843

@@ -42,6 +47,6 @@ public function testCacheIntegration(): void
4247
['id' => 3, 'title' => 'Bar title 3'],
4348
['id' => 4, 'title' => 'Bar title 4'],
4449
['id' => 5, 'title' => 'Bar title 5'],
45-
], $data->fetchAllAssociative());
50+
], $resultSet->fetchAllAssociative());
4651
}
4752
}

tests/KernelTestCase.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ protected static function getKernelClass(): string
3030
{
3131
return TestKernel::class;
3232
}
33-
34-
protected final function createFixtures(): void
33+
34+
final protected function createFixtures(): void
3535
{
3636
$this->getContainer()->get(Fixtures::class)->execute(); // @phpstan-ignore-line
3737
$this->clearLoggedQueryStatements();
3838
}
3939

40-
protected final function clearLoggedQueryStatements(): void
40+
final protected function clearLoggedQueryStatements(): void
4141
{
4242
/** @var Configuration $configuration */
4343
$configuration = $this->getContainer()->get(Connection::class)->getConfiguration(); // @phpstan-ignore-line
@@ -53,7 +53,7 @@ protected final function clearLoggedQueryStatements(): void
5353
/**
5454
* @return array<string, string[]>
5555
*/
56-
protected final function getLoggedQueryStatements(): array
56+
final protected function getLoggedQueryStatements(): array
5757
{
5858
/** @var Configuration $configuration */
5959
$configuration = $this->getContainer()->get(Connection::class)->getConfiguration(); // @phpstan-ignore-line
@@ -80,7 +80,7 @@ protected final function getLoggedQueryStatements(): array
8080
/**
8181
* Clear cache for the current test.
8282
*/
83-
protected final function clearCache(): void
83+
final protected function clearCache(): void
8484
{
8585
$booted = self::$booted;
8686

tests/Resources/App/TestKernel.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Bundle\MonologBundle\MonologBundle;
1515
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
1616
use Symfony\Component\HttpKernel\Kernel;
17+
1718
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
1819

1920
final class TestKernel extends Kernel
@@ -81,7 +82,7 @@ public function configureContainer(ContainerConfigurator $container): void
8182
],
8283
],
8384
]);
84-
85+
8586
$container->extension('runopencode_query_resources_loader', [
8687
'cache' => [
8788
'pool' => 'app.roc_test_cache',

0 commit comments

Comments
 (0)