Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The method __constructor can be private, but at the same time it it is never called in the current class. So, we should skip it.
Comment | File | Size | Author |
---|---|---|---|
#5 | interdiff-4-5.txt | 666 bytes | LOBsTerr |
#5 | private_constructor-3079227-5.patch | 1.87 KB | LOBsTerr |
#4 | interdiff-2-4.txt | 1.13 KB | LOBsTerr |
#4 | private_constructor-3079227-4.patch | 1.87 KB | LOBsTerr |
#2 | private_constructor-3079227-2.patch | 763 bytes | LOBsTerr |
Comments
Comment #2
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedComment #3
klausiI see, you would use a private __construct() if you don't want anybody to instantiate your class. So you probably only want it to be used for static methods or constants.
The patch makes sense, can you add a test case in UnusedPrivateMethodUnitTest.inc?
Please also create a pull request against https://github.com/pfrenssen/coder , then we see the automated tests run.
Comment #4
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedI have added a test case and created PR https://github.com/pfrenssen/coder/pull/58
Comment #5
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedA small fix change == to ===
Comment #7
klausiThank you so much, committed!