Skip to content

Instantly share code, notes, and snippets.

@ivoba
Created Apr 11, 2022
Embed
What would you like to do?
SilverStripe 4.10 & PHP8.1 fix deprecation warnings
"require": {
...
"cweagans/composer-patches": "^1.7"
...
"extra": {
"patches": {
"silverstripe/framework": {
"Fix SilverStripe deprecations error_reporting for PHP 8.1": "./fix-deprecation-error_reporting.4.10.4.patch"
}
}
}
...
Index: src/Core/CoreKernel.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Core/CoreKernel.php b/src/Core/CoreKernel.php
--- a/src/Core/CoreKernel.php (revision 82aba312fe2d8a2563331052d6783556b143e803)
+++ b/src/Core/CoreKernel.php (date 1649429323640)
@@ -461,7 +461,8 @@
error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT | E_NOTICE));
} else {
// Report all errors in dev / test mode
- error_reporting(E_ALL | E_STRICT);
+// error_reporting(E_ALL | E_STRICT);
+ error_reporting(E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED);
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment