mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Replaced deprecated ClassInfo::is_subclass_of() calls.
This commit is contained in:
parent
803e67b87d
commit
969aa0b51e
4
core/Object.php
Executable file → Normal file
4
core/Object.php
Executable file → Normal file
@ -513,7 +513,7 @@ abstract class Object {
|
|||||||
user_error(sprintf('Object::add_extension() - Can\'t find extension class for "%s"', $extensionClass), E_USER_ERROR);
|
user_error(sprintf('Object::add_extension() - Can\'t find extension class for "%s"', $extensionClass), E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ClassInfo::is_subclass_of($extensionClass, 'Extension')) {
|
if(!is_subclass_of($extensionClass, 'Extension')) {
|
||||||
user_error(sprintf('Object::add_extension() - Extension "%s" is not a subclass of Extension', $extensionClass), E_USER_ERROR);
|
user_error(sprintf('Object::add_extension() - Extension "%s" is not a subclass of Extension', $extensionClass), E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,7 +537,7 @@ abstract class Object {
|
|||||||
self::set_static($class, 'extensions', $extensions);
|
self::set_static($class, 'extensions', $extensions);
|
||||||
|
|
||||||
// load statics now for DataObject classes
|
// load statics now for DataObject classes
|
||||||
if(ClassInfo::is_subclass_of($class, 'DataObject')) {
|
if(is_subclass_of($class, 'DataObject')) {
|
||||||
if(is_subclass_of($extensionClass, 'DataObjectDecorator')) {
|
if(is_subclass_of($extensionClass, 'DataObjectDecorator')) {
|
||||||
DataObjectDecorator::load_extra_statics($class, $extension);
|
DataObjectDecorator::load_extra_statics($class, $extension);
|
||||||
}
|
}
|
||||||
|
2
core/control/ContentController.php
Executable file → Normal file
2
core/control/ContentController.php
Executable file → Normal file
@ -230,7 +230,7 @@ class ContentController extends Controller {
|
|||||||
$hasOnes = $this->dataRecord->has_one();
|
$hasOnes = $this->dataRecord->has_one();
|
||||||
if(!$hasOnes) return false;
|
if(!$hasOnes) return false;
|
||||||
foreach($hasOnes as $hasOneName => $hasOneClass) {
|
foreach($hasOnes as $hasOneName => $hasOneClass) {
|
||||||
if($hasOneClass == 'WidgetArea' || ClassInfo::is_subclass_of($hasOneClass, 'WidgetArea')) {
|
if($hasOneClass == 'WidgetArea' || is_subclass_of($hasOneClass, 'WidgetArea')) {
|
||||||
$widgetAreaRelations[] = $hasOneName;
|
$widgetAreaRelations[] = $hasOneName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
core/control/HTTPRequest.php
Executable file → Normal file
2
core/control/HTTPRequest.php
Executable file → Normal file
@ -348,7 +348,7 @@ class SS_HTTPRequest implements ArrayAccess {
|
|||||||
if($varRequired && !isset($this->dirParts[$i])) return false;
|
if($varRequired && !isset($this->dirParts[$i])) return false;
|
||||||
|
|
||||||
$arguments[$varName] = isset($this->dirParts[$i]) ? $this->dirParts[$i] : null;
|
$arguments[$varName] = isset($this->dirParts[$i]) ? $this->dirParts[$i] : null;
|
||||||
if($part == '$Controller' && (!ClassInfo::exists($arguments['Controller']) || !ClassInfo::is_subclass_of($arguments['Controller'], 'Controller'))) {
|
if($part == '$Controller' && (!ClassInfo::exists($arguments['Controller']) || !is_subclass_of($arguments['Controller'], 'Controller'))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
core/model/Versioned.php
Executable file → Normal file
2
core/model/Versioned.php
Executable file → Normal file
@ -479,7 +479,7 @@ class Versioned extends DataObjectDecorator {
|
|||||||
*/
|
*/
|
||||||
function canBeVersioned($table) {
|
function canBeVersioned($table) {
|
||||||
return ClassInfo::exists($table)
|
return ClassInfo::exists($table)
|
||||||
&& ClassInfo::is_subclass_of($table, 'DataObject')
|
&& is_subclass_of($table, 'DataObject')
|
||||||
&& DataObject::has_own_table($table);
|
&& DataObject::has_own_table($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user