Skip to content

Commit 5390d7f

Browse files
committed
Consistently use Generator::isDefault() where appropriate
1 parent b49fc32 commit 5390d7f

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/examples/processors/schema-query-parameter/SchemaQueryParameter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __invoke(Analysis $analysis): void
2828
$operations = $analysis->getAnnotationsOfType(Operation::class);
2929

3030
foreach ($operations as $operation) {
31-
if ($operation->x !== Generator::UNDEFINED && array_key_exists(self::REF, $operation->x)) {
31+
if (!Generator::isDefault($operation->x) && array_key_exists(self::REF, $operation->x)) {
3232
if (!is_string($operation->x[self::REF])) {
3333
throw new \InvalidArgumentException('Value of `x.' . self::REF . '` must be a string');
3434
}

src/Annotations/License.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function validate(array $stack = [], array $skip = [], string $ref = '',
8888
$valid = parent::validate($stack, $skip, $ref, $context);
8989

9090
if (!$this->_context->isVersion('3.0.x')) {
91-
if (!Generator::isDefault($this->url) && $this->identifier !== Generator::UNDEFINED) {
91+
if (!Generator::isDefault($this->url) && !Generator::isDefault($this->identifier)) {
9292
$this->_context->logger->warning($this->identity() . ' url and identifier are mutually exclusive');
9393
$valid = false;
9494
}

src/Processors/Concerns/DocblockTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function parseDocblock(?string $docblock, ?array &$tags = null): string
132132
*/
133133
public function extractCommentSummary(string $content): string
134134
{
135-
if ($content === Generator::UNDEFINED) {
135+
if (Generator::isDefault($content)) {
136136
return Generator::UNDEFINED;
137137
}
138138

@@ -159,12 +159,12 @@ public function extractCommentSummary(string $content): string
159159
*/
160160
public function extractCommentDescription(string $content): string
161161
{
162-
if ($content === Generator::UNDEFINED) {
162+
if (Generator::isDefault($content)) {
163163
return Generator::UNDEFINED;
164164
}
165165

166166
$summary = $this->extractCommentSummary($content);
167-
if ($summary === Generator::UNDEFINED) {
167+
if (Generator::isDefault($summary)) {
168168
return Generator::UNDEFINED;
169169
}
170170

@@ -201,7 +201,7 @@ public function parseVarLine(?string $docblock): array
201201
*/
202202
public function extractExampleDescription(string $docblock): ?string
203203
{
204-
if (!$docblock || $docblock === Generator::UNDEFINED) {
204+
if (!$docblock || Generator::isDefault($docblock)) {
205205
return null;
206206
}
207207

@@ -215,7 +215,7 @@ public function extractExampleDescription(string $docblock): ?string
215215
*/
216216
public function isDeprecated(?string $docblock): bool
217217
{
218-
if (!$docblock || $docblock === Generator::UNDEFINED) {
218+
if (!$docblock || Generator::isDefault($docblock)) {
219219
return false;
220220
}
221221

0 commit comments

Comments
 (0)