Permalink
Browse files

Remove is_object() calls when the test subject is already type hinted…

… as a Model.
  • Loading branch information...
bar committed Nov 27, 2013
1 parent 2f24de8 commit 5c595b90d299973099b050ac3a8e29ac8a3d530a
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/Model/Datasource/DboSource.php
@@ -2119,7 +2119,7 @@ public function calculate(Model $Model, $func, $params = array()) {
if (!isset($params[1])) {
$params[1] = 'count';
}
- if (is_object($Model) && $Model->isVirtualField($params[0])) {
+ if ($Model->isVirtualField($params[0])) {
$arg = $this->_quoteFields($Model->getVirtualField($params[0]));
} else {
$arg = $this->name($params[0]);
@@ -2130,7 +2130,7 @@ public function calculate(Model $Model, $func, $params = array()) {
if (!isset($params[1])) {
$params[1] = $params[0];
}
- if (is_object($Model) && $Model->isVirtualField($params[0])) {
+ if ($Model->isVirtualField($params[0])) {
$arg = $this->_quoteFields($Model->getVirtualField($params[0]));
} else {
$arg = $this->name($params[0]);

0 comments on commit 5c595b9

Please sign in to comment.