Skip to content

Commit 1fc90ee

Browse files
committed
Fixed inconsistent typing
1 parent a591a71 commit 1fc90ee

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

phpstan.neon.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
includes:
22
- phpstan-baseline.neon
33
parameters:
4-
level: 4
4+
level: 8
55
paths:
66
- src
77
- test
@@ -16,4 +16,4 @@ parameters:
1616
- stubs/Laminas/ServiceManager/Factory/InvokableFactory.stub
1717
- stubs/Laminas/ServiceManager/Initializer/InitializerInterface.stub
1818
- stubs/Psr/Container/ContainerInterface.stub
19-
treatPhpDocTypesAsCertain: false
19+
treatPhpDocTypesAsCertain: false

src/TableGateway/Feature/EventFeature.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,13 @@ class EventFeature extends AbstractFeature implements
2222
EventFeatureEventsInterface,
2323
EventsCapableInterface
2424
{
25-
protected EventManagerInterface $eventManager;
26-
27-
protected ?EventFeature\TableGatewayEvent $event;
28-
2925
public function __construct(
30-
?EventManagerInterface $eventManager = null,
31-
?EventFeature\TableGatewayEvent $tableGatewayEvent = null
26+
protected EventManagerInterface $eventManager = new EventManager(),
27+
protected EventFeature\TableGatewayEvent $event = new EventFeature\TableGatewayEvent()
3228
) {
33-
$this->eventManager = $eventManager instanceof EventManagerInterface
34-
? $eventManager
35-
: new EventManager();
36-
3729
$this->eventManager->addIdentifiers([
3830
TableGateway::class,
3931
]);
40-
41-
$this->event = $tableGatewayEvent ?: new EventFeature\TableGatewayEvent();
4232
}
4333

4434
/**

test/unit/TableGateway/TableGatewayTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public function testConstructor(): void
8989

9090
// constructor expects exception - native type declaration throws TypeError for null table
9191
$this->expectException(TypeError::class);
92-
/** @psalm-suppress NullArgument - Testing incorrect constructor */
9392
new TableGateway(
93+
/** @phpstan-ignore argument.type */
9494
null,
9595
$this->mockAdapter
9696
);
@@ -373,7 +373,6 @@ public function testConstructorWithSingleFeature(): void
373373
$table = new TableGateway('foo', $this->mockAdapter, $feature);
374374

375375
$featureSet = $table->getFeatureSet();
376-
self::assertInstanceOf(FeatureSet::class, $featureSet);
377376
self::assertSame($feature, $featureSet->getFeatureByClassName(Feature\SequenceFeature::class));
378377
}
379378

test/unit/TestAsset/TrustingSql92Platform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ final class TrustingSql92Platform extends Sql92
1313
* {@inheritDoc}
1414
*/
1515
#[Override]
16-
public function quoteValue($value): string
16+
public function quoteValue(mixed $value): string
1717
{
18-
return $this->quoteTrustedValue($value);
18+
return $this->quoteTrustedValue($value) . '';
1919
}
2020
}

0 commit comments

Comments
 (0)