Skip to content

Commit d528d67

Browse files
committed
fix for #163
1 parent 2ae4f1e commit d528d67

File tree

7 files changed

+7
-89
lines changed

7 files changed

+7
-89
lines changed

src/Enum/AccessMode.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,9 @@
1414
namespace Laudis\Neo4j\Enum;
1515

1616
use const E_DEPRECATED;
17-
use function error_reporting;
1817
use JsonSerializable;
1918
use Laudis\TypedEnum\TypedEnum;
2019

21-
/**
22-
* Turn of error reporting for class definition. PHP Users of 8.1 receive a deprectation warning otherwise but
23-
* it is not fixable from the minimum version 7.4 as it required the "mixed" keyword.
24-
*/
25-
$oldReporting = error_reporting(error_reporting() & (~E_DEPRECATED));
26-
2720
/**
2821
* Defines the access mode of a connection.
2922
*
@@ -41,13 +34,9 @@ final class AccessMode extends TypedEnum implements JsonSerializable
4134
private const READ = 'read';
4235
private const WRITE = 'write';
4336

37+
#[\ReturnTypeWillChange]
4438
public function jsonSerialize()
4539
{
4640
return $this->getValue();
4741
}
4842
}
49-
50-
/**
51-
* Turn back on old error reporting after class definition.
52-
*/
53-
error_reporting($oldReporting);

src/Enum/ConnectionProtocol.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@
1414
namespace Laudis\Neo4j\Enum;
1515

1616
use Bolt\protocol\V3;
17-
use const E_DEPRECATED;
18-
use function error_reporting;
1917
use JsonSerializable;
2018
use Laudis\TypedEnum\TypedEnum;
2119

22-
/**
23-
* Turn of error reporting for class definition. PHP Users of 8.1 receive a deprectation warning otherwise but
24-
* it is not fixable from the minimum version 7.4 as it required the "mixed" keyword.
25-
*/
26-
$oldReporting = error_reporting(error_reporting() & (~E_DEPRECATED));
27-
2820
/**
2921
* Defines the protocol used in a connection.
3022
*
@@ -83,13 +75,9 @@ public function compare(ConnectionProtocol $protocol): int
8375
return $x - $y;
8476
}
8577

78+
#[\ReturnTypeWillChange]
8679
public function jsonSerialize(): string
8780
{
8881
return $this->getValue();
8982
}
9083
}
91-
92-
/**
93-
* Turn back on old error reporting after class definition.
94-
*/
95-
error_reporting($oldReporting);

src/Enum/QueryTypeEnum.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,10 @@
1313

1414
namespace Laudis\Neo4j\Enum;
1515

16-
use const E_DEPRECATED;
17-
use function error_reporting;
1816
use JsonSerializable;
1917
use Laudis\Neo4j\Databags\SummaryCounters;
2018
use Laudis\TypedEnum\TypedEnum;
2119

22-
/**
23-
* Turn of error reporting for class definition. PHP Users of 8.1 receive a deprectation warning otherwise but
24-
* it is not fixable from the minimum version 7.4 as it required the "mixed" keyword.
25-
*/
26-
$oldReporting = error_reporting(error_reporting() & ~E_DEPRECATED);
27-
2820
/**
2921
* The actual type of query after is has been run.
3022
*
@@ -70,13 +62,9 @@ public function __toString()
7062
return $this->getValue();
7163
}
7264

65+
#[\ReturnTypeWillChange]
7366
public function jsonSerialize()
7467
{
7568
return $this->getValue();
7669
}
7770
}
78-
79-
/**
80-
* Turn back on old error reporting after class definition.
81-
*/
82-
error_reporting($oldReporting);

src/Enum/RoutingRoles.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,9 @@
1313

1414
namespace Laudis\Neo4j\Enum;
1515

16-
use const E_DEPRECATED;
17-
use function error_reporting;
1816
use JsonSerializable;
1917
use Laudis\TypedEnum\TypedEnum;
2018

