Skip to content

Commit 3db9c97

Browse files
committed
introduced mixed type where needed
1 parent 62b689a commit 3db9c97

File tree

8 files changed

+15
-33
lines changed

8 files changed

+15
-33
lines changed

src/Enum/AccessMode.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use JsonSerializable;
1717
use Laudis\TypedEnum\TypedEnum;
18-
use ReturnTypeWillChange;
1918

2019
/**
2120
* Defines the access mode of a connection.
@@ -34,8 +33,7 @@ final class AccessMode extends TypedEnum implements JsonSerializable
3433
private const READ = 'read';
3534
private const WRITE = 'write';
3635

37-
#[ReturnTypeWillChange]
38-
public function jsonSerialize()
36+
public function jsonSerialize(): string
3937
{
4038
return $this->getValue();
4139
}

src/Enum/ConnectionProtocol.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use Bolt\protocol\V5;
2323
use JsonSerializable;
2424
use Laudis\TypedEnum\TypedEnum;
25-
use ReturnTypeWillChange;
2625

2726
/**
2827
* Defines the protocol used in a connection.
@@ -84,7 +83,6 @@ public function compare(ConnectionProtocol $protocol): int
8483
return $x - $y;
8584
}
8685

87-
#[ReturnTypeWillChange]
8886
public function jsonSerialize(): string
8987
{
9088
return $this->getValue();

src/Enum/QueryTypeEnum.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use JsonSerializable;
1717
use Laudis\Neo4j\Databags\SummaryCounters;
1818
use Laudis\TypedEnum\TypedEnum;
19-
use ReturnTypeWillChange;
2019

2120
/**
2221
* The actual type of query after is has been run.
@@ -64,8 +63,7 @@ public function __toString()
6463
return $this->getValue();
6564
}
6665

67-
#[ReturnTypeWillChange]
68-
public function jsonSerialize()
66+
public function jsonSerialize(): string
6967
{
7068
return $this->getValue();
7169
}

src/Enum/RoutingRoles.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use JsonSerializable;
1717
use Laudis\TypedEnum\TypedEnum;
18-
use ReturnTypeWillChange;
1918

2019
/**
2120
* The possible routing roles.
@@ -39,7 +38,6 @@ final class RoutingRoles extends TypedEnum implements JsonSerializable
3938
/**
4039
* @psalm-suppress ImpureMethodCall
4140
*/
42-
#[ReturnTypeWillChange]
4341
public function jsonSerialize(): string
4442
{
4543
if ($this === self::LEADER()) {

src/Enum/SslMode.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use JsonSerializable;
1717
use Laudis\TypedEnum\TypedEnum;
18-
use ReturnTypeWillChange;
1918

2019
/**
2120
* @method static self ENABLE()
@@ -42,8 +41,7 @@ public function __toString()
4241
return $this->getValue();
4342
}
4443

45-
#[ReturnTypeWillChange]
46-
public function jsonSerialize()
44+
public function jsonSerialize(): string
4745
{
4846
return $this->getValue();
4947
}

src/Enum/TransactionEffect.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use JsonSerializable;
1717
use Laudis\TypedEnum\TypedEnum;
18-
use ReturnTypeWillChange;
1918

2019
/**
2120
* Defines the access mode of a connection.
@@ -34,8 +33,7 @@ final class TransactionEffect extends TypedEnum implements JsonSerializable
3433
private const ROLLBACK = 'rollback';
3534
private const WRITE = 'none';
3635

37-
#[ReturnTypeWillChange]
38-
public function jsonSerialize()
36+
public function jsonSerialize(): string
3937
{
4038
return $this->getValue();
4139
}

src/Types/AbstractCypherObject.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use IteratorAggregate;
2222
use JsonSerializable;
2323
use OutOfBoundsException;
24-
use ReturnTypeWillChange;
2524

2625
use function sprintf;
2726

@@ -47,8 +46,10 @@ abstract class AbstractCypherObject implements JsonSerializable, ArrayAccess, It
4746
*/
4847
abstract public function toArray(): array;
4948

50-
#[ReturnTypeWillChange]
51-
public function jsonSerialize()
49+
/**
50+
* @return array<TKey, TValue>
51+
*/
52+
public function jsonSerialize(): array
5253
{
5354
return $this->toArray();
5455
}

src/Types/AbstractCypherSequence.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
use const PHP_INT_MAX;
4747

4848
use function property_exists;
49-
50-
use ReturnTypeWillChange;
51-
5249
use function sprintf;
5350

5451
use UnexpectedValueException;
@@ -362,8 +359,7 @@ public function each(callable $callable): self
362359
return $this;
363360
}
364361

365-
#[ReturnTypeWillChange]
366-
public function offsetGet($offset)
362+
public function offsetGet(mixed $offset): mixed
367363
{
368364
while (!array_key_exists($offset, $this->cache) && $this->valid()) {
369365
$this->next();
@@ -376,12 +372,12 @@ public function offsetGet($offset)
376372
return $this->cache[$offset];
377373
}
378374

379-
public function offsetSet($offset, $value): void
375+
public function offsetSet(mixed $offset, mixed $value): void
380376
{
381377
throw new BadMethodCallException(sprintf('%s is immutable', static::class));
382378
}
383379

384-
public function offsetUnset($offset): void
380+
public function offsetUnset(mixed $offset): void
385381
{
386382
throw new BadMethodCallException(sprintf('%s is immutable', static::class));
387383
}
@@ -391,7 +387,7 @@ public function offsetUnset($offset): void
391387
*
392388
* @psalm-suppress UnusedForeachValue
393389
*/
394-
public function offsetExists($offset): bool
390+
public function offsetExists(mixed $offset): bool
395391
{
396392
while (!array_key_exists($offset, $this->cache) && $this->valid()) {
397393
$this->next();
@@ -400,8 +396,7 @@ public function offsetExists($offset): bool
400396
return array_key_exists($offset, $this->cache);
401397
}
402398

403-
#[ReturnTypeWillChange]
404-
public function jsonSerialize()
399+
public function jsonSerialize(): mixed
405400
{
406401
return $this->toArray();
407402
}
@@ -442,8 +437,7 @@ final public function count(): int
442437
/**
443438
* @return TValue
444439
*/
445-
#[ReturnTypeWillChange]
446-
public function current()
440+
public function current(): mixed
447441
{
448442
$this->setupCache();
449443

@@ -485,8 +479,7 @@ public function next(): void
485479
/**
486480
* @return TKey
487481
*/
488-
#[ReturnTypeWillChange]
489-
public function key()
482+
public function key(): mixed
490483
{
491484
return $this->cacheKey();
492485
}

0 commit comments

Comments
 (0)