Skip to content

Commit

Permalink
fix: minor fixes;
Browse files Browse the repository at this point in the history
  • Loading branch information
vitgrams committed Apr 17, 2023
1 parent 801549a commit 30a7710
Show file tree
Hide file tree
Showing 27 changed files with 591 additions and 175 deletions.
15 changes: 15 additions & 0 deletions src/Exceptions/SpecValidation/DuplicateFieldException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace RonasIT\Support\AutoDoc\Exceptions\SpecValidation;

use Exception;

class DuplicateFieldException extends Exception
{
public function __construct(string $fieldName, array $fieldValue)
{
$fieldValueString = implode(', ', $fieldValue);

parent::__construct("Validation failed. Found multiple '{$fieldName}' with value '{$fieldValueString}'.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Exception;

class DuplicatedParamException extends Exception
class DuplicateParamException extends Exception
{
public function __construct(string $in, string $name)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Exception;

class DuplicatedPathPlaceholderException extends Exception
class DuplicatePathPlaceholderException extends Exception
{
public function __construct(array $placeholders, string $path)
{
Expand Down
13 changes: 13 additions & 0 deletions src/Exceptions/SpecValidation/InvalidFieldNameException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace RonasIT\Support\AutoDoc\Exceptions\SpecValidation;

use Exception;

class InvalidFieldNameException extends Exception
{
public function __construct(string $fieldName)
{
parent::__construct("Validation failed. Invalid field name '{$fieldName}' found.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Exception;

class InvalidDocFieldValueException extends Exception
class InvalidFieldValueException extends Exception
{
/**
* @param string $fieldName
Expand Down
13 changes: 0 additions & 13 deletions src/Exceptions/SpecValidation/InvalidHttpMethodException.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Exceptions/SpecValidation/InvalidResponseCodeException.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Exception;

class MissedDocDefinitionException extends Exception
class MissingDefinitionException extends Exception
{
public function __construct(array $definitions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Exception;

class MissedDocFieldException extends Exception
class MissingFieldException extends Exception
{
public function __construct(array $fields, string $parent = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Exception;

class PathParamMissingException extends Exception
class MissingPathParamException extends Exception
{
public function __construct(string $operationId, array $placeholders)
{
Expand Down
13 changes: 13 additions & 0 deletions src/Exceptions/SpecValidation/MissingPathPlaceholderException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace RonasIT\Support\AutoDoc\Exceptions\SpecValidation;

use Exception;

class MissingPathPlaceholderException extends Exception
{
public function __construct(string $operationId, string $paramName)
{
parent::__construct("Validation failed. Operation {$operationId} has a path parameter named '{$paramName}', but there is no corresponding '{$paramName}' in the path string.");
}
}
Loading

0 comments on commit 30a7710

Please sign in to comment.