Skip to content

Commit

Permalink
fix comments, regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvsk committed Apr 7, 2023
1 parent e05173f commit 451a744
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 26 deletions.
6 changes: 3 additions & 3 deletions example/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
all: gen-php7.4 gen-php8.0 gen-php8.1

gen-php7.4: dto.schema.php
OUTPUT_DIR=php7.4 php8.1 ../bin/dto-gen --target 7.4
OUTPUT_DIR=php7.4 ../bin/dto-gen --target 7.4

gen-php8.0: dto.schema.php
OUTPUT_DIR=php8.0 php8.1 ../bin/dto-gen --target 8.0
OUTPUT_DIR=php8.0 ../bin/dto-gen --target 8.0

gen-php8.1: dto.schema.php
OUTPUT_DIR=php8.1 php8.1 ../bin/dto-gen --target 8.1
OUTPUT_DIR=php8.1 ../bin/dto-gen --target 8.1

clean:
rm -r php*
2 changes: 0 additions & 2 deletions example/php7.4/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class Author implements \JsonSerializable
{
Expand Down
2 changes: 0 additions & 2 deletions example/php7.4/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class Book implements \JsonSerializable
{
Expand Down
2 changes: 0 additions & 2 deletions example/php7.4/ScienceBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class ScienceBook extends Book implements \JsonSerializable
{
Expand Down
2 changes: 0 additions & 2 deletions example/php8.0/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class Author implements \JsonSerializable
{
Expand Down
2 changes: 0 additions & 2 deletions example/php8.0/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class Book implements \JsonSerializable
{
Expand Down
2 changes: 0 additions & 2 deletions example/php8.0/Genre.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
enum Genre: string
{
Expand Down
2 changes: 0 additions & 2 deletions example/php8.0/ScienceBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class ScienceBook extends Book implements \JsonSerializable
{
Expand Down
2 changes: 0 additions & 2 deletions example/php8.1/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class Author implements \JsonSerializable
{
Expand Down
2 changes: 0 additions & 2 deletions example/php8.1/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class Book implements \JsonSerializable
{
Expand Down
2 changes: 0 additions & 2 deletions example/php8.1/Genre.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
enum Genre: string
{
Expand Down
2 changes: 0 additions & 2 deletions example/php8.1/ScienceBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*
* @link https://github.com/klkvsk/dto-generator
* @link https://packagist.org/klkvsk/dto-generator
*
* ---
*/
class ScienceBook extends Book implements \JsonSerializable
{
Expand Down
4 changes: 3 additions & 1 deletion src/DtoGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ protected function prependComment(ClassType|EnumType $class, string $comment): v
}

$originalComment = $class->getComment();
$comment .= "\n---\n\n$originalComment";
if ($originalComment) {
$comment .= "\n---\n\n$originalComment";
}
$class->setComment($comment);
}

Expand Down

0 comments on commit 451a744

Please sign in to comment.