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

Typehinting #834

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

ColonelMoutarde
Copy link
Contributor

When submitting a pull request

  1. Run the linter.

    make lint
  2. Run the tests.

    make test
  3. Carefully read your diff before submitting a PR.

    • Make sure your diff clearly represents your changes.
    • Make sure your code is easy for reviewers to follow.
    • Can your code review be broken into smaller chunks?
    • Make sure you have PHPUnit tests that cover your changes.
  4. Make sure that your changes are very-nearly complete.

    • Small changes/fixes based on feedback are OK.
    • Major changes should be avoided while a PR is open. If you need to make major changes, close the PR, make your changes, and open a new PR once you're ready.
  5. In the description, start with an explanation of the change and why you want to make it.

    • Make any relevant documentation easily available for reviewers.
  6. Add a list of changes you've made using task list syntax.

    • Things that are complete should have [X].
    • Things that are still incomplete should have [ ].
  7. Discuss feedback.

    • The SimplePie NG Core Team has the final say on what gets accepted.
    • Respond to all code review feedback.
    • Respectfully discuss any feedback you disagree with. You may need to bring a better argument to the table to convince us.
  8. If you don't understand something, ask.

@ColonelMoutarde ColonelMoutarde marked this pull request as draft May 1, 2023 16:39
@jtojnar
Copy link
Contributor

jtojnar commented May 1, 2023

This will be a BC break.

src/Misc.php Outdated Show resolved Hide resolved
@ColonelMoutarde ColonelMoutarde marked this pull request as ready for review May 1, 2023 17:04
@Maikuolan
Copy link
Contributor

Maikuolan commented Jun 9, 2023

You can ignore this reply (I wrote something wrong). :-)

(Unless you really want to read it. Not going to delete it because deleting one's own replies at GitHub is in bad taste IMO).

This will be a BC break.

^ That.

Specifically, support for return type declarations wasn't added until PHP 7.0, so adding them to SimplePie would, at the very least, necessitate increasing the minimum required PHP version as stated at the repository's README and composer.json files from 5.3 to 7.

See:

(None of which necessarily makes it a bad idea. Declaring return types for all methods is a nice thing to do for modern, clean, well-written PHP code. However, if it were to be done, I would suggest earmarking it for a future new major version of SimplePie, rather than the current major version, in order to remain semver-compliant and to avoid surprising any users with the BC-break).

@jtojnar
Copy link
Contributor

jtojnar commented Jun 9, 2023

necessitate increasing the minimum required PHP version as stated at the repository's README and composer.json files from 5.3 to 7.

We are already targetting PHP 7.2 since SimplePie 1.8.0.

@Maikuolan
Copy link
Contributor

We are already targetting PHP 7.2 since SimplePie 1.8.0.

Whoops.. So we are. Scratch my reply then. My bad. '^.^

Self-reminder: Looking at multiple different repositories/projects/etc at the same time isn't always such a great idea. SimplePie aside, there's another RSS library I was looking at which supported older PHP versions, and I think I got my wires crossed there.

Anyway, all good.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Aug 22, 2023
@ColonelMoutarde
Copy link
Contributor Author

All fixed :°)

src/Misc.php Outdated Show resolved Hide resolved
@ColonelMoutarde
Copy link
Contributor Author

All tests success

Copy link
Contributor

@Art4 Art4 left a comment

Choose a reason for hiding this comment

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

I'm sorry, but as @jtojnar already said: This will be a BC break. Users who had extend e.g. Misc::fix_protocol() will get an exception.

@ColonelMoutarde
Copy link
Contributor Author

I'm sorry, but as @jtojnar already said: This will be a BC break. Users who had extend e.g. Misc::fix_protocol() will get an exception.

Do you have an suggestion ?

@Art4
Copy link
Contributor

Art4 commented Oct 18, 2023

Do you have an suggestion ?

Only suggestion is to defer your PR until we are working at release v2. Increasing the major version allows breaking changes.

But we are already planning to add return types by introducing new camelCase methods starting with 2.1.0, see #731.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants