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

[v2.0] Drop support of PHP 5.6, 7.0 and 7.1 #5

Merged
merged 3 commits into from
Nov 27, 2019

Conversation

michalbundyra
Copy link
Member

@michalbundyra michalbundyra commented Nov 22, 2019

Update all code base to support PHP 7.2+ only.
Add strict type declaration.
Add typehints for all parameters and return types.
ExceptionInterface now extends Throwable.
All exceptions are not instantiable and theirs method as marked as @internal.

I am planning release it as version 2.0.0 but still v1.0 will be maintained.

/cc @Ocramius @morozov

Update all code base to support PHP 7.1+ only.
Add strict type declaration.
Add typehints for all parameters and return types.
ExceptionInterface now extends Throwable.
@michalbundyra michalbundyra added the enhancement New feature or request label Nov 22, 2019
@michalbundyra michalbundyra added this to the 2.0.0 milestone Nov 22, 2019
Copy link

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

LGTM! Is Static analysis already running against this codebase?

@morozov
Copy link

morozov commented Nov 22, 2019

How about reducing the BC surface by marking some symbols internal? Like exception constructors? This way, you won’t have to release a major every week :-)

* @return self
*/
public static function unableToChangeChmod($file)
public static function unableToChangeChmod(string $file) : self
Copy link

Choose a reason for hiding this comment

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

This could be made internal to avoid future BC breaks. You'll be able to remove or rename it at any time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Marked as internal and also changed all exceptions to be not instantiable (private construct).

interface ExceptionInterface
use Throwable;

interface ExceptionInterface extends Throwable
Copy link

Choose a reason for hiding this comment

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

Suffixes like Interface are discouraged by the Doctrine coding standard since they don't carry any meaning from the API standpoint. Would it make sense to rename it to Webimpress\SafeWriter\Exception?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am using webimpress/coding-standard here and it is one of the rules to have Interface suffix. The same approach we have in zendframework, and it's also my personal preference.

Recently in work we had issue with service called User and we had also entity called User. In many places it caused conflict and context was unclear. In most places where we used service we import it with alias UserService and finally we renamed it, so now all is clear.

composer.json Outdated
@@ -10,11 +10,11 @@
"race condition"
],
"require": {
"php": "^5.6 || ^7.0"
"php": "^7.1"
Copy link

Choose a reason for hiding this comment

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

Would it make sense to drop PHP 7.1 support as well? It's EOL very soon.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't sure about it, as many libraries are still on PHP 7.1, and I am not really using here any PHP 7.2 features. I've updated it only because PHP 7.1 is almost EOL and I am going to still support version 1.0.

@michalbundyra michalbundyra changed the title [v2.0] Drop support of PHP 5.6 and 7.0 [v2.0] Drop support of PHP 5.6, 7.0 and 7.1 Nov 27, 2019
michalbundyra added a commit that referenced this pull request Nov 27, 2019
[v2.0] Drop support of PHP 5.6, 7.0 and 7.1
michalbundyra added a commit that referenced this pull request Nov 27, 2019
@michalbundyra michalbundyra merged commit bfe2315 into webimpress:develop Nov 27, 2019
michalbundyra added a commit that referenced this pull request Nov 27, 2019
@michalbundyra michalbundyra deleted the feature/php-7.1 branch November 27, 2019 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants