Closed Chrico closed 6 years ago
The getIterator
bug is already fixed in master, with https://github.com/inpsyde/php-coding-standards/commit/412336470cc51e645c6e9103da4bba611db2c9e9
The get()
method is allowed because the regex that check for getters is ~(get|set)[_A-Z0-9]+~
which will not match for get
(or set
).
Releasee v0.8.0 which includes this fix.
Nice! What i see so far is that following are missing:
@Chrico there's not need for getReturn
. There's no way you can declare that method,because Generator
is final, so can't be extended.
You can only use that method. And using a method does not trigger any problem with the style.
Thw same applies to all the Exception
methods: getMessage()
, getCode()
and so on...
arg, seems that i've missed that when browsing on phone...so i guess all get
-methods are implement - for now. :)
Sometimes it is required to implement get/set or whatevery methods which are maybe not allowed by coding standard but fixed by an interface.
Following error occurs in version 0.7.x - release:
As code example we've following:
Link: http://php.net/manual/en/iteratoraggregate.getiterator.php
Secondly it could be also possible to e.G. implement PSR-standard interfaces like PSR container which are having a
get($id)
method.