Skip to content
Extraits de code Groupes Projets
Valider d4e802c0 rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

Fixes #3356 Better not use const XYZ in global scope (outside classes) as this...

Fixes #3356 Better not use const XYZ in global scope (outside classes) as this is only working on PHP 5.3

git-svn-id: http://dev.piwik.org/svn/trunk@6902 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 685f16c6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* @package Piwik_MobileMessaging_ReportRenderer * @package Piwik_MobileMessaging_ReportRenderer
*/ */
const FLOAT_REGEXP = '/[-+]?[0-9]*[\.,]?[0-9]+/';
/** /**
* *
...@@ -18,6 +17,7 @@ const FLOAT_REGEXP = '/[-+]?[0-9]*[\.,]?[0-9]+/'; ...@@ -18,6 +17,7 @@ const FLOAT_REGEXP = '/[-+]?[0-9]*[\.,]?[0-9]+/';
*/ */
class Piwik_MobileMessaging_ReportRenderer_Sms extends Piwik_ReportRenderer class Piwik_MobileMessaging_ReportRenderer_Sms extends Piwik_ReportRenderer
{ {
const FLOAT_REGEXP = '/[-+]?[0-9]*[\.,]?[0-9]+/';
const SMS_CONTENT_TYPE = 'text/plain'; const SMS_CONTENT_TYPE = 'text/plain';
const SMS_FILE_EXTENSION = 'sms'; const SMS_FILE_EXTENSION = 'sms';
...@@ -75,7 +75,7 @@ class Piwik_MobileMessaging_ReportRenderer_Sms extends Piwik_ReportRenderer ...@@ -75,7 +75,7 @@ class Piwik_MobileMessaging_ReportRenderer_Sms extends Piwik_ReportRenderer
'$value', '$value',
' '
return preg_replace_callback ( return preg_replace_callback (
FLOAT_REGEXP, "'.self::FLOAT_REGEXP.'",
create_function ( create_function (
\'$matches\', \'$matches\',
\'return round($matches[0]);\' \'return round($matches[0]);\'
...@@ -98,7 +98,7 @@ class Piwik_MobileMessaging_ReportRenderer_Sms extends Piwik_ReportRenderer ...@@ -98,7 +98,7 @@ class Piwik_MobileMessaging_ReportRenderer_Sms extends Piwik_ReportRenderer
create_function ( create_function (
'$value', '$value',
' '
$matched = preg_match(FLOAT_REGEXP, $value, $matches); $matched = preg_match("'.self::FLOAT_REGEXP.'", $value, $matches);
return $matched ? sprintf("%+d",$matches[0]) : $value; return $matched ? sprintf("%+d",$matches[0]) : $value;
' '
) )
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter