Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

replace method_exists by is_callable

  • Loading branch information...
commit 0bbecacae971f4a1441f95a86ad050eb74b3206e 1 parent 25f4490
@vincentchalamon authored
View
2  data/generator/sfDoctrineModule/admin_template/parts/batchAction.php
@@ -16,7 +16,7 @@ public function executeBatch(sfWebRequest $request)
$this->redirect('@<?php echo $this->getUrlForAction('list') ?>');
}
- if (!method_exists($this, $method = 'execute'.ucfirst($action)))
+ if (!is_callable(array($this, $method = 'execute'.ucfirst($action))))
{
throw new InvalidArgumentException(sprintf('You must create a "%s" method for action "%s"', $method, $action));
}
View
2  data/generator/sfDoctrineModule/admin_template/parts/configuration.php
@@ -122,7 +122,7 @@ public function retrieveValue(<?php echo $this->getModelClass() ?> $object, $nam
{
$options = $object->getTable()->getColumnDefinition($name);
// Default value
- if (method_exists($object, "get".ucfirst(sfInflector::classify($name)))) {
+ if (is_callable(array($object, "get".ucfirst(sfInflector::classify($name))))) {
$value = call_user_func(array($object, "get".ucfirst(sfInflector::classify($name))));
} else {
$value = $object[$name];
View
2  data/generator/sfDoctrineModule/admin_template/template/templates/_form_actions.php
@@ -23,7 +23,7 @@
<?php else: ?>
<li class="sf_admin_action_<?php echo $params['class_suffix'] ?>">
-[?php if (method_exists($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::classify(preg_replace('/^_(.*)/i', '$1', $name))) ?>')): ?]
+[?php if (is_callable(array($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::classify(preg_replace('/^_(.*)/i', '$1', $name))) ?>'))): ?]
<?php echo $this->addCredentialCondition('[?php echo $helper->linkTo'.$method.'($form->getObject(), '.$this->asPhp($params).') ?]', $params) ?>
[?php else: ?]
View
2  data/generator/sfDoctrineModule/admin_template/template/templates/_list_actions.php
@@ -5,7 +5,7 @@
<?php echo $this->addCredentialCondition('[?php echo $helper->linkToNew('.$this->asPhp($params).') ?]', $params)."\n" ?>
<?php else: ?>
<li class="sf_admin_action_<?php echo $params['class_suffix'] ?>">
-[?php if (method_exists($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::classify(preg_replace('/^_(.*)/i', '$1', $name))) ?>')): ?]
+[?php if (is_callable(array($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::classify(preg_replace('/^_(.*)/i', '$1', $name))) ?>'))): ?]
<?php echo $this->addCredentialCondition('[?php echo $helper->linkTo'.$method.'('.$this->asPhp($params).') ?]', $params) ?>
[?php else: ?]
View
2  data/generator/sfDoctrineModule/admin_template/template/templates/_list_td_actions.php
@@ -13,7 +13,7 @@
<?php echo $this->addCredentialCondition('[?php echo $helper->linkToShow($'.$this->getSingularName().', '.$this->asPhp($params).') ?]', $params) ?>
<?php else: ?>
- [?php if (method_exists($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::classify(preg_replace('/^_(.*)/i', '$1', $name))) ?>')): ?]
+ [?php if (is_callable(array($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::classify(preg_replace('/^_(.*)/i', '$1', $name))) ?>'))): ?]
<?php echo $this->addCredentialCondition('[?php echo $helper->linkTo'.$method.'($'.$this->getSingularName().', '.$this->asPhp($params).') ?]', $params) ?>
[?php else: ?]
<?php echo $this->addCredentialCondition('<li class="sf_admin_action'.$name.'">'.$this->getLinkToAction($name, $params, true).'</li>', $params) ?>
View
2  data/generator/sfDoctrineModule/admin_template/template/templates/_show_actions.php
@@ -14,7 +14,7 @@
<?php else: ?>
<li class="sf_admin_action_<?php echo $params['class_suffix'] ?>">
-[?php if (method_exists($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::classify(preg_replace('/^_(.*)/i', '$1', $name))) ?>')): ?]
+[?php if (is_callable(array($helper, 'linkTo<?php echo $method = ucfirst(sfInflector::classify(preg_replace('/^_(.*)/i', '$1', $name))) ?>'))): ?]
<?php echo $this->addCredentialCondition('[?php echo $helper->linkTo'.$method.'($'.$this->getSingularName().', '.$this->asPhp($params).') ?]', $params) ?>
[?php else: ?]
Please sign in to comment.
Something went wrong with that request. Please try again.