src/Tool/MultipleCatch.php
private function messages(array $exceptions)
    {
        $names = array_map(function ($exception) {
            return $exception->children['name'];
        }, $exceptions);

        if (count($names) > 1) {
            $last = array_slice($names, -1);
            $message = implode("`, `", array_slice($names, 0, count($names) - 1));
            $message = "`$message` and `$last[0]`";
        } else {
            $message = "`$names[0]`";
        }

        return sprintf(self::HINT_MESSAGE, $message);
    }
private function messages(array $exceptions)
    {
        $names = array_map(function ($exception) {
            return $exception->children['name'];
        }, $exceptions);

        if (count($names) > 1) {
            $last = array_slice($names, -1);
            $message = implode("`, `", array_slice($names, 0, count($names) - 1));
            $message = "`$message` and `$last[0]`";
        } else {
            $message = "`$names[0]`";
        }

        return sprintf(self::HINT_MESSAGE, $message);
    }
private function messages ( array $ exceptions ) { $ names = array_map ( function ( $ exception ) { return $ exception -> children [ 'name' ] ; } , $ exceptions ) ; if ( count ( $ names ) > 1 ) { $ last = array_slice ( $ names , - 1 ) ; $ message = implode ( "`, `" , array_slice ( $ names , 0 , count ( $ names ) - 1 ) ) ; $ message = "`$message` and `$last[0]`" ; } else { $ message = "`$names[0]`" ; } return sprintf ( self :: HINT_MESSAGE , $ message ) ; }
Build a hint message from exceptions.

@param Node[] $exceptions List of exceptions to specify.
@return string Hint message.
Build a hint message from exceptions .