Skip to content

Commit ec81df4

Browse files
committed
suppressed unsolvable deprecration warning
1 parent 8f08df3 commit ec81df4

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
convertNoticesToExceptions="true"
55
convertWarningsToExceptions="true"
66
convertErrorsToExceptions="true"
7-
convertDeprecationsToExceptions="false"
7+
convertDeprecationsToExceptions="true"
88
>
99
<testsuites>
1010
<testsuite name="Integration">

src/Enum/AccessMode.php

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

1414
namespace Laudis\Neo4j\Enum;
1515

16+
use const E_DEPRECATED;
17+
use function error_reporting;
1618
use JsonSerializable;
1719
use Laudis\TypedEnum\TypedEnum;
1820

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+
1927
/**
2028
* Defines the access mode of a connection.
2129
*
@@ -38,3 +46,8 @@ public function jsonSerialize()
3846
return $this->getValue();
3947
}
4048
}
49+
50+
/**
51+
* Turn back on old error reporting after class definition.
52+
*/
53+
error_reporting($oldReporting);

src/Enum/QueryTypeEnum.php

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

1414
namespace Laudis\Neo4j\Enum;
1515

16+
use const E_DEPRECATED;
17+
use function error_reporting;
1618
use JsonSerializable;
1719
use Laudis\Neo4j\Databags\SummaryCounters;
1820
use Laudis\TypedEnum\TypedEnum;
1921

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+
2028
/**
2129
* The actual type of query after is has been run.
2230
*
@@ -67,3 +75,8 @@ public function jsonSerialize()
6775
return $this->getValue();
6876
}
6977
}
78+
79+
/**
80+
* Turn back on old error reporting after class definition.
81+
*/
82+
error_reporting($oldReporting);

src/Types/AbstractCypherObject.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,19 @@
1717
use ArrayAccess;
1818
use ArrayIterator;
1919
use BadMethodCallException;
20+
use const E_DEPRECATED;
21+
use function error_reporting;
2022
use IteratorAggregate;
2123
use JsonSerializable;
2224
use OutOfBoundsException;
2325
use function sprintf;
2426

27+
/**
28+
* Turn of error reporting for class definition. PHP Users of 8.1 receive a deprectation warning otherwise but
29+
* it is not fixable from the minimum version 7.4 as it required the "mixed" keyword.
30+
*/
31+
$oldReporting = error_reporting(error_reporting() ^ E_DEPRECATED);
32+
2533
/**
2634
* Abstract immutable container with basic functionality to integrate easily into the driver ecosystem.
2735
*
@@ -95,3 +103,8 @@ final public function offsetUnset($offset): void
95103
throw new BadMethodCallException(sprintf('%s is immutable', static::class));
96104
}
97105
}
106+
107+
/**
108+
* Turn back on old error reporting after class definition.
109+
*/
110+
error_reporting($oldReporting);

0 commit comments

Comments
 (0)