console getter and setter.

@param  ConsoleInterface
@return mixed
169651
public function console(ConsoleInterface $value = null)
    {
        if (null === $value) {
            return $this->console;
        }
        $this->console = $value;
        foreach ($this->commands as $name => $command) {
            $command->console = $value;
        }
        return $this;
    }
1281009
public function getInterfaceBuilder()
    {
        if (!isset($this->interfaceBuilder)) {
            $this->interfaceBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'interface');
        }

        return $this->interfaceBuilder;
    }
1083382
public function consoleAction()
	{
	    $request   = $this->getRequest();
	    $service   = $this->fetchService();
	    $operation = $this->fetchOperation();
	    $query     = $this->fetchConsoleQuery();
	    
	    if (!$request instanceof ConsoleRequest) {
	        throw new \RuntimeException('You can only use this action from a console!');
	    }
	    
	    // Check flags
	    $verbose = $request->getParam('verbose') || $request->getParam('v');
	    $silent = $request->getParam('silent') || $request->getParam('s');
	    
	    $params = Json::decode(
            $query,
            Json::TYPE_ARRAY
        );
	    
	    try {
	        $data = $this->exec($service, $operation, $params, Command::CONTEXT_CLI);
	        return $this->prepareConsoleResponse($data, null, $verbose, $silent);
	    } catch (\Exception $exception) {
	        error_log($exception->getMessage() . ' (' . $exception->getFile().':'.$exception->getLine().')');
	        
	        return $this->prepareConsoleResponse(null, $exception, $verbose, $silent);
	    }
	}
824209
public function getConsole()
    {
        if (!($this->console instanceof AdapterInterface)) {
            $this->console = Console::getInstance();
        }

        return $this->console;
    }
444714
public function getOptionParser()
    {
        list($root, $name) = explode(' ', $this->name, 2);
        $parser = new ConsoleOptionParser($name);
        $parser->setRootName($root);

        $parser = $this->buildOptionParser($parser);
        if (!($parser instanceof ConsoleOptionParser)) {
            throw new RuntimeException(sprintf(
                "Invalid option parser returned from buildOptionParser(). Expected %s, got %s",
                ConsoleOptionParser::class,
                getTypeName($parser)
            ));
        }

        return $parser;
    }
1032696
public function inspect ()
  {
    if (!DebugConsole::$settings)
      throw new \RuntimeException ("Web console not initialized");
    foreach (func_get_args () as $arg)
      $this->inspectValue ($arg);
    return $this;
  }
346452
def _console(console: Any) -> Any:
    """"""
    try:
        return console.console_c
    except AttributeError:
        warnings.warn(
            (
                "Falsy console parameters are deprecated, "
                "always use the root console instance returned by "
                "console_init_root."
            ),
            DeprecationWarning,
            stacklevel=3,
        )
        return ffi.NULL
130235
public function getConsoleBanner(Console $console){
		$version = \Cathedral\Builder\Version::VERSION;
		$version_date = \Cathedral\Builder\Version::VERSION_DATE;
		
		return "Cathedral/BuilderCLI $version ($version_date)";
	}
1254750
protected function console()
    {
        $files = glob($this->getCommandPath() . '/*.php');

        $path = strlen($this->getCommandPath() . DIRECTORY_SEPARATOR);

        $pattern = '/\\.[^.\\s]{3,4}$/';

        foreach ((array) $files as $file) {
            $class = preg_replace($pattern, '', substr($file, $path));

            $class = $this->getCommandNamespace() . '\\' . $class;

            $reflection = new \ReflectionClass($class);

            if (! $reflection->isAbstract()) {
                $this->console->add($this->injector->make($class));
            }
        }

        return $this->console;
    }
155991
public function withConsoleDebug()
    {
        if (!class_exists(ConsoleLogger::class)) {
            throw new RuntimeException("You need to install 'symfony/console' to use this feature");
        }

        $this->logger = new ConsoleLogger(new ConsoleOutput(), [LogLevel::DEBUG => ConsoleOutput::VERBOSITY_NORMAL]);

        return $this;
    }
445570
public function createOutput()
    {
        if ($this->output === null) {
            $this->output = new ConsoleOutput();
            $this->output->getFormatter()->setStyle('b', new OutputFormatterStyle(null, null, ['bold']));
            $this->output->getFormatter()->setStyle('i', new OutputFormatterStyle('black', 'white'));
            $this->output->getFormatter()->setStyle('u', new OutputFormatterStyle(null, null, ['underscore']));
            $this->output->getFormatter()->setStyle('em', new OutputFormatterStyle(null, null, ['reverse']));
            $this->output->getFormatter()->setStyle('strike', new OutputFormatterStyle(null, null, ['conceal']));
            $this->output->getFormatter()->setStyle('success', new OutputFormatterStyle('green'));
            $this->output->getFormatter()->setStyle('warning', new OutputFormatterStyle('black', 'yellow'));
            $this->output->getFormatter()->setStyle('notice', new OutputFormatterStyle('yellow'));
            $this->output->getFormatter()->setStyle('info', new OutputFormatterStyle('white', null, ['bold']));
            $this->output->getFormatter()->setStyle('debug', new OutputFormatterStyle('white'));
        }

        return $this->output;
    }
