mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
is_a() to instance of - completes PR 1669
This commit is contained in:
parent
af368132a5
commit
653aed7701
3 changed files with 4 additions and 4 deletions
|
@ -374,9 +374,9 @@ class TestTask extends BakeTask {
|
|||
*/
|
||||
public function generateFixtureList($subject) {
|
||||
$this->_fixtures = array();
|
||||
if (is_a($subject, 'Model')) {
|
||||
if ($subject instanceof Model) {
|
||||
$this->_processModel($subject);
|
||||
} elseif (is_a($subject, 'Controller')) {
|
||||
} elseif ($subject instanceof Controller) {
|
||||
$this->_processController($subject);
|
||||
}
|
||||
return array_values($this->_fixtures);
|
||||
|
|
|
@ -121,7 +121,7 @@ class AclNode extends Model {
|
|||
) {
|
||||
return false;
|
||||
}
|
||||
} elseif (is_object($ref) && is_a($ref, 'Model')) {
|
||||
} elseif (is_object($ref) && $ref instanceof Model) {
|
||||
$ref = array('model' => $ref->name, 'foreign_key' => $ref->id);
|
||||
} elseif (is_array($ref) && !(isset($ref['model']) && isset($ref['foreign_key']))) {
|
||||
$name = key($ref);
|
||||
|
|
|
@ -2961,7 +2961,7 @@ class DboSource extends DataSource {
|
|||
* @return string
|
||||
*/
|
||||
public function createSchema($schema, $tableName = null) {
|
||||
if (!is_a($schema, 'CakeSchema')) {
|
||||
if (!$schema instanceof CakeSchema) {
|
||||
trigger_error(__d('cake_dev', 'Invalid schema object'), E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue