Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make PhpCompatUtil::getPhpVersion() public #970

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

nikophil
Copy link
Contributor

@nikophil nikophil commented Sep 13, 2021

Hello,

what do you think if we make the method PhpCompatUtil::getPhpVersion() public?

This could be needed for some libs which leverage maker bundle

This would be helpful to resolve this problem: api-platform/core#4423 (review)

Another solution for my problem would be to expose a global is_php8 variable to all templates. but maybe that's not a good solution, because way may need to differentiate minor versions

@jrushlow
Copy link
Collaborator

jrushlow commented Sep 13, 2021

We already have a global use_attributes & use_typed_properties variable available in the maker templates -

$variables['use_typed_properties'] = $this->phpCompatUtil->canUseTypedProperties();

What additional features are needed in PHP8 that are not covered by these 2 methods? If union return types is needed, adding a public canUseUnionTypes(): bool method would be the way to go (although redundant) vs. opening up the getPhpVersion() scope as the class itself is internal.

@nikophil
Copy link
Contributor Author

Hello @jrushlow

thanks for your feedback. I indeed felt it was a little bit redundant, and not flexible enough.

Here is a fix. Cheers!

@weaverryan
Copy link
Member

Thanks Nicolas - I like where this ended up :)

@weaverryan weaverryan merged commit 25cb296 into symfony:main Sep 14, 2021
@jrushlow jrushlow mentioned this pull request Sep 24, 2021
weaverryan added a commit that referenced this pull request Sep 27, 2021
This PR was merged into the 1.0-dev branch.

Discussion
----------

[release] prep 1.34.0

# Release
Hi Makers!

This release contains a few new features, fixes, and improvements under the hood! Most notably, this release introduces PHP Attribute support for `make:entity` including entities using API Platform, support for the new Symfony Password Hasher in `make:reset-password`, & `make:registration`, and implements stronger return types where possible.

Diff: v1.33.0...v1.34.0

Happy making!

# Changelog

## [v1.34.0](https://github.com/symfony/maker-bundle/releases/tag/v1.34.0)

*September 27th, 2021*

### Feature

- [#978](#978) - Adding Entity attribute support - *`@simonmarx`*, *`@geekimo`*, *`@adlpz`*, *`@weaverryan`*, *`@jrushlow`*
- [#970](#970) - make PhpCompatUtil::getPhpVersion() public - *`@nikophil`*
- [#968](#968) - [make:entity] APIP: use new attribute if exists - *`@nikophil`*
- [#963](#963) - add return types for symfony 6 - *`@jrushlow`*
- [#925](#925) - [templates] Add void return types - *`@seb`-jean*
- [#923](#923) - use password hasher for make:registration & make:reset-password, includes other improvements - *`@jrushlow`*

### Bug Fix

- [#974](#974) - Fix method call definition - *`@ajgarlag`*
- [#973](#973) - Fix we we typo - *`@karser`*
- [#933](#933) - [make:entity] Remove deprecated json_array type from available list types. - *`@bdaler`*
- [#930](#930) - Add all missed dependencies to make:reset-password - *`@upyx`*
- [#870](#870) - [make:crud] Fix templates path use in include - *`@leblanc`-simon*

Commits
-------

2ba83b3 [release] prep 1.34.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants