Closed Arekusei closed 8 years ago
Because it works! xD But instanceof
is really the right way.
It works, but not extendable.
And for this code it will be good break foreach after $hasFileBehavior = true
.
$hasFileBehavior = false;
foreach ($this->model->getBehaviors() as $behavior) {
if ($behavior instanceof FileBehavior) {
$hasFileBehavior = true;
break;
}
}
Fixed 3ed19c5e2e5b424c7bd0c5dfbff17e49a52f57a7
Thank
What is it the hell code?
Why not used
instanceof
?