7
7
/**
8
8
* @phpstan-type ComposerAuthor array{
9
9
* name: string,
10
- * email?:string,
11
- * homepage?:string,
12
- * role?:string
10
+ * email?: string,
11
+ * homepage?: string,
12
+ * role?: string,
13
13
* }
14
14
* @phpstan-type ComposerData array{
15
15
* name: string,
16
- * version?:string,
16
+ * version?: string,
17
17
* require?: array<string, string>,
18
- * require-dev?:array<string, string>,
19
- * description?:string,
20
- * keywords?:string[],
21
- * authors?:ComposerAuthor[],
22
- * extra?:array{modularity?:array<string,string>}
18
+ * require-dev?: array<string, string>,
19
+ * description?: string,
20
+ * keywords?: string[],
21
+ * authors?: ComposerAuthor[],
22
+ * extra?: array{modularity?: array<string, string>},
23
23
* }
24
24
*/
25
25
class LibraryProperties extends BaseProperties
@@ -124,9 +124,9 @@ public function withBaseUrl(string $url): LibraryProperties
124
124
}
125
125
126
126
/**
127
- * @param array{name?:string} $composerJsonData
127
+ * @param ComposerData $composerJsonData
128
128
*
129
- * @return list {string, string}
129
+ * @return array {string, string}
130
130
*/
131
131
protected static function buildNames (array $ composerJsonData ): array
132
132
{
@@ -152,19 +152,18 @@ protected static function buildNames(array $composerJsonData): array
152
152
* `5.6 || >= 7.1` returns `5.6`
153
153
* `>= 7.1 < 8` returns `7.1`
154
154
*
155
- * @param array{require?:array<string,string>, require-dev?:array<string,string>} $composerData
155
+ * @param ComposerData $composerData
156
156
* @param string $key
157
157
*
158
158
* @return string
159
159
*
160
160
* phpcs:disable Generic.Metrics.CyclomaticComplexity
161
- * phpcs:disable Syde.Files.LineLengthTooLong
162
161
*/
163
162
protected static function extractPhpVersion (
164
163
array $ composerData ,
165
164
string $ key = 'require '
166
165
): string {
167
-
166
+ // phpcs:enable Generic.Metrics.CyclomaticComplexity
168
167
$ nextKey = ($ key === 'require ' )
169
168
? 'require-dev '
170
169
: null ;
0 commit comments