View Issue Details

IDProjectCategoryView StatusLast Update
0021884mantisbtcode cleanuppublic2020-09-02 11:01
Reporterdregad Assigned Tocproensa  
PrioritylowSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Target Version1.3.4Fixed in Version1.3.4 
Summary0021884: Use meaningful names for bugnote cache global variables
Description

As discussed in https://github.com/mantisbt/mantisbt/pull/941#discussion_r86762747

dregad

I never noticed we had 2 distinct variables for bugnotes caching. It is not really clear what the difference between them are, and they are not formally declared at the top of bugnote api, only as global in the functions using them. Do we actually need 2 of them ?

Even though that's not directly related to this PR, I would suggest to declare them, and add a PHPDoc block to explain their purpose and differences.

vboctor

I would also rename them to more meaningful names. For example:

$g_cache_bugnotes_by_id
$g_cache_bugnotes_by_bug_id

cproensa

right, those names are self-explaining, way better than current ones.
however i would not rename at this moment that there is other PR rewriting the same api

TagsNo tags attached.

Relationships

related to 0020138 closedcproensa file_bug_attachment_count fetch data for all bugs 
related to 0027200 new bugnote_update fires EVENT_BUGNOTE_EDIT but does not clear the note cache 

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master-1.3.x ffe67c9e

2016-11-16 09:56

cproensa

Committer: dregad


Details Diff
Bugnote api, use meaningful names and add types

- Rename global variables in bugnote_api used to cache bugnote data, to a
more defining name.
- Declare, initialize and document the cache variables.
- Add type hints to several function parameters

Fixes: 0021884
Affected Issues
0021884
mod - core/bugnote_api.php Diff File