View Issue Details

IDProjectCategoryView StatusLast Update
0000267Adventure PHP FrameworkNeues Feature // New Featurepublic2015-10-22 20:50
ReporterChristianAchatzAssigned ToChristianAchatz 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.0.2 
Target Version3.1Fixed in Version3.1 
Summary0000267: Clean up foreach loops with $DUMMY variable
DescriptionLooping through children of a current document is currently mostly implemented like this:

foreach ($children as $objectId => $DUMMY) {
   ...
}

To avoid dummy variables but be sure to operate on references the implementation should be updated to

foreach ($children as &$child) {
   ...
}

as per PHP documentation under http://php.net/manual/en/control-structures.foreach.php. There, it states:

##########################################################
In order to be able to directly modify array elements within the loop precede $value with &. In that case the value will be assigned by reference.
##########################################################
TagsNo tags attached.
Codereferenz: ([Datei]:[Zeile])
Namespacecore

Activities

ChristianAchatz

2015-10-20 09:34

administrator   ~0000622

Implementation of the core part now available within master under https://github.com/AdventurePHP/code/commit/85460d2d16f5d614f71108bfbbba86f2a1695673.

ChristianAchatz

2015-10-20 21:48

administrator   ~0000623

Part I of implementation on tools/modules part done along with adding unit tests. Changes available under https://github.com/AdventurePHP/code/commit/5cb8ba5cf0d05efd82e4c9e5e4fcdb6cc86d21a6.

ChristianAchatz

2015-10-22 20:50

administrator   ~0000624

Part II of implemetation finished. Thus, issue done.

Changes include upgrade to PHPUnit 5.0.X, composer introduction for PHPUnit installation, and preparation for code coverage measurement.

Issue History

Date Modified Username Field Change
2015-10-19 18:46 ChristianAchatz New Issue
2015-10-19 18:46 ChristianAchatz Status new => assigned
2015-10-19 18:46 ChristianAchatz Assigned To => ChristianAchatz
2015-10-20 09:34 ChristianAchatz Note Added: 0000622
2015-10-20 21:48 ChristianAchatz Note Added: 0000623
2015-10-22 20:50 ChristianAchatz Note Added: 0000624
2015-10-22 20:50 ChristianAchatz Status assigned => resolved
2015-10-22 20:50 ChristianAchatz Fixed in Version => 3.1
2015-10-22 20:50 ChristianAchatz Resolution open => fixed