Skip to content

Commit 938e0c9

Browse files
committed
Remove closure-proxy leftovers
1 parent a9901d1 commit 938e0c9

File tree

5 files changed

+4
-18
lines changed

5 files changed

+4
-18
lines changed

Console/Descriptor/Descriptor.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,4 @@ protected function sortServiceIds(array $serviceIds)
307307

308308
return $serviceIds;
309309
}
310-
311-
protected function formatClosure(\Closure $closure)
312-
{
313-
$r = new \ReflectionFunction($closure);
314-
315-
return 'closure';
316-
}
317310
}

Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ private function getCallableData($callable, array $options = array())
370370
}
371371

372372
if ($callable instanceof \Closure) {
373-
$data['type'] = $this->formatClosure($callable);
373+
$data['type'] = 'closure';
374374

375375
return $data;
376376
}

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ protected function describeCallable($callable, array $options = array())
349349
}
350350

351351
if ($callable instanceof \Closure) {
352-
$formatted = $this->formatClosure($callable);
353-
$string .= "\n- Type: `$formatted`";
352+
$string .= "\n- Type: `closure`";
354353

355354
return $this->write($string."\n");
356355
}

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,13 +474,7 @@ private function formatCallable($callable)
474474
}
475475

476476
if ($callable instanceof \Closure) {
477-
$formatted = $this->formatClosure($callable);
478-
479-
if ('closure' === $formatted) {
480-
return '\Closure()';
481-
}
482-
483-
return $formatted.'()';
477+
return '\Closure()';
484478
}
485479

486480
if (method_exists($callable, '__invoke')) {

Console/Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ private function getCallableDocument($callable)
593593
}
594594

595595
if ($callable instanceof \Closure) {
596-
$callableXML->setAttribute('type', $this->formatClosure($callable));
596+
$callableXML->setAttribute('type', 'closure');
597597

598598
return $dom;
599599
}

0 commit comments

Comments
 (0)