423428
protected function getBinding(string $interface)
    {
        // If there's a targeted binding, use it
        if ($this->currentTarget !== self::$emptyTarget && isset($this->bindings[$this->currentTarget][$interface])) {
            return $this->bindings[$this->currentTarget][$interface];
        }

        // If there's a universal binding, use it
        if (isset($this->bindings[self::$emptyTarget][$interface])) {
            return $this->bindings[self::$emptyTarget][$interface];
        }

        return null;
    }
1351135
protected function getConfig(InputInterface $input)
    {
        /** @var $helper ConfigurationHelper */
        $helper = $this->getHelper('config');

        return $helper->loadFile($input->getOption('configuration'));
    }
1266892
public function getOptionParser()
    {
        $parser = new ConsoleOptionParser('console');
        $parser->setDescription('Validate modules configuration');
        $parser->addArgument('modules', [
            'help' => 'Comma-separated list of modules to validate.  All will be checked if omitted.',
        ]);
        $parser->addOption('no-warnings', [
            'short' => 'n',
            'help' => 'Skip warnings (display only errors)',
            'default' => false,
            'boolean' => true,
        ]);

        return $parser;
    }
23187
public static function console()
    {
        self::init();

        /*
         * Get the command line parameters.
         */
        $argv = $_SERVER['argv'];
        array_shift($argv); // strip the application name ("console")

        /*
         * Dispatch the command line request.
         */
        /** @var \Core\Services\Contracts\Command|false $command */
        $command = DI::getInstance()->get('command-factory')->command($argv);
        $status = $command->run();

        return $status;
    }
1203838
public function getCommandOptions()
    {
        $consoleOptions = array();
        foreach ($this->requests as $name => $request) {
            if ($request->isAvailableAsCommandOption()) {
                $consoleOptions[$name] = $request->convertToCommandOption();
            }
        }

        return $consoleOptions;
    }
967301
protected function getSetters($object)
    {
        // Get the current class
        $class = get_class($object);

        // Check if we have already parsed this class
        if (array_key_exists($class, $this->classMethodsCache) === true) {
            return $this->classMethodsCache[$class];
        }

        // Regex for parsing ReflectionParameter::__toString()
        $regex     = '/\[\s\<(?P<required>[^\>]+)\>\s' .
            '(?:(?P<typehint_a>[^\s]+|(?P<typehint_b>[^\s]+)\sor\s(?P<typehint_c>[^\s]+))\s)?' .
            '(?P<variable>\$[^\s]+)\s(?:=\s(?P<default>[^\]]+)\s)?\]/';

        // Make reflection and fetch the methods
        $reflectionClass = new ReflectionClass($object);
        $methods         = $reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC);

        // Make result container
        $setters         = new Collection\Method();

        // Loop through the methods
        foreach ($methods as $method) {
            // We only care about the setters
            if (substr($method->getName(), 0, 3) !== 'set') {
                continue;
            }

            // Get parameter collection
            $parameters = $method->getParameters();

            // We only take care of the first parameter of the setter
            $parameter  = $parameters[0];
            $raw        = (string) $parameter;

            // If we cannot match it we continue
            if (($result = preg_match($regex, $raw, $matches)) === false || $result === 0) {
                continue;
            }

            // Parse the result of the regex
            $required = ($matches['required'] === 'required');
            $variable = $matches['variable'];
            $default  = $required ? null : $matches['default'];
            $typehint = null;

            // Advanced typehint detection
            if (empty($matches['typehint_b']) === false) {
                $typehint = $matches['typehint_b'];
            } else if (empty($matches['typehint_a']) === false){
                $typehint = $matches['typehint_a'];
            }

            // Set the correct default value
            switch ($default) {
                case null:
                case 'NULL':
                    $default = null;
                    break;
                case 'Array':
                    $default = array();
                    break;
                default:
                    $default = trim($default, "'");
                    break;
            }

            // Has it child objects
            $childObject = ($typehint !== null && $typehint !== 'array');

            // Set the results the the response object
            $setters->offsetSet(
                $method->getName(),
                new Entity\Method(
                    $required,
                    $default,
                    $typehint,
                    $childObject
                )
            );
        }

        // Return the just generated response
        return $this->classMethodsCache[$class] = $setters;
    }