4 * This file is part of Psy Shell.
6 * (c) 2012-2017 Justin Hileman
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Psy\Command\ListCommand;
14 use Psy\VarDumper\Presenter;
15 use Symfony\Component\Console\Input\InputInterface;
18 * Interface Enumerator class.
20 * @deprecated Nothing should use this anymore
22 class InterfaceEnumerator extends Enumerator
24 public function __construct(Presenter $presenter)
26 @trigger_error('InterfaceEnumerator is no longer used', E_USER_DEPRECATED);
32 protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null)
34 // only list interfaces when no Reflector is present.
36 // @todo make a NamespaceReflector and pass that in for commands like:
38 // ls --interfaces Foo
40 // ... for listing interfaces in the Foo namespace
42 if ($reflector !== null || $target !== null) {
46 // only list interfaces if we are specifically asked
47 if (!$input->getOption('interfaces')) {
51 $interfaces = $this->prepareInterfaces(get_declared_interfaces());
53 if (empty($interfaces)) {
58 'Interfaces' => $interfaces,
63 * Prepare formatted interface array.
65 * @param array $interfaces
69 protected function prepareInterfaces(array $interfaces)
71 natcasesort($interfaces);
73 // My kingdom for a generator.
76 foreach ($interfaces as $name) {
77 if ($this->showItem($name)) {
80 'style' => self::IS_CLASS,
81 'value' => $this->presentSignature($name),