Remove closure-proxy leftovers

This commit is contained in:
Maxime Steinhausser 2017-06-04 20:05:07 +02:00
parent 5859703be4
commit 5b819ebfee
6 changed files with 7 additions and 21 deletions

View File

@ -307,11 +307,4 @@ abstract class Descriptor implements DescriptorInterface
return $serviceIds;
}
protected function formatClosure(\Closure $closure)
{
$r = new \ReflectionFunction($closure);
return 'closure';
}
}

View File

@ -370,7 +370,7 @@ class JsonDescriptor extends Descriptor
}
if ($callable instanceof \Closure) {
$data['type'] = $this->formatClosure($callable);
$data['type'] = 'closure';
return $data;
}

View File

@ -349,8 +349,7 @@ class MarkdownDescriptor extends Descriptor
}
if ($callable instanceof \Closure) {
$formatted = $this->formatClosure($callable);
$string .= "\n- Type: `$formatted`";
$string .= "\n- Type: `closure`";
return $this->write($string."\n");
}

View File

@ -474,13 +474,7 @@ class TextDescriptor extends Descriptor
}
if ($callable instanceof \Closure) {
$formatted = $this->formatClosure($callable);
if ('closure' === $formatted) {
return '\Closure()';
}
return $formatted.'()';
return '\Closure()';
}
if (method_exists($callable, '__invoke')) {

View File

@ -593,7 +593,7 @@ class XmlDescriptor extends Descriptor
}
if ($callable instanceof \Closure) {
$callableXML->setAttribute('type', $this->formatClosure($callable));
$callableXML->setAttribute('type', 'closure');
return $dom;
}

View File

@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* @author Bernhard Schussek <bschussek@gmail.com>
* @author Jordan Alliot <jordan.alliot@gmail.com>
*
* @deprecated since 3.3, to be removed in 4.0. Use EventDispatcher with closure-proxy injection instead.
* @deprecated since 3.3, to be removed in 4.0. Use EventDispatcher with closure factories instead.
*/
class ContainerAwareEventDispatcher extends EventDispatcher
{
@ -60,7 +60,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher
$class = get_parent_class($class);
}
if (__CLASS__ !== $class) {
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure-proxy injection instead.', __CLASS__), E_USER_DEPRECATED);
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED);
}
}
@ -78,7 +78,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher
*/
public function addListenerService($eventName, $callback, $priority = 0)
{
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure-proxy injection instead.', __CLASS__), E_USER_DEPRECATED);
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED);
if (!is_array($callback) || 2 !== count($callback)) {
throw new \InvalidArgumentException('Expected an array("service", "method") argument');