Page 1 of 1

PHP : extended classes and IDE

Posted: 29 March 2020, 01:19
by JustinFernal
Hello,

I've successfully followed the tutorial hearts and I've configured my local environment using VSCode (but that would be the same with other IDEs). Using a PHP formatter, I have many "Undefined method errors" due to the fact that the classes that our game extends (Table, APP_GameAction, game_view...) are not available locally.

Therefore, my IDE highlights every method that comes from those base classes as having an error (setGameStateInitialValue, DbQuery, reloadPlayersBasicInfos...) and is unable to give documentation or auto-completion.

So my question is the following : How do you usually configure the IDE for the game development?
Is there something to install (the source code or maybe the functions templates with their comments if the source code is not public) or do you just "live with it" and ignore all the "Undefined method error", hoping not to introduce one real yourself?

Re: PHP : extended classes and IDE

Posted: 17 May 2020, 16:20
by CestDLaTriche
Did you get this sorted ? I am just getting started and in the same situation

Re: PHP : extended classes and IDE

Posted: 17 May 2020, 17:54
by Draasill
I live with it and this is not great, even for a smallish game.

Plus, sometimes having the source code would help (I still don't know in what setGameStateInitialValue differs from setGameStateValue, for example).

Plus, autocompletion, some type hinting, etc.

But maybe access to BGA source code would expose some potential exploits ?

Re: PHP : extended classes and IDE

Posted: 17 May 2020, 18:32
by Benoit314
I use this file in my IDE, it works well: https://gist.github.com/TeddyGandon/9e3 ... 2688b463cd

Re: PHP : extended classes and IDE

Posted: 18 May 2020, 15:06
by hersh
I use VS code with intelephense plugin. In settings you can disable undefined checks

Code: Select all

    "intelephense.diagnostics.undefinedTypes": false,
    "intelephense.diagnostics.undefinedFunctions": false,
    "intelephense.diagnostics.undefinedConstants": false,
    "intelephense.diagnostics.undefinedClassConstants": false,
    "intelephense.diagnostics.undefinedMethods" : false,
    "intelephense.diagnostics.undefinedProperties" : false,
    "intelephense.diagnostics.undefinedVariables": false,