src/ClientResolver.php
private function getArgMessage($name, $args = [], $useRequired = false)
    {
        $arg = $this->argDefinitions[$name];
        $msg = '';
        $modifiers = [];
        if (isset($arg['valid'])) {
            $modifiers[] = implode('|', $arg['valid']);
        }
        if (isset($arg['choice'])) {
            $modifiers[] = 'One of ' . implode(', ', $arg['choice']);
        }
        if ($modifiers) {
            $msg .= '(' . implode('; ', $modifiers) . ')';
        }
        $msg = wordwrap("{$name}: {$msg}", 75, "\n  ");

        if ($useRequired && is_callable($arg['required'])) {
            $msg .= "\n\n  ";
            $msg .= str_replace("\n", "\n  ", call_user_func($arg['required'], $args));
        } elseif (isset($arg['doc'])) {
            $msg .= wordwrap("\n\n  {$arg['doc']}", 75, "\n  ");
        }

        return $msg;
    }
private function getArgMessage($name, $args = [], $useRequired = false)
    {
        $arg = $this->argDefinitions[$name];
        $msg = '';
        $modifiers = [];
        if (isset($arg['valid'])) {
            $modifiers[] = implode('|', $arg['valid']);
        }
        if (isset($arg['choice'])) {
            $modifiers[] = 'One of ' . implode(', ', $arg['choice']);
        }
        if ($modifiers) {
            $msg .= '(' . implode('; ', $modifiers) . ')';
        }
        $msg = wordwrap("{$name}: {$msg}", 75, "\n  ");

        if ($useRequired && is_callable($arg['required'])) {
            $msg .= "\n\n  ";
            $msg .= str_replace("\n", "\n  ", call_user_func($arg['required'], $args));
        } elseif (isset($arg['doc'])) {
            $msg .= wordwrap("\n\n  {$arg['doc']}", 75, "\n  ");
        }

        return $msg;
    }
private function getArgMessage ( $ name , $ args = [ ] , $ useRequired = false ) { $ arg = $ this -> argDefinitions [ $ name ] ; $ msg = '' ; $ modifiers = [ ] ; if ( isset ( $ arg [ 'valid' ] ) ) { $ modifiers [ ] = implode ( '|' , $ arg [ 'valid' ] ) ; } if ( isset ( $ arg [ 'choice' ] ) ) { $ modifiers [ ] = 'One of ' . implode ( ', ' , $ arg [ 'choice' ] ) ; } if ( $ modifiers ) { $ msg .= '(' . implode ( '; ' , $ modifiers ) . ')' ; } $ msg = wordwrap ( "{$name}: {$msg}" , 75 , "\n  " ) ; if ( $ useRequired && is_callable ( $ arg [ 'required' ] ) ) { $ msg .= "\n\n  " ; $ msg .= str_replace ( "\n" , "\n  " , call_user_func ( $ arg [ 'required' ] , $ args ) ) ; } elseif ( isset ( $ arg [ 'doc' ] ) ) { $ msg .= wordwrap ( "\n\n  {$arg['doc']}" , 75 , "\n  " ) ; } return $ msg ; }
Creates a verbose error message for an invalid argument.

@param string $name        Name of the argument that is missing.
@param array  $args        Provided arguments
@param bool   $useRequired Set to true to show the required fn text if
available instead of the documentation.
@return string
Creates a verbose error message for an invalid argument .