describeApplication example

protected OutputInterface $output;

    public function describe(OutputInterface $output, object $object, array $options = []): void
    {
        $this->output = $output;

        match (true) {
            $object instanceof InputArgument => $this->describeInputArgument($object$options),
            $object instanceof InputOption => $this->describeInputOption($object$options),
            $object instanceof InputDefinition => $this->describeInputDefinition($object$options),
            $object instanceof Command => $this->describeCommand($object$options),
            $object instanceof Application => $this->describeApplication($object$options),
            default => throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))),
        };
    }

    protected function write(string $content, bool $decorated = false): void
    {
        $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
    }

    /** * Describes an InputArgument instance. */
protected OutputInterface $output;

    public function describe(OutputInterface $output, object $object, array $options = []): void
    {
        $this->output = $output;

        match (true) {
            $object instanceof InputArgument => $this->describeInputArgument($object$options),
            $object instanceof InputOption => $this->describeInputOption($object$options),
            $object instanceof InputDefinition => $this->describeInputDefinition($object$options),
            $object instanceof Command => $this->describeCommand($object$options),
            $object instanceof Application => $this->describeApplication($object$options),
            default => throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))),
        };
    }

    protected function write(string $content, bool $decorated = false): void
    {
        $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
    }

    /** * Describes an InputArgument instance. */
Home | Imprint | This part of the site doesn't use cookies.