diff --git a/build.xml b/build.xml
index 11a03ed0788..c6c2c843ac5 100644
--- a/build.xml
+++ b/build.xml
@@ -331,6 +331,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -359,12 +373,13 @@
-
+
+
diff --git a/build/scoper.inc.php b/build/scoper.inc.php
new file mode 100644
index 00000000000..2452530dc8a
--- /dev/null
+++ b/build/scoper.inc.php
@@ -0,0 +1,24 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+$whitelistClasses = [
+ 'PHPUnit\PHPUnit\Exception',
+ 'PHPUnit\SoapClient',
+ 'PHPUnit\Framework\*',
+ 'PHPUnit_Framework_MockObject_MockObject',
+ 'SebastianBergmann\CodeCoverage\*',
+ 'PharIo\*',
+ 'PHP_Token*',
+];
+
+return [
+ 'whitelist' => $whitelistClasses,
+];
diff --git a/build/tools/php-scoper b/build/tools/php-scoper
new file mode 100644
index 00000000000..0ce73af5bec
Binary files /dev/null and b/build/tools/php-scoper differ
diff --git a/build/tools/php-scoper.pubkey b/build/tools/php-scoper.pubkey
new file mode 100644
index 00000000000..a1455c67935
--- /dev/null
+++ b/build/tools/php-scoper.pubkey
@@ -0,0 +1,14 @@
+-----BEGIN PUBLIC KEY-----
+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxKi/ABhiCMn7hqH9/W0x
+v2WKZDtUTDoSFRMl3WMBRL0wEmwvEajOJkzgAZLLomg6DCGrH7dSgZXBaxWyq1yY
+efw1qj9HcFlRs82Y8OfzdDRGDbRobERXH+sulukN0Su7jADOJHyILlQgc64Zql2J
++BXQbBXJGIeoVk3I1hKg6GALpoA5kfFMw3l8FztKiRFcBMSRdeFQJlcsB/FCXnfN
+LJMnaB2LJnnV6eTj4xD3dXrKky8KxBKMxrryxNFcXqMMfL5gBdaU6CH4VUn5yPDs
+R/1KBsCgTmnFY6QmRlp+kI1ogmS5Eqk66xs5WBmuCHeB+phP7CFwvfF4kFGIGITl
+5nKMJ7GJWG9CFEbPlZAcfgK3e12NyHuX+XUoc94IxbfzvcWxC/ZiuFSOAbTG95ut
+Ue51KkeIxq0GmW8djFySSJM4PZbPHtr7b2LhkJzjQ66dXWyTJjqxZRskmKQota6o
+qe8YWALClKLaG+LYM7ZFC4Q6fb4gs1x05feucbmuiWboeJyfL/CmoafnB6MqYXxX
+DXXJhMWYbrTZuawNXUe/WhEQIdiGJsoI61y7DgvKw6ExdnelIakAO9EOfkffY5wE
+KVZf+2kuEqm5UPvKmwozp/g/WmMAEEn6OJbHxeqKX7Ds/eLFiE2WlZm1YO3/JNbF
+HshwDz0FnMzwQom3CiykuOsCAwEAAQ==
+-----END PUBLIC KEY-----