diff --git a/lib/action/sfAction.class.php b/lib/action/sfAction.class.php
index f796cd30d..14b0223d4 100644
--- a/lib/action/sfAction.class.php
+++ b/lib/action/sfAction.class.php
@@ -404,7 +404,7 @@ public function setSecurityConfiguration($security)
*/
public function getSecurityValue($name, $default = null)
{
- $actionName = strtolower($this->getActionName());
+ $actionName = strtolower((string) $this->getActionName());
if (isset($this->security[$actionName][$name]))
{
@@ -517,7 +517,7 @@ public function getLayout()
*/
public function setViewClass($class)
{
- sfConfig::set('mod_'.strtolower($this->getModuleName()).'_view_class', $class);
+ sfConfig::set('mod_'.strtolower((string) $this->getModuleName()).'_view_class', $class);
}
/**
diff --git a/lib/autoload/sfAutoload.class.php b/lib/autoload/sfAutoload.class.php
index 5f68f8039..982822ca4 100644
--- a/lib/autoload/sfAutoload.class.php
+++ b/lib/autoload/sfAutoload.class.php
@@ -83,7 +83,7 @@ static public function unregister()
*/
public function setClassPath($class, $path)
{
- $class = strtolower($class);
+ $class = strtolower((string) $class);
$this->overriden[$class] = $path;
@@ -99,7 +99,7 @@ public function setClassPath($class, $path)
*/
public function getClassPath($class)
{
- $class = strtolower($class);
+ $class = strtolower((string) $class);
return isset($this->classes[$class]) ? $this->classes[$class] : null;
}
@@ -185,7 +185,7 @@ public function autoload($class)
*/
public function loadClass($class)
{
- $class = strtolower($class);
+ $class = strtolower((string) $class);
// class already exists
if (class_exists($class, false) || interface_exists($class, false) || (function_exists('trait_exists') && trait_exists($class, false)))
diff --git a/lib/autoload/sfCoreAutoload.class.php b/lib/autoload/sfCoreAutoload.class.php
index ff6dfce1b..c92e9ba89 100755
--- a/lib/autoload/sfCoreAutoload.class.php
+++ b/lib/autoload/sfCoreAutoload.class.php
@@ -116,7 +116,7 @@ public function autoload($class)
*/
public function getClassPath($class)
{
- $class = strtolower($class);
+ $class = strtolower((string) $class);
if (!isset($this->classes[$class]))
{
@@ -169,7 +169,7 @@ static public function make()
|| false !== stripos($contents, 'interface '.$class)
|| false !== stripos($contents, 'trait '.$class))
{
- $classes .= sprintf(" '%s' => '%s',\n", strtolower($class), substr(str_replace($libDir, '', $file), 1));
+ $classes .= sprintf(" '%s' => '%s',\n", strtolower((string) $class), substr(str_replace($libDir, '', $file), 1));
}
}
diff --git a/lib/autoload/sfSimpleAutoload.class.php b/lib/autoload/sfSimpleAutoload.class.php
index 66ff5c1b4..8b44a7cbb 100755
--- a/lib/autoload/sfSimpleAutoload.class.php
+++ b/lib/autoload/sfSimpleAutoload.class.php
@@ -109,7 +109,7 @@ static public function unregister()
*/
public function autoload($class)
{
- $class = strtolower($class);
+ $class = strtolower((string) $class);
// class already exists
if (class_exists($class, false) || interface_exists($class, false))
@@ -291,7 +291,7 @@ public function addFile($file, $register = true)
preg_match_all('~^\s*(?:abstract\s+|final\s+)?(?:class|interface|trait)\s+(\w+)~mi', file_get_contents($file), $classes);
foreach ($classes[1] as $class)
{
- $this->classes[strtolower($class)] = $file;
+ $this->classes[strtolower((string) $class)] = $file;
}
}
@@ -303,7 +303,7 @@ public function addFile($file, $register = true)
*/
public function setClassPath($class, $path)
{
- $class = strtolower($class);
+ $class = strtolower((string) $class);
$this->overriden[$class] = $path;
@@ -319,7 +319,7 @@ public function setClassPath($class, $path)
*/
public function getClassPath($class)
{
- $class = strtolower($class);
+ $class = strtolower((string) $class);
return isset($this->classes[$class]) ? $this->classes[$class] : null;
}
diff --git a/lib/config/sfAutoloadConfigHandler.class.php b/lib/config/sfAutoloadConfigHandler.class.php
index 9132e5ce1..3b14b64f5 100755
--- a/lib/config/sfAutoloadConfigHandler.class.php
+++ b/lib/config/sfAutoloadConfigHandler.class.php
@@ -82,7 +82,7 @@ protected function parse(array $configFiles)
// file mapping
foreach ($entry['files'] as $class => $file)
{
- $mapping[strtolower($class)] = $file;
+ $mapping[strtolower((string) $class)] = $file;
}
}
else
@@ -140,7 +140,7 @@ static public function parseFile($path, $file, $prefix)
}
}
- $mapping[$localPrefix.strtolower($class)] = $file;
+ $mapping[$localPrefix.strtolower((string) $class)] = $file;
}
return $mapping;
diff --git a/lib/config/sfDefineEnvironmentConfigHandler.class.php b/lib/config/sfDefineEnvironmentConfigHandler.class.php
index 224dc2525..84ebeeac0 100644
--- a/lib/config/sfDefineEnvironmentConfigHandler.class.php
+++ b/lib/config/sfDefineEnvironmentConfigHandler.class.php
@@ -30,14 +30,14 @@ class sfDefineEnvironmentConfigHandler extends sfYamlConfigHandler
public function execute($configFiles)
{
// get our prefix
- $prefix = strtolower($this->getParameterHolder()->get('prefix', ''));
+ $prefix = strtolower((string) $this->getParameterHolder()->get('prefix', ''));
// add module prefix if needed
if ($this->getParameterHolder()->get('module', false))
{
$wildcardValues = $this->getParameterHolder()->get('wildcardValues');
// either the module name is in wildcard values, or it needs to be inserted on runtime
- $moduleName = $wildcardValues ? strtolower($wildcardValues[0]) : "'.strtolower(\$moduleName).'";
+ $moduleName = $wildcardValues ? strtolower((string) $wildcardValues[0]) : "'.strtolower(\$moduleName).'";
$prefix .= $moduleName."_";
}
@@ -82,7 +82,7 @@ protected function getValues($prefix, $category, $keys)
{
if (!is_array($keys))
{
- list($key, $value) = $this->fixCategoryValue($prefix.strtolower($category), '', $keys);
+ list($key, $value) = $this->fixCategoryValue($prefix.strtolower((string) $category), '', $keys);
return array($key => $value);
}
diff --git a/lib/controller/sfController.class.php b/lib/controller/sfController.class.php
index 6b69b857d..c2cef1684 100644
--- a/lib/controller/sfController.class.php
+++ b/lib/controller/sfController.class.php
@@ -108,8 +108,8 @@ protected function controllerExists($moduleName, $controllerName, $extension, $t
$this->context->getConfigCache()->import('modules/'.$moduleName.'/config/generator.yml', false, true);
// one action per file or one file for all actions
- $classFile = strtolower($extension);
- $classSuffix = ucfirst(strtolower($extension));
+ $classFile = strtolower((string) $extension);
+ $classSuffix = ucfirst(strtolower((string) $extension));
$file = $dir.'/'.$controllerName.$classSuffix.'.class.php';
if (is_readable($file))
{
@@ -208,15 +208,15 @@ public function forward($moduleName, $actionName)
$this->getActionStack()->addEntry($moduleName, $actionName, $actionInstance);
// include module configuration
- $viewClass = sfConfig::get('mod_'.strtolower($moduleName).'_view_class', false);
+ $viewClass = sfConfig::get('mod_'.strtolower((string) $moduleName).'_view_class', false);
require($this->context->getConfigCache()->checkConfig('modules/'.$moduleName.'/config/module.yml'));
if (false !== $viewClass)
{
- sfConfig::set('mod_'.strtolower($moduleName).'_view_class', $viewClass);
+ sfConfig::set('mod_'.strtolower((string) $moduleName).'_view_class', $viewClass);
}
// module enabled?
- if (sfConfig::get('mod_'.strtolower($moduleName).'_enabled'))
+ if (sfConfig::get('mod_'.strtolower((string) $moduleName).'_enabled'))
{
// check for a module config.php
$moduleConfig = sfConfig::get('sf_app_module_dir').'/'.$moduleName.'/config/config.php';
@@ -296,7 +296,7 @@ public function getComponent($moduleName, $componentName)
*/
protected function getController($moduleName, $controllerName, $extension)
{
- $classSuffix = ucfirst(strtolower($extension));
+ $classSuffix = ucfirst(strtolower((string) $extension));
if (!isset($this->controllerClasses[$moduleName.'_'.$controllerName.'_'.$classSuffix]))
{
if (!$this->controllerExists($moduleName, $controllerName, $extension, true))
@@ -371,7 +371,7 @@ public function getView($moduleName, $actionName, $viewName)
else
{
// view class (as configured in module.yml or defined in action)
- $class = sfConfig::get('mod_'.strtolower($moduleName).'_view_class', 'sfPHP').'View';
+ $class = sfConfig::get('mod_'.strtolower((string) $moduleName).'_view_class', 'sfPHP').'View';
}
return new $class($this->context, $moduleName, $actionName, $viewName);
@@ -411,8 +411,8 @@ public function getPresentationFor($module, $action, $viewName = null)
// set viewName if needed
if ($viewName)
{
- $currentViewName = sfConfig::get('mod_'.strtolower($module).'_view_class');
- sfConfig::set('mod_'.strtolower($module).'_view_class', $viewName);
+ $currentViewName = sfConfig::get('mod_'.strtolower((string) $module).'_view_class');
+ sfConfig::set('mod_'.strtolower((string) $module).'_view_class', $viewName);
}
try
@@ -428,7 +428,7 @@ public function getPresentationFor($module, $action, $viewName = null)
// remove viewName
if ($viewName)
{
- sfConfig::set('mod_'.strtolower($module).'_view_class', $currentViewName);
+ sfConfig::set('mod_'.strtolower((string) $module).'_view_class', $currentViewName);
}
throw $e;
@@ -462,7 +462,7 @@ public function getPresentationFor($module, $action, $viewName = null)
// remove viewName
if ($viewName)
{
- sfConfig::set('mod_'.strtolower($module).'_view_class', $currentViewName);
+ sfConfig::set('mod_'.strtolower((string) $module).'_view_class', $currentViewName);
}
return $presentation;
diff --git a/lib/debug/sfWebDebugPanelConfig.class.php b/lib/debug/sfWebDebugPanelConfig.class.php
index 5e212203b..8ff8645ed 100644
--- a/lib/debug/sfWebDebugPanelConfig.class.php
+++ b/lib/debug/sfWebDebugPanelConfig.class.php
@@ -71,7 +71,7 @@ public function getPanelContent()
*/
protected function formatArrayAsHtml($id, $values)
{
- $id = ucfirst(strtolower($id));
+ $id = ucfirst(strtolower((string) $id));
return '
'.$id.' '.$this->getToggler('sfWebDebug'.$id).'
diff --git a/lib/form/sfForm.class.php b/lib/form/sfForm.class.php
index 2db45bbde..c23b133bf 100644
--- a/lib/form/sfForm.class.php
+++ b/lib/form/sfForm.class.php
@@ -1035,7 +1035,7 @@ public function isMultipart()
public function renderFormTag($url, array $attributes = array())
{
$attributes['action'] = $url;
- $attributes['method'] = isset($attributes['method']) ? strtolower($attributes['method']) : 'post';
+ $attributes['method'] = isset($attributes['method']) ? strtolower((string) $attributes['method']) : 'post';
if ($this->isMultipart())
{
$attributes['enctype'] = 'multipart/form-data';
diff --git a/lib/helper/PartialHelper.php b/lib/helper/PartialHelper.php
index e20d0b9c2..78aa5ecb2 100644
--- a/lib/helper/PartialHelper.php
+++ b/lib/helper/PartialHelper.php
@@ -84,7 +84,7 @@ function has_component_slot($name)
{
return false;
}
-
+
// check to see if component slot is empty (null)
if ($viewInstance->getComponentSlot($name))
{
@@ -138,7 +138,7 @@ function get_component($moduleName, $componentName, $vars = array())
require($context->getConfigCache()->checkConfig('modules/'.$moduleName.'/config/module.yml'));
- $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView';
+ $class = sfConfig::get('mod_'.strtolower((string) $moduleName).'_partial_view_class', 'sf').'PartialView';
$view = new $class($context, $moduleName, $actionName, '');
$view->setPartialVars(true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($vars) : $vars);
@@ -213,7 +213,7 @@ function get_partial($templateName, $vars = array())
}
$actionName = '_'.$templateName;
- $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView';
+ $class = sfConfig::get('mod_'.strtolower((string) $moduleName).'_partial_view_class', 'sf').'PartialView';
$view = new $class($context, $moduleName, $actionName, '');
$view->setPartialVars(true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($vars) : $vars);
diff --git a/lib/helper/TextHelper.php b/lib/helper/TextHelper.php
index 5109b7798..ee6e2e57b 100644
--- a/lib/helper/TextHelper.php
+++ b/lib/helper/TextHelper.php
@@ -155,7 +155,7 @@ function excerpt_text($text, $phrase, $radius = 100, $excerpt_string = '...', $e
$strtolower = ($mbstring) ? 'mb_strtolower' : 'strtolower';
$substr = ($mbstring) ? 'mb_substr' : 'substr';
- $found_pos = $strpos($strtolower($text), $strtolower($phrase));
+ $found_pos = $strpos($strtolower((string) $text), $strtolower((string) $phrase));
$return_string = '';
if ($found_pos !== false)
{
diff --git a/lib/helper/UrlHelper.php b/lib/helper/UrlHelper.php
index de61246d2..1b11a9154 100644
--- a/lib/helper/UrlHelper.php
+++ b/lib/helper/UrlHelper.php
@@ -438,7 +438,7 @@ function form_tag($url_for_options = '', $options = array())
$html_options = $options;
- $html_options['method'] = isset($html_options['method']) ? strtolower($html_options['method']) : 'post';
+ $html_options['method'] = isset($html_options['method']) ? strtolower((string) $html_options['method']) : 'post';
if (_get_option($html_options, 'multipart'))
{
@@ -496,7 +496,7 @@ function mail_to($email, $name = '', $options = array(), $default_value = array(
$default = array();
foreach ($default_tmp as $key => $value)
{
- $default[] = urlencode($key).'='.urlencode($value);
+ $default[] = urlencode((string) $key).'='.urlencode((string) $value);
}
$options = count($default) ? '?'.implode('&', $default) : '';
@@ -605,10 +605,10 @@ function _method_javascript_function($method)
{
$function = "var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'post'; f.action = this.href;";
- if ('post' != strtolower($method))
+ if ('post' != strtolower((string) $method))
{
$function .= "var m = document.createElement('input'); m.setAttribute('type', 'hidden'); ";
- $function .= sprintf("m.setAttribute('name', 'sf_method'); m.setAttribute('value', '%s'); f.appendChild(m);", strtolower($method));
+ $function .= sprintf("m.setAttribute('name', 'sf_method'); m.setAttribute('value', '%s'); f.appendChild(m);", strtolower((string) $method));
}
// CSRF protection
diff --git a/lib/i18n/sfNumberFormat.class.php b/lib/i18n/sfNumberFormat.class.php
index bcf948d55..c84023349 100644
--- a/lib/i18n/sfNumberFormat.class.php
+++ b/lib/i18n/sfNumberFormat.class.php
@@ -116,7 +116,7 @@ function format($number, $pattern = 'd', $currency = 'USD', $charset = 'UTF-8')
{
$this->setPattern($pattern);
- if (strtolower($pattern) == 'p')
+ if (strtolower((string) $pattern) == 'p')
{
$number *= 100;
}
diff --git a/lib/mailer/sfMailer.class.php b/lib/mailer/sfMailer.class.php
index 86afba3e3..c688eb6e3 100755
--- a/lib/mailer/sfMailer.class.php
+++ b/lib/mailer/sfMailer.class.php
@@ -94,7 +94,7 @@ public function __construct(sfEventDispatcher $dispatcher, $options)
{
foreach ($transport->getExtensionHandlers() as $handler)
{
- if (in_array(strtolower($method), array_map('strtolower', (array) $handler->exposeMixinMethods())))
+ if (in_array(strtolower((string) $method), array_map('strtolower', (array) $handler->exposeMixinMethods())))
{
$transport->$method($value);
}
diff --git a/lib/plugin/sfPearRestPlugin.class.php b/lib/plugin/sfPearRestPlugin.class.php
index 74b9dbabf..16f04a9f7 100644
--- a/lib/plugin/sfPearRestPlugin.class.php
+++ b/lib/plugin/sfPearRestPlugin.class.php
@@ -3,7 +3,7 @@
/*
* This file is part of the symfony package.
* (c) Fabien Potencier
- *
+ *
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@@ -86,7 +86,7 @@ public function getPluginLicense($plugin, $version)
if (PEAR::isError($info))
{
- throw new sfPluginRestException(sprintf('Unable to get plugin licence information for plugin "%s": %s', $plugin, $info->getMessage()));
+ throw new sfPluginRestException(sprintf('Unable to get plugin licence information for plugin "%s": %s', $plugin, $info->getMessage()));
}
if (null === $info)
@@ -113,7 +113,7 @@ public function getPluginLicense($plugin, $version)
*/
public function getPluginVersions($plugin, $stability = null)
{
- $allreleases = $this->_rest->retrieveData($this->restBase.'r/'.strtolower($plugin).'/allreleases.xml');
+ $allreleases = $this->_rest->retrieveData($this->restBase.'r/'.strtolower((string) $plugin).'/allreleases.xml');
if (PEAR::isError($allreleases))
{
throw new sfPluginRestException(sprintf('Unable to get information for plugin "%s": %s', $plugin, $allreleases->getMessage()));
@@ -159,7 +159,7 @@ public function getPluginVersions($plugin, $stability = null)
*/
public function getPluginDependencies($plugin, $version)
{
- $dependencies = $this->_rest->retrieveData($this->restBase.'r/'.strtolower($plugin).'/deps.'.$version.'.txt');
+ $dependencies = $this->_rest->retrieveData($this->restBase.'r/'.strtolower((string) $plugin).'/deps.'.$version.'.txt');
if (PEAR::isError($dependencies))
{
throw new sfPluginRestException(sprintf('Unable to get dependencies information for plugin "%s": %s', $plugin, $dependencies->getMessage()));
diff --git a/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php b/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php
index 937859a38..32e5c8158 100644
--- a/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php
+++ b/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php
@@ -5,7 +5,7 @@ protected function addSortQuery($query)
return;
}
- if (!in_array(strtolower($sort[1]), array('asc', 'desc')))
+ if (!in_array(strtolower((string) $sort[1]), array('asc', 'desc')))
{
$sort[1] = 'asc';
}
diff --git a/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/template/templates/_filters.php b/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/template/templates/_filters.php
index b8259edb3..7530bd7b6 100644
--- a/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/template/templates/_filters.php
+++ b/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/template/templates/_filters.php
@@ -27,7 +27,7 @@
'help' => $field->getConfig('help'),
'form' => $form,
'field' => $field,
- 'class' => 'sf_admin_form_row sf_admin_'.strtolower($field->getType()).' sf_admin_filter_field_'.$name,
+ 'class' => 'sf_admin_form_row sf_admin_'.strtolower((string) $field->getType()).' sf_admin_filter_field_'.$name,
)) ?]
[?php endforeach; ?]
diff --git a/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/template/templates/_form_fieldset.php b/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/template/templates/_form_fieldset.php
index ae30a30e6..093e47e1f 100644
--- a/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/template/templates/_form_fieldset.php
+++ b/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/template/templates/_form_fieldset.php
@@ -1,4 +1,4 @@
-