From eaa32cbf22acf6594c816a5b99abb92152c004ad Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 23 Dec 2014 15:19:52 +0100 Subject: [PATCH] Fix the BC layer for indexable callbacks Using services was not based on a @ prefix in the string in the old API but based on the existence of the class. --- DependencyInjection/Configuration.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index b204f0c..a506853 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -199,7 +199,17 @@ class Configuration implements ConfigurationInterface isset($v['persistence']['listener']['is_indexable_callback']); }) ->then(function ($v) { - $v['indexable_callback'] = $v['persistence']['listener']['is_indexable_callback']; + $callback = $v['persistence']['listener']['is_indexable_callback']; + + if (is_array($callback)) { + list($class) = $callback + array(null); + + if (is_string($class) && !class_exists($class)) { + $callback[0] = '@'.$class; + } + } + + $v['indexable_callback'] = $callback; unset($v['persistence']['listener']['is_indexable_callback']); return $v;