center-for-learning-management / moodle-block_gps

Moodle Block Plugin to determine the current user-position
GNU General Public License v3.0
2 stars 0 forks source link

Moodle Code Checker fixes #9

Closed GGeorggg closed 1 year ago

GGeorggg commented 1 year ago

Hallo @lassnj

hab mal alle trivialen Fehler gefixt - code ist nicht getestet - folgende Fehler müsste sich @prowebat noch anschauen:

FILE: /home/runner/work/moodle-block_gps/moodle-block_gps/moodle/blocks/gps/externallib.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------
 40 | ERROR | global $PAGE cannot be used in block classes. Use $this->page.
    |       | (moodle.PHP.ForbiddenGlobalUse.BadGlobal)
 47 | ERROR | global $PAGE cannot be used in block classes. Use $this->page.
    |       | (moodle.PHP.ForbiddenGlobalUse.BadGlobal)
 73 | ERROR | global $PAGE cannot be used in block classes. Use $this->page.
    |       | (moodle.PHP.ForbiddenGlobalUse.BadGlobal)
 81 | ERROR | global $PAGE cannot be used in block classes. Use $this->page.
    |       | (moodle.PHP.ForbiddenGlobalUse.BadGlobal)
-----------------------------------------------------------------------------------------------------------------------

FILE: /home/runner/work/moodle-block_gps/moodle-block_gps/moodle/blocks/gps/classes/locallib.php
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 110 | ERROR | [x] Must use "self::" for local static member reference
     |       |     (Squiz.Classes.SelfMemberReference.NotUsed)
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

lg Georg

prowebat commented 1 year ago

die Fehler 1-4 sind m.E. false-positives. und ich weis nicht wie man das sonst machen kann. Kann man die ignorieren?

Fehler 5 sollte behoben sein.

Nicht getestet, weil ich den Block nicht kenne.