diff options
author | Fabian Becker <fabian.becker@uni-tuebingen.de> | 2013-09-04 03:33:25 +0400 |
---|---|---|
committer | Fabian Becker <fabian.becker@uni-tuebingen.de> | 2013-09-04 03:33:25 +0400 |
commit | f229dbc8cc1df2fbe90bdcd5a9e7762abc5fc8ae (patch) | |
tree | 217e4a245fe559cc39c599378d2965e1a3f1ff91 /core | |
parent | e3bbc07eb21e8a2c1ea53d4ac55d94bf47214353 (diff) |
Replace create_function calls with lambda functions.
This allows the IDE to pick up all code!
refs #4113
Diffstat (limited to 'core')
-rw-r--r-- | core/DataTable/Renderer/Json.php | 6 | ||||
-rw-r--r-- | core/Piwik.php | 10 | ||||
-rw-r--r-- | core/Unzip/PclZip.php | 7 | ||||
-rw-r--r-- | core/View.php | 4 |
4 files changed, 17 insertions, 10 deletions
diff --git a/core/DataTable/Renderer/Json.php b/core/DataTable/Renderer/Json.php index f5f6fc12bb..89dd73ab37 100644 --- a/core/DataTable/Renderer/Json.php +++ b/core/DataTable/Renderer/Json.php @@ -79,7 +79,11 @@ class Json extends Renderer } // decode all entities - $callback = create_function('&$value,$key', 'if(is_string($value)){$value = html_entity_decode($value, ENT_QUOTES, "UTF-8");}'); + $callback = function(&$value,$key) { + if(is_string($value)) { + $value = html_entity_decode($value, ENT_QUOTES, "UTF-8"); + }; + }; array_walk_recursive($array, $callback); $str = Common::json_encode($array); diff --git a/core/Piwik.php b/core/Piwik.php index 97b6d47b58..96d5b6a15c 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -686,7 +686,9 @@ class Piwik $outputHandler = ini_get('output_handler'); // output handlers can be stacked - $obHandlers = array_filter(ob_list_handlers(), create_function('$var', 'return $var !== "default output handler";')); + $obHandlers = array_filter(ob_list_handlers(), function($var) { + return $var !== "default output handler"; + }); // user defined handler via wrapper $autoPrependFile = ini_get('auto_prepend_file'); @@ -2258,13 +2260,13 @@ class Piwik if (Zend_Registry::get('db')->hasBulkLoader()) { try { -// throw new Exception(''); - $fileSpec = array( 'delim' => "\t", 'quote' => '"', // chr(34) 'escape' => '\\\\', // chr(92) - 'escapespecial_cb' => create_function('$str', 'return str_replace(array(chr(92), chr(34)), array(chr(92).chr(92), chr(92).chr(34)), $str);'), + 'escapespecial_cb' => function($str) { + return str_replace(array(chr(92), chr(34)), array(chr(92).chr(92), chr(92).chr(34)), $str); + }, 'eol' => "\r\n", 'null' => 'NULL', ); diff --git a/core/Unzip/PclZip.php b/core/Unzip/PclZip.php index ad92555ab2..6b2873766e 100644 --- a/core/Unzip/PclZip.php +++ b/core/Unzip/PclZip.php @@ -76,10 +76,9 @@ class PclZip implements UncompressInterface PCLZIP_OPT_PATH, $pathExtracted, PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, - PCLZIP_CB_PRE_EXTRACT, create_function( - '$p_event, &$p_header', - "return strncmp(\$p_header['filename'], '$pathExtracted', strlen('$pathExtracted')) ? 0 : 1;" - ) + PCLZIP_CB_PRE_EXTRACT, function($p_event, &$p_header) { + return strncmp($p_header['filename'], '$pathExtracted', strlen('$pathExtracted')) ? 0 : 1; + } ); } diff --git a/core/View.php b/core/View.php index 9d221c9d9c..d137457506 100644 --- a/core/View.php +++ b/core/View.php @@ -111,7 +111,9 @@ class View implements ViewInterface $count = Piwik::getWebsitesCountToDisplay(); $sites = SitesManagerAPI::getInstance()->getSitesWithAtLeastViewAccess($count); - usort($sites, create_function('$site1, $site2', 'return strcasecmp($site1["name"], $site2["name"]);')); + usort($sites, function($site1, $site2) { + return strcasecmp($site1["name"], $site2["name"]); + }); $this->sites = $sites; $this->url = Common::sanitizeInputValue(Url::getCurrentUrl()); $this->token_auth = Piwik::getCurrentUserTokenAuth(); |