-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from onmoon/add-property-dto-hook
Add property dto hook
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 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
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OnMoon\OpenApiServerBundle\Event\CodeGenerator; | ||
|
||
use OnMoon\OpenApiServerBundle\CodeGenerator\Dto\Definitions\PropertyDtoDefinition; | ||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
/** | ||
* The PropertyDtoGenerationEvent event occurs before any | ||
* of the DTOs nested in the Request Body or Response are generated. | ||
* | ||
* This event allows you to modify the definitions of the generated | ||
* nested DTOs that are used in the Request Body and Response DTOs, | ||
* customizing the generated code. | ||
*/ | ||
class PropertyDtoGenerationEvent extends Event | ||
{ | ||
private PropertyDtoDefinition $definition; | ||
|
||
public function __construct(PropertyDtoDefinition $definition) | ||
{ | ||
$this->definition = $definition; | ||
} | ||
|
||
public function definition() : PropertyDtoDefinition | ||
{ | ||
return $this->definition; | ||
} | ||
} |