PHP : extended classes and IDE

Game development with Board Game Arena Studio
Post Reply
User avatar
JustinFernal
Posts: 9
Joined: 27 March 2020, 03:03

PHP : extended classes and IDE

Post 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?
User avatar
CestDLaTriche
Posts: 1
Joined: 13 April 2020, 22:29

Re: PHP : extended classes and IDE

Post by CestDLaTriche »

Did you get this sorted ? I am just getting started and in the same situation
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

Re: PHP : extended classes and IDE

Post 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 ?
User avatar
Benoit314
Posts: 82
Joined: 02 April 2020, 22:12

Re: PHP : extended classes and IDE

Post by Benoit314 »

I use this file in my IDE, it works well: https://gist.github.com/TeddyGandon/9e3 ... 2688b463cd
User avatar
hersh
Posts: 76
Joined: 12 December 2013, 23:49

Re: PHP : extended classes and IDE

Post 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,
Post Reply

Return to “Developers”