generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly handle a case when both form request and inline validation …
…used (#552) * added params extraction splitting * fixed properties being skipped * removed unused dto * Fix styling --------- Co-authored-by: romalytvynenko <[email protected]>
- Loading branch information
1 parent
24dd581
commit e44fff1
Showing
10 changed files
with
394 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Support/OperationExtensions/RulesExtractor/GeneratesParametersFromRules.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Dedoc\Scramble\Support\OperationExtensions\RulesExtractor; | ||
|
||
use Dedoc\Scramble\Support\Generator\TypeTransformer; | ||
|
||
trait GeneratesParametersFromRules | ||
{ | ||
private function makeParameters($node, $rules, TypeTransformer $typeTransformer) | ||
{ | ||
return (new RulesToParameters($rules, $node, $typeTransformer))->handle(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/Support/OperationExtensions/RulesExtractor/RequestMethodCallsExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Dedoc\Scramble\Support\OperationExtensions\RulesExtractor; | ||
|
||
use Dedoc\Scramble\Support\RouteInfo; | ||
|
||
class RequestMethodCallsExtractor implements RulesExtractor | ||
{ | ||
public function shouldHandle(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function extract(RouteInfo $routeInfo): ParametersExtractionResult | ||
{ | ||
return new ParametersExtractionResult( | ||
parameters: array_values($routeInfo->requestParametersFromCalls->data), | ||
); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Support/OperationExtensions/RulesExtractor/RulesExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Dedoc\Scramble\Support\OperationExtensions\RulesExtractor; | ||
|
||
use Dedoc\Scramble\Support\RouteInfo; | ||
|
||
interface RulesExtractor | ||
{ | ||
public function shouldHandle(): bool; | ||
|
||
public function extract(RouteInfo $routeInfo): ParametersExtractionResult; | ||
} |
Oops, something went wrong.