Skip to content

Commit e81c29a

Browse files
committed
Prefer single line PHPDocs
1 parent 0882c4d commit e81c29a

File tree

206 files changed

+1638
-4886
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+1638
-4886
lines changed

benchmarks/Utils/QueryGenerator.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ public function buildQuery(): string
6060
return Printer::doPrint($ast);
6161
}
6262

63-
/**
64-
* @param array<FieldDefinition> $fields
65-
*/
63+
/** @param array<FieldDefinition> $fields */
6664
public function buildSelectionSet(array $fields): SelectionSetNode
6765
{
6866
$selections = [

benchmarks/Utils/SchemaGenerator.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ class SchemaGenerator
2525
/** @var array<string, ObjectType> */
2626
private array $objectTypes = [];
2727

28-
/**
29-
* @param array<string, int> $config
30-
*/
28+
/** @param array<string, int> $config */
3129
public function __construct(array $config)
3230
{
3331
$this->config = \array_merge($this->config, $config);
@@ -78,9 +76,7 @@ protected function createType(int $nestingLevel, ?string $typeName = null): Obje
7876
return $type;
7977
}
8078

81-
/**
82-
* @return array{0: Type, 1: string}
83-
*/
79+
/** @return array{0: Type, 1: string} */
8480
protected function getFieldTypeAndName(int $nestingLevel, int $fieldIndex): array
8581
{
8682
if ($nestingLevel >= $this->config['nestingLevel']) {
@@ -97,9 +93,7 @@ protected function getFieldTypeAndName(int $nestingLevel, int $fieldIndex): arra
9793
return [$fieldType, $fieldName];
9894
}
9995

100-
/**
101-
* @return array<int, array<string, mixed>>
102-
*/
96+
/** @return array<int, array<string, mixed>> */
10397
protected function createTypeFields(string $typeName, int $nestingLevel): array
10498
{
10599
$fields = [];
@@ -133,9 +127,7 @@ protected function createTypeFields(string $typeName, int $nestingLevel): array
133127
return $fields;
134128
}
135129

136-
/**
137-
* @return array<string, mixed>
138-
*/
130+
/** @return array<string, mixed> */
139131
protected function createFieldArgs(string $fieldName, string $typeName): array
140132
{
141133
return [

examples/01-blog/Blog/Data/Comment.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ class Comment
1818

1919
public bool $isAnonymous = true;
2020

21-
/**
22-
* @param array<string, mixed> $data
23-
*/
21+
/** @param array<string, mixed> $data */
2422
public function __construct(array $data)
2523
{
2624
Utils::assign($this, $data);

examples/01-blog/Blog/Data/DataSource.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ public static function findLastStoryFor(int $authorId): ?Story
129129
return $storiesFound[\count($storiesFound) - 1] ?? null;
130130
}
131131

132-
/**
133-
* @return array<int, User>
134-
*/
132+
/** @return array<int, User> */
135133
public static function findLikes(int $storyId, int $limit): array
136134
{
137135
$likes = self::$storyLikes[$storyId] ?? [];
@@ -166,9 +164,7 @@ public static function findLatestStory(): ?Story
166164
return self::$stories[\count(self::$stories) - 1] ?? null;
167165
}
168166

169-
/**
170-
* @return array<int, Story>
171-
*/
167+
/** @return array<int, Story> */
172168
public static function findStories(int $limit, ?int $afterId = null): array
173169
{
174170
$start = $afterId !== null
@@ -178,9 +174,7 @@ public static function findStories(int $limit, ?int $afterId = null): array
178174
return \array_slice(\array_values(self::$stories), $start, $limit);
179175
}
180176

181-
/**
182-
* @return array<int, Comment>
183-
*/
177+
/** @return array<int, Comment> */
184178
public static function findComments(int $storyId, int $limit = 5, ?int $afterId = null): array
185179
{
186180
$storyComments = self::$storyComments[$storyId] ?? [];
@@ -196,9 +190,7 @@ public static function findComments(int $storyId, int $limit = 5, ?int $afterId
196190
);
197191
}
198192

199-
/**
200-
* @return array<int, Comment>
201-
*/
193+
/** @return array<int, Comment> */
202194
public static function findReplies(int $commentId, int $limit = 5, ?int $afterId = null): array
203195
{
204196
$commentReplies = self::$commentReplies[$commentId] ?? [];
@@ -228,9 +220,7 @@ public static function countReplies(int $commentId): int
228220
: 0;
229221
}
230222

231-
/**
232-
* @return array<int, Story|User>
233-
*/
223+
/** @return array<int, Story|User> */
234224
public static function findStoryMentions(int $storyId): array
235225
{
236226
return self::$storyMentions[$storyId] ?? [];

examples/01-blog/Blog/Data/Image.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ class Image
2323

2424
public int $height;
2525

26-
/**
27-
* @param array<string, mixed> $data
28-
*/
26+
/** @param array<string, mixed> $data */
2927
public function __construct(array $data)
3028
{
3129
Utils::assign($this, $data);

examples/01-blog/Blog/Data/Story.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class Story
1616

1717
public bool $isAnonymous = false;
1818

19-
/**
20-
* @param array<string, mixed> $data
21-
*/
19+
/** @param array<string, mixed> $data */
2220
public function __construct(array $data)
2321
{
2422
Utils::assign($this, $data);

examples/01-blog/Blog/Data/User.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class User
1616

1717
public bool $hasPhoto;
1818

19-
/**
20-
* @param array<string, mixed> $data
21-
*/
19+
/** @param array<string, mixed> $data */
2220
public function __construct(array $data)
2321
{
2422
Utils::assign($this, $data);

examples/01-blog/Blog/Type/Scalar/EmailType.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
class EmailType extends ScalarType
1313
{
14-
/**
15-
* @throws SerializationError
16-
*/
14+
/** @throws SerializationError */
1715
public function serialize($value): string
1816
{
1917
if (! $this->isEmail($value)) {
@@ -24,9 +22,7 @@ public function serialize($value): string
2422
return $value;
2523
}
2624

27-
/**
28-
* @throws Error
29-
*/
25+
/** @throws Error */
3026
public function parseValue($value): string
3127
{
3228
if (! $this->isEmail($value)) {

examples/01-blog/Blog/Type/Scalar/UrlType.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
class UrlType extends ScalarType
1313
{
14-
/**
15-
* @throws SerializationError
16-
*/
14+
/** @throws SerializationError */
1715
public function serialize($value): string
1816
{
1917
if (! $this->isUrl($value)) {
@@ -24,9 +22,7 @@ public function serialize($value): string
2422
return $value;
2523
}
2624

27-
/**
28-
* @throws Error
29-
*/
25+
/** @throws Error */
3026
public function parseValue($value): string
3127
{
3228
if (! $this->isUrl($value)) {

examples/01-blog/Blog/Types.php

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ private static function get(string $classname): \Closure
9494
return static fn () => self::byClassName($classname);
9595
}
9696

97-
/**
98-
* @param class-string<Type&NamedType> $classname
99-
*/
97+
/** @param class-string<Type&NamedType> $classname */
10098
private static function byClassName(string $classname): Type
10199
{
102100
$parts = \explode('\\', $classname);
@@ -141,41 +139,31 @@ public static function byTypeName(string $shortName): Type
141139
throw new \Exception("Unknown graphql type: {$shortName}");
142140
}
143141

144-
/**
145-
* @throws InvariantViolation
146-
*/
142+
/** @throws InvariantViolation */
147143
public static function boolean(): ScalarType
148144
{
149145
return Type::boolean();
150146
}
151147

152-
/**
153-
* @throws InvariantViolation
154-
*/
148+
/** @throws InvariantViolation */
155149
public static function float(): ScalarType
156150
{
157151
return Type::float();
158152
}
159153

160-
/**
161-
* @throws InvariantViolation
162-
*/
154+
/** @throws InvariantViolation */
163155
public static function id(): ScalarType
164156
{
165157
return Type::id();
166158
}
167159

168-
/**
169-
* @throws InvariantViolation
170-
*/
160+
/** @throws InvariantViolation */
171161
public static function int(): ScalarType
172162
{
173163
return Type::int();
174164
}
175165

176-
/**
177-
* @throws InvariantViolation
178-
*/
166+
/** @throws InvariantViolation */
179167
public static function string(): ScalarType
180168
{
181169
return Type::string();

0 commit comments

Comments
 (0)