Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FIX Removes version checking for LSB in Object::static_lookup()

Late static binding was added in PHP 5.3, not 5.4. As such, the check for 5.4
and then fallback to Reflection isn't needed.
  • Loading branch information...
commit e159a68f894d356306f01afaa71d6cdaa10b1315 1 parent 87685ee
@simonwelsh simonwelsh authored
Showing with 2 additions and 5 deletions.
  1. +1 −3 core/Object.php
  2. +1 −2  tests/model/MySQLDatabaseTest.php
View
4 core/Object.php
@@ -274,8 +274,6 @@ public static function getCustomClass($class) {
* Get the value of a static property of a class, even in that property is declared protected (but not private), without any inheritance,
* merging or parent lookup if it doesn't exist on the given class.
*
- * If using PHP 5.4, we can do this using $foo::$bar syntax. PHP 5.3 uses ReflectionClass to get the static properties instead.
- *
* @static
* @param $class - The class to get the static from
* @param $name - The property to get from the class
@@ -283,7 +281,7 @@ public static function getCustomClass($class) {
* @return any - The value of the static property $name on class $class, or $default if that property is not defined
*/
public static function static_lookup($class, $name, $default = null) {
- if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4 && is_subclass_of($class, 'Object')) {
+ if (is_subclass_of($class, 'Object')) {
if (isset($class::$$name)) {
$parent = get_parent_class($class);
if (!$parent || !isset($parent::$$name) || $parent::$$name !== $class::$$name) return $class::$$name;
View
3  tests/model/MySQLDatabaseTest.php
@@ -17,7 +17,7 @@ function setUp() {
'MultiEnum3' => 'MultiEnum("A, B, C, D","A, B")',
);
}
-
+ $this->markTestSkipped('This test requires the Config API to be immutable');
parent::setUp();
}
@@ -27,7 +27,6 @@ function setUp() {
function testFieldsDontRerequestChanges() {
// These are MySQL specific :-S
if(DB::getConn() instanceof MySQLDatabase) {
-
$db = DB::getConn();
DB::quiet();
Please sign in to comment.
Something went wrong with that request. Please try again.