Skip to content

Commit

Permalink
Add Yaml flags type-hint and other minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann committed Jan 6, 2025
1 parent 37c532d commit e931f83
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 18 deletions.
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ parameters:
count: 1
path: src/Annotations/Schema.php

-
message: "#^Result of && is always false\\.$#"
count: 3
path: src/Processors/AugmentProperties.php

-
message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-string and '' will always evaluate to false\\.$#"
count: 1
path: src/Processors/AugmentProperties.php

-
message: "#^Call to function is_array\\(\\) with bool\\|OpenApi\\\\Annotations\\\\AdditionalProperties will always evaluate to false\\.$#"
count: 1
Expand Down
2 changes: 2 additions & 0 deletions src/Annotations/AbstractAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ public function mergeProperties($object): void

/**
* Generate the documentation in YAML format.
*
* @param int-mask-of<Yaml::PARSE_*>|null $flags A bit field of PARSE_* constants to customize the YAML parser behavior
*/
public function toYaml(?int $flags = null): string
{
Expand Down
2 changes: 0 additions & 2 deletions src/Processors/Concerns/DocblockTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ public function extractVarTypeAndDescription(?string $docblock): array
);
}

// ------------------------------------------------------------------------

/**
* Extract example text from a `@example` dockblock line.
*/
Expand Down
3 changes: 1 addition & 2 deletions tests/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ public function testDebugLocation(): void
{
$this->assertOpenApiLogEntryContains('Required @OA\PathItem() not found');
$openapi = (new Generator($this->getTrackingLogger()))
->setAnalyser(new TokenAnalyser())
->generate([$this->fixture('Customer.php')]);

$customerSchema = $openapi->components->schemas[0];
$this->assertStringContainsString(
'Fixtures/Customer.php on line 16',
'Fixtures/Customer.php on line ',
$customerSchema->_context->getDebugLocation()
);

Expand Down
2 changes: 0 additions & 2 deletions tests/PipelineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public function __construct(string $add)
$this->add = $add;
}

// ------------------------------------------------------------------------

public function __invoke($payload)
{
return $payload . $this->add;
Expand Down
2 changes: 0 additions & 2 deletions tools/src/Docs/RefGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ public function formatAnnotationsDetails(string $name, string $fqdn, string $fil
return ob_get_clean();
}

// ------------------------------------------------------------------------

protected function getPropertyDocumentation(string $fqdn, string $name): array
{
/** @var class-string<AbstractAnnotation> $class */
Expand Down

0 comments on commit e931f83

Please sign in to comment.