21-
/**
22-
* Turn of error reporting for class definition. PHP Users of 8.1 receive a deprectation warning otherwise but
23-
* it is not fixable from the minimum version 7.4 as it required the "mixed" keyword.
24-
*/
25-
$oldReporting = error_reporting(error_reporting() & (~E_DEPRECATED));
26-
2719
/**
2820
* The possible routing roles.
2921
*
@@ -46,6 +38,7 @@ final class RoutingRoles extends TypedEnum implements JsonSerializable
4638
/**
4739
* @psalm-suppress ImpureMethodCall
4840
*/
41+
#[\ReturnTypeWillChange]
4942
public function jsonSerialize(): string
5043
{
5144
if ($this === self::LEADER()) {
@@ -59,8 +52,3 @@ public function jsonSerialize(): string
5952
return 'ROUTE';
6053
}
6154
}
62-
63-
/**
64-
* Turn back on old error reporting after class definition.
65-
*/
66-
error_reporting($oldReporting);

src/Enum/SslMode.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,9 @@
1111

1212
namespace Laudis\Neo4j\Enum;
1313

14-
use const E_DEPRECATED;
15-
use function error_reporting;
1614
use JsonSerializable;
1715
use Laudis\TypedEnum\TypedEnum;
1816

19-
/**
20-
* Turn of error reporting for class definition. PHP Users of 8.1 receive a deprectation warning otherwise but
21-
* it is not fixable from the minimum version 7.4 as it required the "mixed" keyword.
22-
*/
23-
$oldReporting = error_reporting(error_reporting() & ~E_DEPRECATED);
24-
2517
/**
2618
* @method static self ENABLE()
2719
* @method static self DISABLE()
@@ -47,13 +39,10 @@ public function __toString()
4739
return $this->getValue();
4840
}
4941

42+
#[\ReturnTypeWillChange]
5043
public function jsonSerialize()
5144
{
5245
return $this->getValue();
5346
}
5447
}
5548

56-
/**
57-
* Turn back on old error reporting after class definition.
58-
*/
59-
error_reporting($oldReporting);

src/Enum/TransactionEffect.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,9 @@
1111

1212
namespace Laudis\Neo4j\Enum;
1313

14-
use const E_DEPRECATED;
15-
use function error_reporting;
1614
use JsonSerializable;
1715
use Laudis\TypedEnum\TypedEnum;
1816

19-
/**
20-
* Turn of error reporting for class definition. PHP Users of 8.1 receive a deprectation warning otherwise but
21-
* it is not fixable from the minimum version 7.4 as it required the "mixed" keyword.
22-
*/
23-
$oldReporting = error_reporting(error_reporting() & (~E_DEPRECATED));
24-
2517
/**
2618
* Defines the access mode of a connection.
2719
*
@@ -39,13 +31,9 @@ final class TransactionEffect extends TypedEnum implements JsonSerializable
3931
private const ROLLBACK = 'rollback';
4032
private const WRITE = 'none';
4133

34+
#[\ReturnTypeWillChange]
4235
public function jsonSerialize()
4336
{
4437
return $this->getValue();
4538
}
4639
}
47-
48-
/**
49-
* Turn back on old error reporting after class definition.
50-
*/
51-
error_reporting($oldReporting);

src/Types/AbstractCypherObject.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,12 @@
1717
use ArrayAccess;
1818
use ArrayIterator;
1919
use BadMethodCallException;
20-
use const E_DEPRECATED;
21-
use function error_reporting;
2220
use IteratorAggregate;
2321
use JsonSerializable;
2422
use OutOfBoundsException;
2523
use function sprintf;
2624
use Traversable;
2725

28-
/**
29-
* Turn of error reporting for class definition. PHP Users of 8.1 receive a deprectation warning otherwise but
30-
* it is not fixable from the minimum version 7.4 as it required the "mixed" keyword.
31-
*/
32-
$oldReporting = error_reporting(error_reporting() & ~E_DEPRECATED);
33-
3426
/**
3527
* Abstract immutable container with basic functionality to integrate easily into the driver ecosystem.
3628
*
@@ -51,6 +43,7 @@ abstract class AbstractCypherObject implements JsonSerializable, ArrayAccess, It
5143
*/
5244
abstract public function toArray(): array;
5345

46+
#[\ReturnTypeWillChange]
5447
public function jsonSerialize()
5548
{
5649
return $this->toArray();
@@ -104,8 +97,3 @@ final public function offsetUnset($offset): void
10497
throw new BadMethodCallException(sprintf('%s is immutable', static::class));
10598
}
10699
}
107-
108-
/**
109-
* Turn back on old error reporting after class definition.
110-
*/
111-
error_reporting($oldReporting);

0 commit comments

Comments
 (0)