|
From: <gem...@li...> - 2011-10-17 11:22:57
|
Revision: 105
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=105&view=rev
Author: mennodekker
Date: 2011-10-17 11:22:46 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
Removed some duplicate code that was replaced by a method
Modified Paths:
--------------
trunk/library/classes/Gems/Event/EventCalculations.php
Modified: trunk/library/classes/Gems/Event/EventCalculations.php
===================================================================
--- trunk/library/classes/Gems/Event/EventCalculations.php 2011-10-14 15:06:50 UTC (rev 104)
+++ trunk/library/classes/Gems/Event/EventCalculations.php 2011-10-17 11:22:46 UTC (rev 105)
@@ -209,16 +209,8 @@
protected function sumInt(array $tokenAnswers, $fieldNames)
{
if (is_string($fieldNames)) {
- $startName = $fieldNames;
- $fieldNames = array();
-
- foreach ($tokenAnswers as $fieldName => $value) {
- if (strpos($fieldName, $startName) !== false) {
- $fieldNames[] = $fieldName;
- }
- }
+ $fieldNames = $this->_arrayFindName($tokenAnswers, $fieldNames);
}
- // MUtil_Echo::track($fieldNames);
$sum = 0;
foreach ($fieldNames as $name) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-07-17 15:12:43
|
Revision: 849
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=849&view=rev
Author: matijsdejong
Date: 2012-07-17 15:12:32 +0000 (Tue, 17 Jul 2012)
Log Message:
-----------
Spelling correction
Modified Paths:
--------------
trunk/library/classes/Gems/Event/EventCalculations.php
Modified: trunk/library/classes/Gems/Event/EventCalculations.php
===================================================================
--- trunk/library/classes/Gems/Event/EventCalculations.php 2012-07-16 17:36:52 UTC (rev 848)
+++ trunk/library/classes/Gems/Event/EventCalculations.php 2012-07-17 15:12:32 UTC (rev 849)
@@ -137,7 +137,7 @@
}
/**
- * Checks all $values for a change against $tokenAnswers as intger
+ * Checks all $values for a change against $tokenAnswers as integer
*
* @param array $values
* @param array $tokenAnswers
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-09-05 10:21:26
|
Revision: 926
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=926&view=rev
Author: mennodekker
Date: 2012-09-05 10:21:17 +0000 (Wed, 05 Sep 2012)
Log Message:
-----------
Made EventCalculations static and most methods public to make access easier
Modified Paths:
--------------
trunk/library/classes/Gems/Event/EventCalculations.php
Modified: trunk/library/classes/Gems/Event/EventCalculations.php
===================================================================
--- trunk/library/classes/Gems/Event/EventCalculations.php 2012-09-05 09:59:13 UTC (rev 925)
+++ trunk/library/classes/Gems/Event/EventCalculations.php 2012-09-05 10:21:17 UTC (rev 926)
@@ -56,7 +56,7 @@
* @param array $tokenAnswers The answers to compare to
* @return boolean True when the value changed.
*/
- protected function addWhenChanged($name, $value, array &$results, array $tokenAnswers)
+ public static function addWhenChanged($name, $value, array &$results, array $tokenAnswers)
{
if ($value != $tokenAnswers[$name]) {
$results[$name] = $value;
@@ -73,7 +73,7 @@
* @param string $fieldNames
* @return array
*/
- private function _arrayFindName(array $tokenAnswers, $fieldNames)
+ private static function _arrayFindName(array $tokenAnswers, $fieldNames)
{
$results = array();
@@ -95,10 +95,10 @@
* @param mixed $fieldNames An array of those names that should be used or a string that should occur in all names that have to be selected.
* @return float
*/
- public function averageInt(array $tokenAnswers, $fieldNames)
+ public static function averageInt(array $tokenAnswers, $fieldNames)
{
if (is_string($fieldNames)) {
- $fieldNames = $this->_arrayFindName($tokenAnswers, $fieldNames);
+ $fieldNames = self::_arrayFindName($tokenAnswers, $fieldNames);
}
$count = 0;
@@ -119,7 +119,7 @@
* @param array $tokenAnswers
* @return array Those values that were changed.
*/
- protected function checkFloatChanged(array $values, array $tokenAnswers)
+ public static function checkFloatChanged(array $values, array $tokenAnswers)
{
$results = array();
@@ -143,7 +143,7 @@
* @param array $tokenAnswers
* @return array Those values that were changed.
*/
- protected function checkIntegerChanged(array $values, array $tokenAnswers)
+ public static function checkIntegerChanged(array $values, array $tokenAnswers)
{
$results = array();
@@ -168,7 +168,7 @@
* @param int $max
* @return int
*/
- public function reverseCode($code, $min, $max)
+ public static function reverseCode($code, $min, $max)
{
return $max - ($code - $min);
}
@@ -182,7 +182,7 @@
* @param int $decimals
* @return string
*/
- protected function roundFixed($value, $decimals = 2)
+ public static function roundFixed($value, $decimals = 2)
{
$value = round($value, $decimals);
@@ -206,10 +206,10 @@
* @param mixed $fieldNames An array of those names that should be used or a string that should occur in all names that have to be selected.
* @return int
*/
- public function sumInt(array $tokenAnswers, $fieldNames)
+ public static function sumInt(array $tokenAnswers, $fieldNames)
{
if (is_string($fieldNames)) {
- $fieldNames = $this->_arrayFindName($tokenAnswers, $fieldNames);
+ $fieldNames = self::_arrayFindName($tokenAnswers, $fieldNames);
}
$sum = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|