Skip to content

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
Copy link

@bwyu-dayspring bwyu-dayspring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Setting this as 2.x release is good b/c of the potentially breaking changes.

@jwong-dayspring jwong-dayspring merged commit d69122f into 2.x Mar 3, 2025
10 checks passed
@jwong-dayspring jwong-dayspring deleted the return-types branch March 3, 2025 19:11
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.

3 participants