Skip to content

Commit

Permalink
Merge pull request #70 from kinglozzer/php72
Browse files Browse the repository at this point in the history
PHP 7.2 compatibility
  • Loading branch information
lekoala authored Jan 2, 2019
2 parents 9672da2 + d76c272 commit 1fe1d47
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion _config.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<?php

if(!defined('ZENVALIDATOR_PATH')) define('ZENVALIDATOR_PATH', rtrim(basename(dirname(__FILE__))));
if(!defined('ZENVALIDATOR_PATH')) define('ZENVALIDATOR_PATH', rtrim(basename(dirname(__FILE__))));

// Ensure compatibility with PHP 7.2 ("object" is a reserved word),
// with SilverStripe 3.6 (using Object) and SilverStripe 3.7 (using SS_Object)
if (!class_exists('SS_Object')) class_alias('Object', 'SS_Object');
4 changes: 2 additions & 2 deletions code/ValidationLogicCriteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author <[email protected]>
* Credit to Uncle Cheese for the recipe
*/
class ValidationLogicCriteria extends Object
class ValidationLogicCriteria extends SS_Object
{
/**
* The name of the form field that depends on the criteria
Expand Down Expand Up @@ -238,4 +238,4 @@ public function getMasterList()
}
return $list;
}
}
}
4 changes: 2 additions & 2 deletions code/ValidationLogicCriterion.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Credit to Uncle Cheese for the recipe
*/
class ValidationLogicCriterion extends Object
class ValidationLogicCriterion extends SS_Object
{


Expand Down Expand Up @@ -125,4 +125,4 @@ public function toPHP()
throw new Exception("ValidationLogicCriteria: php operator \"$this->operator\" not configured.");
}
}
}
}
2 changes: 1 addition & 1 deletion code/ZenValidatorConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @license BSD License http://www.silverstripe.org/bsd-license
* @author <[email protected]>
* */
abstract class ZenValidatorConstraint extends Object
abstract class ZenValidatorConstraint extends SS_Object
{

/**
Expand Down

0 comments on commit 1fe1d47

Please sign in to comment.