ForumPostAssistant / FPA

The Forum Post Assistant (FPA) script has been developed to assist Joomla!® forum posters to be able to post relevant system, instance, PHP and troubleshooting information directly in to a pre-formatted forum post. This will save a few hours of posting back and forth, asking for, and explaining how to acquire useful information in order for other forum users to help troubleshoot a problem.
https://forumpostassistant.github.io/docs/
GNU General Public License v2.0
25 stars 15 forks source link

Consistent use of constant definitions #79

Closed sozzled closed 4 years ago

sozzled commented 4 years ago

Suggest constants be named consistently (all uppercase with leading underscore (e.g. _XXX_YYYYYYY)

One instance occurs that does not adhere to this practice

define ( '_last_updated', '7-Jun-2020' );             // date last updated

Suggest

define ( '_PKG_LAST_UPDATED, '7-Jun-2020' );             // date last updated

The constant is referenced at around line 8564 (?)

RussW commented 4 years ago

Absolutely agree, thanks for the attention to detail.

Can I suggest _RES_LAST_UPDATED & _RES_COPYRIGHT_STMT to fit in more constantly with other related schemes as FPA is not really a "package" in the traditional Joomla! sense as such and has previously been described as a "resource"?

sozzled commented 4 years ago

Fair enough (although why does line 3—which is only a comment—use @package ?). I have similar thoughts about the mixed use of _RES_XXXXXX and _FPA_XXXXXXX constants, too and will open a new issue for those.

RussW commented 4 years ago

thats a docblock thing that doesn't cater for standalone files/scripts, it assumes that every file is part of a "package"

sozzled commented 4 years ago

Confusing, isn't it? :laughing: Will leave it to you. Thanks.

RussW commented 4 years ago

committed as per above discussion at commit https://github.com/ForumPostAssistant/FPA/commit/718b535a4b21283f95e57b564d49bfeadb18edf6

sozzled commented 4 years ago

Change constant definition _COPYRIGHT_STMT to _RES_COPYRIGHT (or _RES_COPYRIGHT_STMT)

RussW commented 4 years ago

huh? line numer? thought I'd already done that

sozzled commented 4 years ago

You misunderstand. I mean, there's a constant defined as _COPYRIGHT_STMT, right? We agree on that?

If we adopt the convention that locally-defined constants should be named as _RES_XXXXXX, then the "copyright constant" should accordingly be defined as _RES_COPYRIGHT (or something similar). Makes sense now?

sozzled commented 4 years ago

UPDATED: My apologies. Because of the turn-based communication method, instead of real-time face to face, I missed a later commit.

Damn!

RussW commented 4 years ago

I'm lost, last commit is as follows;

/**

  • @package Joomla!
  • @subpackage Forum Post Assistant
  • @category Diagnostic Tool
  • @version 1.6.0
  • @since 24/06/2011
  • @author RussW
  • @author PhilD
  • @copyright 2011-present, GNU GPLv3 or later license
  • @see https://forumpostassistant.github.io/docs/
  • @internal Supports: J4.x, J3.x, J2,5, J1.7, J1.6, J1.5, J1.0
  • @internal Contributors : @RussW, @PhilD13, @mandville, @Frostmakk, @sozzled, @Webdongle, @botplak
  • UI/UX overhauled
  • @RussW 05/20202
  • docblock updated from the dark-ages
  • @RussW 08/06/2020
  • Remember to revision and last updated date below
  • */ define ( '_RES', 'Forum Post Assistant' ); define ( '_RES_VERSION', '1.6.0' ); define ( '_RES_CODENAME', 'rhytidectomy' ); define ( '_RES_LAST_UPDATED', '27-May-2020' ); define ( '_RES_RELEASE', 'Alpha' ); // can be Alpha, Beta, RC, Final define ( '_RES_LANG', 'en-GB' ); // Country/Language Code define ( '_RES_COPYRIGHT_STMT', ' Copyright © 2011-'. @date("Y"). ' Russell Winter, Phil DeGruy, Bernard Toplak, Claire Mandville, Sveinung Larsen.
    ' );

sozzled commented 4 years ago

It's fixed. Sorry. Crossed in posting.