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

Add PHP return types #10

Open
wants to merge 31 commits into
base: 2.x
Choose a base branch
from
Open

Add PHP return types #10

wants to merge 31 commits into from

Conversation

jwong-dayspring
Copy link

@jwong-dayspring jwong-dayspring commented Feb 25, 2025

  • This adds return types to the generated base model objects. This solves the return type issue encountered with Propel concrete inheritance and declaring return types on the parent class.
  • This will cause return type covariance errors anywhere a getter function is overridden and the return type changes. For example, a “data” column might have type VARCHAR and return a string, but the getData() function might be overridden to include json_decode() and then return an array. With Propel now declaring a return type of “string|null” on getData(), running json_decode() and changing the return type to “array” is no longer allowed.
  • This makes this PR backwards-incompatible with the current version of Propel.
  • Thus this should be versioned and released as a new major version, 2.x.
  • Change required PHP version to >=8.0

@jwong-dayspring jwong-dayspring changed the base branch from master to 2.x February 25, 2025 22:24
@jwong-dayspring jwong-dayspring changed the title Return types Add PHP return types Feb 25, 2025
@jwong-dayspring jwong-dayspring marked this pull request as ready for review February 25, 2025 22:24
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.

1 participant