File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 88
99final class RuntimeConfiguration
1010{
11+ /**
12+ * methods should return `false` on error.
13+ */
14+ public const ERROR_MODE_BOOL = 'bool ' ;
15+ /**
16+ * methods will throw exceptions on errors, therefore will never return `false`.
17+ */
1118 public const ERROR_MODE_EXCEPTION = 'exception ' ;
19+ /**
20+ * use whatever the current php-src version uses per default.
21+ */
1222 public const ERROR_MODE_DEFAULT = 'default ' ;
1323
1424 /**
@@ -52,6 +62,9 @@ public function throwsPdoExceptions(PhpVersion $phpVersion): bool
5262 if (self ::ERROR_MODE_EXCEPTION === $ this ->errorMode ) {
5363 return true ;
5464 }
65+ if (self ::ERROR_MODE_BOOL === $ this ->errorMode ) {
66+ return false ;
67+ }
5568
5669 // since php8 the pdo php-src default error mode changed to exception
5770 return $ phpVersion ->getVersionId () >= 80000 ;
@@ -62,6 +75,9 @@ public function throwsMysqliExceptions(PhpVersion $phpVersion): bool
6275 if (self ::ERROR_MODE_EXCEPTION === $ this ->errorMode ) {
6376 return true ;
6477 }
78+ if (self ::ERROR_MODE_BOOL === $ this ->errorMode ) {
79+ return false ;
80+ }
6581
6682 // since php8.1 the mysqli php-src default error mode changed to exception
6783 return $ phpVersion ->getVersionId () >= 80100 ;
You can’t perform that action at this time.
0 commit comments