src/Shell/ValidateShell.php
protected function printMessages(string $type, array $messages = []) : void
    {
        $this->out('');

        $plural = Inflector::pluralize($type);
        if (empty($messages)) {
            $this->success("No $plural found in module.");

            return;
        }

        // Minimize output to only unique messages
        $messages = array_unique($messages);

        $plural = ucfirst($plural);
        $this->{$type}("$plural (" . count($messages) . "):");

        // Remove ROOT path for shorter output
        $messages = preg_replace('#' . ROOT . DS . '#', '', $messages);
        if (null === $messages) {
            return;
        }

        // Prefix all messages as list items
        $messages = preg_replace('/^/', ' - ', $messages);
        if (null === $messages) {
            return;
        }

        $this->{$type}($messages);
    }
protected function printMessages(string $type, array $messages = []) : void
    {
        $this->out('');

        $plural = Inflector::pluralize($type);
        if (empty($messages)) {
            $this->success("No $plural found in module.");

            return;
        }

        // Minimize output to only unique messages
        $messages = array_unique($messages);

        $plural = ucfirst($plural);
        $this->{$type}("$plural (" . count($messages) . "):");

        // Remove ROOT path for shorter output
        $messages = preg_replace('#' . ROOT . DS . '#', '', $messages);
        if (null === $messages) {
            return;
        }

        // Prefix all messages as list items
        $messages = preg_replace('/^/', ' - ', $messages);
        if (null === $messages) {
            return;
        }

        $this->{$type}($messages);
    }
protected function printMessages ( string $ type , array $ messages = [ ] ) : void { $ this -> out ( '' ) ; $ plural = Inflector :: pluralize ( $ type ) ; if ( empty ( $ messages ) ) { $ this -> success ( "No $plural found in module." ) ; return ; } // Minimize output to only unique messages $ messages = array_unique ( $ messages ) ; $ plural = ucfirst ( $ plural ) ; $ this -> { $ type } ( "$plural (" . count ( $ messages ) . "):" ) ; // Remove ROOT path for shorter output $ messages = preg_replace ( '#' . ROOT . DS . '#' , '' , $ messages ) ; if ( null === $ messages ) { return ; } // Prefix all messages as list items $ messages = preg_replace ( '/^/' , ' - ' , $ messages ) ; if ( null === $ messages ) { return ; } $ this -> { $ type } ( $ messages ) ; }
Print messages of a given type

@param string $type Type of messages (info, error, warning, etc)
@param string[] $messages Array of messages to report
@return void
Print messages of a given type