Skip to content

Commit

Permalink
fixed unused default driver config member variable
Browse files Browse the repository at this point in the history
Fixes #191
  • Loading branch information
transistive committed Dec 4, 2023
1 parent b8e7662 commit 6f78e9a
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 5 deletions.
181 changes: 180 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352"/>
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
<file src="src/Authentication/Authenticate.php">
<PossiblyUndefinedIntArrayOffset>
<code>$pass</code>
</PossiblyUndefinedIntArrayOffset>
</file>
<file src="src/Bolt/SslConfigurationFactory.php">
<LessSpecificReturnStatement>
<code><![CDATA[[$sslConfig, $this->enableSsl($uri->getHost(), $sslConfig, $config)]]]></code>
<code>[$sslConfig, []]</code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code><![CDATA[array{0: 's'|'ssc'|'', 1: array{verify_peer?: bool, peer_name?: string, SNI_enabled?: bool, allow_self_signed?: bool}}]]></code>
</MoreSpecificReturnType>
</file>
<file src="src/Common/SysVSemaphore.php">
<InvalidArgument>
<code><![CDATA[$this->semaphore]]></code>
<code><![CDATA[$this->semaphore]]></code>
<code>sem_get(hexdec($key), $max)</code>
</InvalidArgument>
</file>
<file src="src/Databags/DatabaseInfo.php">
<MissingTemplateParam>
<code>DatabaseInfo</code>
</MissingTemplateParam>
</file>
<file src="src/Databags/Plan.php">
<MissingTemplateParam>
<code>Plan</code>
</MissingTemplateParam>
</file>
<file src="src/Databags/ProfiledPlan.php">
<MissingTemplateParam>
<code>ProfiledPlan</code>
</MissingTemplateParam>
</file>
<file src="src/Databags/ResultSummary.php">
<MissingTemplateParam>
<code>ResultSummary</code>
</MissingTemplateParam>
</file>
<file src="src/Databags/ServerInfo.php">
<MissingTemplateParam>
<code>ServerInfo</code>
</MissingTemplateParam>
</file>
<file src="src/Databags/Statement.php">
<MissingTemplateParam>
<code>Statement</code>
</MissingTemplateParam>
</file>
<file src="src/Databags/SummaryCounters.php">
<MissingTemplateParam>
<code>SummaryCounters</code>
</MissingTemplateParam>
</file>
<file src="src/Formatter/BasicFormatter.php">
<ImplementedParamTypeMismatch>
<code>$meta</code>
</ImplementedParamTypeMismatch>
</file>
<file src="src/Formatter/Specialised/JoltHttpOGMTranslator.php">
<PossiblyUndefinedArrayOffset>
<code>$coordinates</code>
</PossiblyUndefinedArrayOffset>
</file>
<file src="src/Formatter/Specialised/LegacyHttpOGMTranslator.php">
<ArgumentTypeCoercion>
<code>$value</code>
<code>$value</code>
</ArgumentTypeCoercion>
<InvalidReturnStatement>
<code><![CDATA[$this->translateCypherList($value, $meta)]]></code>
<code>[new CypherList($tbr), $meta]</code>
</InvalidReturnStatement>
<InvalidReturnType>
<code>array{0: OGMTypes, 1: HttpMetaInfo}</code>
</InvalidReturnType>
<PossiblyUndefinedIntArrayOffset>
<code>$milliseconds</code>
<code>$milliseconds</code>
<code>$secondsFraction</code>
<code>$time</code>
<code>$time</code>
<code>$timezone</code>
<code>$tzMinutes</code>
</PossiblyUndefinedIntArrayOffset>
</file>
<file src="src/Formatter/SummarizedResultFormatter.php">
<InvalidArgument>
<code>$response</code>
</InvalidArgument>
<InvalidArrayOffset>
<code><![CDATA[$response['db']]]></code>
</InvalidArrayOffset>
</file>
<file src="src/Types/Abstract3DPoint.php">
<ImplementedReturnTypeMismatch>
<code>array{x: float, y: float, z: float, srid: int, crs: Crs}</code>
</ImplementedReturnTypeMismatch>
</file>
<file src="src/Types/AbstractCypherSequence.php">
<InvalidPropertyAssignmentValue>
<code><![CDATA[$this->keyCache]]></code>
<code><![CDATA[$this->keyCache]]></code>
</InvalidPropertyAssignmentValue>
</file>
<file src="src/Types/AbstractPoint.php">
<MissingTemplateParam>
<code>AbstractPoint</code>
</MissingTemplateParam>
</file>
<file src="src/Types/ArrayList.php">
<ImplementedReturnTypeMismatch>
<code><![CDATA[static<TValue|NewValue>]]></code>
</ImplementedReturnTypeMismatch>
</file>
<file src="src/Types/Map.php">
<ImplementedReturnTypeMismatch>
<code><![CDATA[static<TValue|NewValue>]]></code>
</ImplementedReturnTypeMismatch>
</file>
<file src="tests/Unit/BoltFactoryTest.php">
<InvalidArgument>
<code>$connection</code>
<code>new Packer()</code>
<code>new Unpacker()</code>
</InvalidArgument>
<TooManyArguments>
<code>new V5(new Packer(), new Unpacker(), $connection, new ServerState())</code>
</TooManyArguments>
</file>
<file src="tests/Unit/CypherListTest.php">
<NoValue>
<code>$item</code>
</NoValue>
<UnevaluatedCode>
<code>++$counter;</code>
<code>self::assertEquals(0, $counter);</code>
<code><![CDATA[self::assertEquals(['A', 'B', 'C'][$key], $item);]]></code>
</UnevaluatedCode>
<UnusedVariable>
<code>$counter</code>
<code>$key</code>
</UnusedVariable>
</file>
<file src="tests/Unit/CypherMapTest.php">
<MissingTemplateParam>
<code>IteratorAggregate</code>
</MissingTemplateParam>
<NoValue>
<code>$item</code>
</NoValue>
<UnevaluatedCode>
<code>++$counter;</code>
<code>self::assertEquals(0, $counter);</code>
<code><![CDATA[self::assertEquals(['A' => 'x'][$key], $item);]]></code>
</UnevaluatedCode>
<UnusedVariable>
<code>$counter</code>
<code>$key</code>
</UnusedVariable>
</file>
<file src="tests/Unit/DNSAddressResolverTest.php">
<InvalidOperand>
<code><![CDATA[$this->resolver->getAddresses('8.8.8.8')]]></code>
<code><![CDATA[$this->resolver->getAddresses('bogus')]]></code>
<code><![CDATA[$this->resolver->getAddresses('test.ghlen.com')]]></code>
</InvalidOperand>
<NoValue>
<code>$records</code>
</NoValue>
</file>
<file src="tests/Unit/ParameterHelperTest.php">
<MissingTemplateParam>
<code>Iterator</code>
</MissingTemplateParam>
</file>
</files>
4 changes: 0 additions & 4 deletions src/ClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ final class ClientBuilder
* @param DriverSetupManager<T> $driverSetups
*/
public function __construct(
/** @psalm-readonly */
private DriverConfiguration $defaultDriverConfig,
/** @psalm-readonly */
private SessionConfiguration $defaultSessionConfig,
/** @psalm-readonly */
Expand All @@ -67,7 +65,6 @@ public function __construct(
public static function create(): ClientBuilder
{
return new self(
DriverConfiguration::default(),
SessionConfiguration::default(),
TransactionConfiguration::default(),
new DriverSetupManager(SummarizedResultFormatter::create(), DriverConfiguration::default())
Expand Down Expand Up @@ -134,7 +131,6 @@ public function withDefaultDriver(string $alias): self
public function withFormatter(FormatterInterface $formatter): self
{
return new self(
$this->defaultDriverConfig,
$this->defaultSessionConfig,
$this->defaultTransactionConfig,
$this->driverSetups->withFormatter($formatter)
Expand Down
3 changes: 3 additions & 0 deletions src/Common/DriverSetupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public function getDriverConfiguration(): DriverConfiguration
return $this->configuration;
}

/**
* @psalm-mutation-free
*/
public function withDriverConfiguration(DriverConfiguration $config): self
{
$tbr = clone $this;
Expand Down

0 comments on commit 6f78e9a

Please sign in to comment.