4 * This file is part of Psy Shell.
6 * (c) 2012-2018 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);
27 parent::__construct($presenter);
33 protected function listItems(InputInterface $input, \Reflector $reflector = null, $target = null)
35 // only list interfaces when no Reflector is present.
37 // @todo make a NamespaceReflector and pass that in for commands like:
39 // ls --interfaces Foo
41 // ... for listing interfaces in the Foo namespace
43 if ($reflector !== null || $target !== null) {
47 // only list interfaces if we are specifically asked
48 if (!$input->getOption('interfaces')) {
52 $interfaces = $this->prepareInterfaces(\get_declared_interfaces());
54 if (empty($interfaces)) {
59 'Interfaces' => $interfaces,
64 * Prepare formatted interface array.
66 * @param array $interfaces
70 protected function prepareInterfaces(array $interfaces)
72 \natcasesort($interfaces);
74 // My kingdom for a generator.
77 foreach ($interfaces as $name) {
78 if ($this->showItem($name)) {
81 'style' => self::IS_CLASS,
82 'value' => $this->presentSignature($name),