17 Commits

Author SHA1 Message Date
Julian Vennen
6bd3d53eee
[PHP/Dart/Python] Correctly escape strings in single quotes (Fixes #17582) (#19529)
* [PHP/Dart/Python] Correctly escape strings in single quotes (Fixes #17582)

* Move escapeTextInSingleQuotes method to DefaultCodegen, add docblock
2024-11-09 16:50:12 +08:00
loicconan
fb17e5699d
[PHP-SYMFONY] Debug Symfony version 7, enums ref, array of enums $ref and date assert (#19008)
* [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert

* [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert

* [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert
2024-06-30 10:11:26 +08:00
loicconan
d945499073
[PHP-SYMFONY] Support BackedEnum for enum ref (16846) (#16847)
* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)
2023-11-07 22:40:35 +08:00
Artem
05b796aadc
Fix type hint for array in comments. (#16926) 2023-10-28 20:30:16 +08:00
Artem
039c1698b0
[php-symfony] Support for default scalar value of properties in model (#16605)
* Add support for default scalar value of properties in php-symfony models. Default values now returns in getter-functions

* Revert nullable type-hinting. Move default values from getter to property initialize.
Made changes in __construct:
Now value of properties rewrites only if key exist in $data array.
2023-10-01 21:32:32 +08:00
renaud-twd
efdc94b113
Fix enum generation for php-symfony generator (#14105)
* fix(symfony): enum generation

* docs(php symfony): update samples and docs
2022-12-27 23:42:41 +08:00
Daniel Metzner
3b15bb8a4e
[PHP] Enhance Symfony generator (#12532)
* Enhance Symfony generator

  - Add missing typehints
  - Add missing use statements
  - Simplify model ctor
  - Change fallthrough Exception to Throwable
  - prevent storing result of void methods
  - fix validate method
  - add default null values to model properties
  - simplify API interface return values
  - fix/rework default value implementation
  - fix optional params deprecation warnings
  - ..

For more details check out the PR: https://github.com/OpenAPITools/openapi-generator/pull/12532

* Enhance Symfony generator Tests

  - Skip risky tests
  - Fix type hint error
  - Fix class exists tests
  - Fix broken doc block
  - Enhance annotations
  - Update phpunit.xml.dist
  - Fix test config resource location
2022-06-25 20:53:21 +08:00
Benjamin Häublein
77fa028bb3
[php-symfony] Symfony6 support (#11810)
* support symfony6

* fix issues with StrictJsonDeserialization

* regenerate samples

* add suggestions

* update samples

* support php 7.4 and symfony 5

* allow versions based on semantic versioning

* regenerate sample

* change method of determining result types

* update samples

* describe usage of bundle in symfony app

* better documentation

* fix duplicate auth methods

* do not set namespace for default types

* fix UploadedFile type

* next try fixing auth

* regenerate samples

* fix: auth method shall not be duplicated

* Revert "fix duplicate auth methods"

This reverts commit 0dc418737b1379a30b7f22e7937819ba965c9ddb.

* chore: regenerate samples

* fix tests

* regenerate sample

* more fixes for tests

* update tests

* add kernel shutdown

Co-authored-by: Benjamin Haeublein <benjaminh@testing-vm.lan.benjaminh.de>
Co-authored-by: Renaud de Chivré <renaud@tahitiwebdesign.com>
2022-05-25 15:34:50 +08:00
Yuriy Belenko
83bad102ea
[php-symfony] Set required PHP version ^7.1.3 (#6181)
* Set PHP 7.1.3 required version

I've tried to specify ^7.0 version at first, but main package which is
symfony/framework-bundle@v4.4.8 requires PHP ^7.1.3.

* Bump Symfony FrameworkBundle to ^4.4.8

Current Symfony Framework stable version is v5.0.8, but I guess it
requires significant codebase upgrade, so I've sticked with 4.4.8 which
shouldn't cause any breaking changes. Old requirement was ^3.3|^4.1
which compatible with 4.4.8.

* Bump PHPUnit version to ^7.0

PHPUnit 8.x version required PHP ^7.2, so I'm setting 7.x version to
support PHP 7.1.
There is new way to specify Kernel class, related PR:
https://github.com/symfony/symfony/pull/22668

* Bump PHP CS Fixer version to ^2.16.3

Configuration and all renamed rules fixed.
Config file renamed to .php_cs.dist as recommended in migration guide.
Migration guide from 1.x to 2.x:
https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/UPGRADE.md#config-file

* Remove PHP_CodeSniffer package

Second linter doesn't make sense. I think Symfony user would prefer
PHP CS Fixer over PHP_CodeSniffer because first one maintained by Symfony
members.

* Remove satooshi/php-coveralls package from Composer

This package is abandoned and Coveralls recommends to install it directly
in Travis-CI task script.

* Update Travic-CI config

I've changed test versions to PHP 7.1.3 and 7.2. PHPUnit generates
coverage report in report/logs/clover.xml file. Then PHP CS Fixer runs
with --dry-run option to not override anything just to show coding style
errors.

* Add basic Coveralls config

This is basic recommended config for a PHP based project.

* Add symfony/yaml package

This package was part of satooshi/php-coveralls, now it should be
defined as dev dependency.

* Do not commit composer.lock

I think committed composer.lock can cause CI errors while tests on fresh
installs are better.

* Remove confusing Ruby comment
2020-05-29 18:35:11 +08:00
Artem
0032e04530
[php-symfony] Fix return type in model setters. (#6085)
* Fix return type in model setters.
Previously return type was same, as method arguments. It`s wrong, and cause errors like
"Return value of Foo::setSuccess() must be of the type bool, object returned"
We cant use self and current {{classname}} as return type, because that can break class inheritance. So, better remove type hint on setters, until PHP-devs dont make realization for return static

* Add return self type hint for setters

* Revert "Add return self type hint for setters"

This reverts commit 07dd9715
2020-04-30 22:03:05 +03:00
Sem Schilder
c0fcffdfe4
Add return types to getter and fluent setter (#5348)
* Add return types to getter and fluent setter

* Add build example output
2020-02-25 11:46:43 +08:00
William Cheng
dc0c24b955
Minor wording change (#2875)
* better wording for version of openapi doc

* update petstore samples
2019-05-13 15:59:59 +08:00
Ludovic Montel
7f8ff35245 fix #1272 Fix wrong PHP Symfony typehint (#1453)
A model with an array property used to have the wrong PHP typehint in
the setter: the array item object type instead of "array"
2018-11-18 12:38:44 +08:00
Akihito Nakano
872dd546f4 Update php related samples (#375)
* Update php client (OAS3)

bin/openapi3/php-petstore.sh

* Update symfony server (OAS2)

bin/php-symfony-petstore.sh

* Lumen: remove 'swagger'

* Update lumen server (OAS2)

* Update php client (security): deleted 'SwaggerClient-php' folder

* Update TEST_DIR

* Update php client tests (OAS3)

bin/openapi3/php-petstore.sh

* Update php client (OAS2)

bin/php-petstore.sh

* Fix

* Fix lumen -> php-lumen

* Update lumen server (security)

* Delete moved files

currently it will generate into under 'lib' folder.

* Fix slim -> php-slim

* Update slim server (security)

bin/security/slim-petstore-server.sh

* Fix

* Update dot files
2018-05-09 10:34:19 +08:00
William Cheng
7ad92572e4
Update default value for PHP server generators (slim, silex) (#272)
* update php slim samples

* update php silex samples

* update php silex default value
2018-04-30 15:18:13 +08:00
naelrashdeen
5d59dd10ec [PHP][Symfony] Further enhancements (#7001)
* Further enchancements for PHP-Symfony. Fixes issues described in #6999

* Ran shell script to update petstore sample
2017-11-27 16:25:50 +08:00
naelrashdeen
b034e4446a [PHP][Symfony] Enhancements (#6615)
* Removed commented code

* Input validation is now supported as strict JSON validation

* [PHP][Symfony] Improve the implementation
Closes #6614

* Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer

* Updated shell script because shippable tests were failing
2017-10-23 22:50:56 +08:00