is_a() to instance of - completes PR 1669

This commit is contained in:
euromark 2013-09-24 22:57:51 +02:00
parent af368132a5
commit 653aed7701
3 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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;
}