[
https://issues.apache.org/jira/browse/NETBEANS-108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16639260#comment-16639260
]
Junichi Yamamoto commented on NETBEANS-108:
-------------------------------------------
As a workaround: I suggest that you create an override method using the code
generator(Alt + INS) or code completion to prevent it. Thanks.
> No check of type hinting constistency in overwritten methods
> -------------------------------------------------------------
>
> Key: NETBEANS-108
> URL: https://issues.apache.org/jira/browse/NETBEANS-108
> Project: NetBeans
> Issue Type: Improvement
> Components: php - Editor
> Affects Versions: 8.2
> Environment: Both Windows and Mac OS
> Reporter: Alperovitch
> Priority: Major
>
> Let's consider the following code :
> {code}
> class A{
> function test(int $x) : bool{
> return $x>0;
> }
> }
> class B extends A{
> function test($x){
> return $x>10;
> }
> }
> {code}
> With PHP7.0 or 7.1 default parameters, this code would trigger the following
> error :
> {code}
> Fatal error: Declaration of B::test($x) must be compatible with A::test(int
> $x): bool
> {code}
> (and I am even not sure that there is any way to parameter PHP so that it
> does not trigger such error)
> It would be useful if the Editor would flag this issue as a warning or an
> error on the row of the definition of function test in class B.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists