From 32042f1b38c93e8796c2554cce98f39f139980af Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Tue, 21 Nov 2017 10:33:23 -0500
Subject: [PATCH] Remove deprecated function calls (PHP 7).

---
 module/VuFind/src/VuFind/ILS/Driver/Innovative.php | 2 +-
 module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php    | 2 +-
 tests/vufind.php_cs                                | 2 ++
 tests/vufind_templates.php_cs                      | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/module/VuFind/src/VuFind/ILS/Driver/Innovative.php b/module/VuFind/src/VuFind/ILS/Driver/Innovative.php
index 4d9334653a9..1e2fe71ce84 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/Innovative.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/Innovative.php
@@ -176,7 +176,7 @@ class Innovative extends AbstractBase implements
                 // replace non blocking space encodings with a space.
                 $cols[$i] = str_replace("&nbsp;", " ", $cols[$i]);
                 // remove html comment tags
-                $cols[$i] = ereg_replace("<!--([^(-->)]*)-->", "", $cols[$i]);
+                $cols[$i] = preg_replace("/<!--([^(-->)]*)-->/", "", $cols[$i]);
                 // Remove closing th or td tag, trim whitespace and decode html
                 // entities
                 $cols[$i] = html_entity_decode(
diff --git a/module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php b/module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php
index 3e0fbf1af7c..704ebf66c0b 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php
@@ -1485,7 +1485,7 @@ class XCNCIP2 extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterf
             if ($dueDate) {
                 $tmp = $dueDate;
                 $newDueDate = (string)$tmp[0];
-                $tmp = split("T", $newDueDate);
+                $tmp = explode('T', $newDueDate);
                 $splitDate = $tmp[0];
                 $splitTime = $tmp[1];
                 $details[$renewId] = [
diff --git a/tests/vufind.php_cs b/tests/vufind.php_cs
index 9784b030262..0c17650db1c 100644
--- a/tests/vufind.php_cs
+++ b/tests/vufind.php_cs
@@ -15,6 +15,7 @@ $rules = [
     'concat_space' => ['spacing' => 'one'],
     'elseif' => true,
     'encoding' => true,
+    'ereg_to_preg' => true,
     'full_opening_tag' => true,
     'function_declaration' => true,
     'function_typehint_space' => true,
@@ -72,5 +73,6 @@ if (!is_dir($cacheDir)) {
 
 return PhpCsFixer\Config::create()
     ->setCacheFile($cacheDir . '/.code.cache')
+    ->setRiskyAllowed(true)
     ->setRules($rules)
     ->setFinder($finder);
diff --git a/tests/vufind_templates.php_cs b/tests/vufind_templates.php_cs
index a4db59e5051..1fae1b0cea2 100644
--- a/tests/vufind_templates.php_cs
+++ b/tests/vufind_templates.php_cs
@@ -15,6 +15,7 @@ $rules = [
     'concat_space' => ['spacing' => 'one'],
     'elseif' => true,
     'encoding' => true,
+    'ereg_to_preg' => true,
     //'full_opening_tag' => true, // using full tags is best practice, but it detracts from readability; we should discuss
     'function_declaration' => true,
     'function_typehint_space' => true,
@@ -69,5 +70,6 @@ if (!is_dir($cacheDir)) {
 
 return PhpCsFixer\Config::create()
     ->setCacheFile($cacheDir . '/.template.cache')
+    ->setRiskyAllowed(true)
     ->setRules($rules)
     ->setFinder($finder);
-- 
GitLab