View Issue Details

IDProjectCategoryView StatusLast Update
0021884mantisbtcode cleanuppublic2016-11-27 00:45
ReporterdregadAssigned Tocproensa 
PrioritylowSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product Version 
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 

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master-1.3.x ffe67c9e

2016-11-16 14:56:00

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
mod - core/bugnote_api.php Diff File

Issue History

Date Modified Username Field Change
2016-11-08 05:55 dregad New Issue
2016-11-15 11:28 dregad Relationship added related to 0021878
2016-11-15 11:29 dregad Relationship deleted related to 0021878
2016-11-15 11:32 dregad Relationship added related to 0020138
2016-11-16 14:53 cproensa Assigned To => cproensa
2016-11-16 14:53 cproensa Status new => assigned
2016-11-21 07:27 dregad Changeset attached => MantisBT master-1.3.x ffe67c9e
2016-11-21 07:27 dregad Assigned To cproensa => dregad
2016-11-21 07:27 dregad Status assigned => resolved
2016-11-21 07:27 dregad Resolution open => fixed
2016-11-21 07:27 dregad Fixed in Version => 1.3.4
2016-11-21 07:31 atrol Assigned To dregad => cproensa
2016-11-21 07:31 atrol Target Version => 1.3.4
2016-11-27 00:45 vboctor Status resolved => closed