FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19540&edit=1

ID: 19540
Updated by: gsherwood@squiz.net
Reported By: cweiske@php.net
Summary: Incorrect useless method override
-Status: Open
+Status: Feedback
Type: Bug
Package: PHP_CodeSniffer
Package Version: 1.3.5
PHP Version: Irrelevant
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
This looks like the same sort of problem as bug #19481. I don't see how
this can be
fixed. Got any ideas?


Previous Comments:
------------------------------------------------------------------------

[2012-08-02 16:51:40] cweiske

Description:
------------
Some code extends ArrayObject and limits the types of elements that can
be added by overriding the append() function.

PHPCS reports that as "Useless method overriding detected"
(Generic_Sniffs_CodeAnalysis_UselessOverridingMethodSniff).

So in this case, the override is necessary.

Test script:
---------------
<?php

class Foo extends ArrayObject
{
public function append(FooElement $e)
{
parent::append($e);
}
}

?>


Expected result:
----------------
No warning about that.

Actual result:
--------------
WARNING | Useless method overriding detected

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 6, '12 at 3:23a
activeAug 6, '12 at 3:23a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase