Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 200
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
3
/*
3
/*
4
 * This file is part of Psy Shell.
4
 * This file is part of Psy Shell.
5
 *
5
 *
6
 * (c) 2012-2022 Justin Hileman
6
 * (c) 2012-2023 Justin Hileman
7
 *
7
 *
8
 * For the full copyright and license information, please view the LICENSE
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
9
 * file that was distributed with this source code.
Zeile 66... Zeile 66...
66
     *
66
     *
67
     * @see DocBlock::$vectors
67
     * @see DocBlock::$vectors
68
     *
68
     *
69
     * @param array $vector
69
     * @param array $vector
70
     * @param array $lines
70
     * @param array $lines
71
     *
-
 
72
     * @return string
-
 
73
     */
71
     */
74
    private static function formatVector(array $vector, array $lines): string
72
    private static function formatVector(array $vector, array $lines): string
75
    {
73
    {
76
        $template = [' '];
74
        $template = [' '];
77
        foreach ($vector as $type) {
75
        foreach ($vector as $type) {
Zeile 131... Zeile 129...
131
    /**
129
    /**
132
     * Get a docblock vector template.
130
     * Get a docblock vector template.
133
     *
131
     *
134
     * @param string $type Vector type
132
     * @param string $type Vector type
135
     * @param int    $max  Pad width
133
     * @param int    $max  Pad width
136
     *
-
 
137
     * @return string
-
 
138
     */
134
     */
139
    private static function getVectorParamTemplate(string $type, int $max): string
135
    private static function getVectorParamTemplate(string $type, int $max): string
140
    {
136
    {
141
        if (!isset(self::$vectorParamTemplates[$type])) {
137
        if (!isset(self::$vectorParamTemplates[$type])) {
142
            return \sprintf('%%-%ds', $max);
138
            return \sprintf('%%-%ds', $max);
Zeile 148... Zeile 144...
148
    /**
144
    /**
149
     * Indent a string.
145
     * Indent a string.
150
     *
146
     *
151
     * @param string $text   String to indent
147
     * @param string $text   String to indent
152
     * @param string $indent (default: '  ')
148
     * @param string $indent (default: '  ')
153
     *
-
 
154
     * @return string
-
 
155
     */
149
     */
156
    private static function indent(string $text, string $indent = '  '): string
150
    private static function indent(string $text, string $indent = '  '): string
157
    {
151
    {
158
        return $indent.\str_replace("\n", "\n".$indent, $text);
152
        return $indent.\str_replace("\n", "\n".$indent, $text);
159
    }
153
    }
Zeile 160... Zeile 154...
160
 
154
 
161
    /**
155
    /**
162
     * Convert underscored or whitespace separated words into sentence case.
156
     * Convert underscored or whitespace separated words into sentence case.
163
     *
157
     *
164
     * @param string $text
-
 
165
     *
-
 
166
     * @return string
158
     * @param string $text
167
     */
159
     */
168
    private static function inflect(string $text): string
160
    private static function inflect(string $text): string
169
    {
161
    {