-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Upgrade to PHP7 strict mode #169
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
Upgrade to PHP7 strict mode #169
Conversation
Do not need to test PHP itself
Should have gone in a previous commit
Should have gone in a previous commit
How to define class variable types? |
Does it possible in PHP7? I think it could to do only with annotations only |
I am not sure. I couldn't find anything on it while having a quick search. But I would have thought that if in strict mode class variables need a declared type too. |
In HHVM properties declare with scalar types as: class User {
private string $name;
} Could you try this syntax for PHP 7? |
@bocharsky-bw unfortunately that didn't work 😢 . Thanks though 😄 |
- added tests as none existed - removed example usage as replaced by unit test
$book = clone $this->fooBookPrototype; | ||
|
||
$this->assertInstanceOf('DesignPatterns\Creational\Prototype\FooBookPrototype', $book); | ||
$this->assertNotSame($this->fooBookPrototype, $book); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed example usage file and replaced with test. Is this a good test, or can it be improved?
|
||
namespace DesignPatterns\Creational\FactoryMethod; | ||
|
||
/** | ||
* Bicycle is a bicycle | ||
* Class Bicycle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type of comments is non sens. Why do you have to write Class Bicycle
when is clearly that you define this class 3 lines below ?
Keep up the hard work, if you need help, feel free to inform me. |
I am closing here as it is already very old and I am working on PHP7 feature usage in the php7 branch. Thanks @eddiejaoude for the hard work and @bocharsky-bw, @marius-rizac and @HassanAlthaf for the feedback, I already incorporated most of it in the php-7 branch |
Do NOT merge (yet)
Creational
Structural
Behavioral
More