Skip to content
Extraits de code Groupes Projets
Valider f6de9efc rédigé par Christian Raue's avatar Christian Raue
Parcourir les fichiers

removed unused variables

parent b51cad91
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 17 ajouts et 23 suppressions
...@@ -79,9 +79,8 @@ class DocumentationGenerator ...@@ -79,9 +79,8 @@ class DocumentationGenerator
if ($exampleUrl !== false) { if ($exampleUrl !== false) {
$lastNUrls = ''; $lastNUrls = '';
if (preg_match('/(&period)|(&date)/', $exampleUrl)) { if (preg_match('/(&period)|(&date)/', $exampleUrl)) {
$exampleUrlRss1 = $prefixUrls . $this->getExampleUrl($class, $methodName, array('date' => 'last10', 'period' => 'day') + $parametersToSet); $exampleUrlRss = $prefixUrls . $this->getExampleUrl($class, $methodName, array('date' => 'last10', 'period' => 'day') + $parametersToSet);
$exampleUrlRss2 = $prefixUrls . $this->getExampleUrl($class, $methodName, array('date' => 'last5', 'period' => 'week',) + $parametersToSet); $lastNUrls = ", RSS of the last <a target=_blank href='$exampleUrlRss&format=rss$token_auth&translateColumnNames=1'>10 days</a>";
$lastNUrls = ", RSS of the last <a target=_blank href='$exampleUrlRss1&format=rss$token_auth&translateColumnNames=1'>10 days</a>";
} }
$exampleUrl = $prefixUrls . $exampleUrl; $exampleUrl = $prefixUrls . $exampleUrl;
$str .= " [ Example in $str .= " [ Example in
......
...@@ -400,7 +400,7 @@ class ResponseBuilder ...@@ -400,7 +400,7 @@ class ResponseBuilder
$first = reset($array); $first = reset($array);
foreach ($array as $first) { foreach ($array as $first) {
if (is_array($first)) { if (is_array($first)) {
foreach ($first as $key => $value) { foreach ($first as $value) {
// Yes, this is a multi dim array // Yes, this is a multi dim array
if (is_array($value)) { if (is_array($value)) {
switch ($this->outputFormat) { switch ($this->outputFormat) {
......
...@@ -1169,7 +1169,7 @@ class CronArchive ...@@ -1169,7 +1169,7 @@ class CronArchive
private function logFatalErrorUrlExpected() private function logFatalErrorUrlExpected()
{ {
$this->logFatalError("./console core:archive expects the argument 'url' to be set to your Piwik URL, for example: --url=http://example.org/piwik/ " $this->logFatalError("./console core:archive expects the argument 'url' to be set to your Piwik URL, for example: --url=http://example.org/piwik/ "
. "\n--help for more information", $backtrace = false); . "\n--help for more information");
} }
private function getVisitsLastPeriodFromApiResponse($stats) private function getVisitsLastPeriodFromApiResponse($stats)
......
...@@ -662,7 +662,7 @@ class LogAggregator ...@@ -662,7 +662,7 @@ class LogAggregator
protected function getActionsMetricFields() protected function getActionsMetricFields()
{ {
return $availableMetrics = array( return array(
Metrics::INDEX_NB_VISITS => "count(distinct " . self::LOG_ACTIONS_TABLE . ".idvisit)", Metrics::INDEX_NB_VISITS => "count(distinct " . self::LOG_ACTIONS_TABLE . ".idvisit)",
Metrics::INDEX_NB_UNIQ_VISITORS => "count(distinct " . self::LOG_ACTIONS_TABLE . ".idvisitor)", Metrics::INDEX_NB_UNIQ_VISITORS => "count(distinct " . self::LOG_ACTIONS_TABLE . ".idvisitor)",
Metrics::INDEX_NB_ACTIONS => "count(*)", Metrics::INDEX_NB_ACTIONS => "count(*)",
......
...@@ -332,7 +332,7 @@ class DataArray ...@@ -332,7 +332,7 @@ class DataArray
*/ */
protected function enrichWithConversions(&$data) protected function enrichWithConversions(&$data)
{ {
foreach ($data as $label => &$values) { foreach ($data as &$values) {
if (!isset($values[Metrics::INDEX_GOALS])) { if (!isset($values[Metrics::INDEX_GOALS])) {
continue; continue;
} }
......
...@@ -1026,7 +1026,6 @@ class DataTable implements DataTableInterface ...@@ -1026,7 +1026,6 @@ class DataTable implements DataTableInterface
public static function isEqual(DataTable $table1, DataTable $table2) public static function isEqual(DataTable $table1, DataTable $table2)
{ {
$rows1 = $table1->getRows(); $rows1 = $table1->getRows();
$rows2 = $table2->getRows();
$table1->rebuildIndex(); $table1->rebuildIndex();
$table2->rebuildIndex(); $table2->rebuildIndex();
......
...@@ -75,7 +75,7 @@ class ColumnCallbackAddColumnQuotient extends BaseFilter ...@@ -75,7 +75,7 @@ class ColumnCallbackAddColumnQuotient extends BaseFilter
*/ */
public function filter($table) public function filter($table)
{ {
foreach ($table->getRows() as $key => $row) { foreach ($table->getRows() as $row) {
$value = $this->getDividend($row); $value = $this->getDividend($row);
if ($value === false && $this->shouldSkipRows) { if ($value === false && $this->shouldSkipRows) {
continue; continue;
......
...@@ -72,7 +72,7 @@ class ColumnCallbackReplace extends BaseFilter ...@@ -72,7 +72,7 @@ class ColumnCallbackReplace extends BaseFilter
*/ */
public function filter($table) public function filter($table)
{ {
foreach ($table->getRows() as $key => $row) { foreach ($table->getRows() as $row) {
$extraColumnParameters = array(); $extraColumnParameters = array();
foreach ($this->extraColumnParameters as $columnName) { foreach ($this->extraColumnParameters as $columnName) {
$extraColumnParameters[] = $row->getColumn($columnName); $extraColumnParameters[] = $row->getColumn($columnName);
......
...@@ -81,7 +81,7 @@ class ReplaceColumnNames extends BaseFilter ...@@ -81,7 +81,7 @@ class ReplaceColumnNames extends BaseFilter
*/ */
protected function filterTable($table) protected function filterTable($table)
{ {
foreach ($table->getRows() as $key => $row) { foreach ($table->getRows() as $row) {
$oldColumns = $row->getColumns(); $oldColumns = $row->getColumns();
$newColumns = $this->getRenamedColumns($oldColumns); $newColumns = $this->getRenamedColumns($oldColumns);
$row->setColumns($newColumns); $row->setColumns($newColumns);
......
...@@ -104,7 +104,7 @@ class Map implements DataTableInterface ...@@ -104,7 +104,7 @@ class Map implements DataTableInterface
*/ */
public function filter($className, $parameters = array()) public function filter($className, $parameters = array())
{ {
foreach ($this->getDataTables() as $id => $table) { foreach ($this->getDataTables() as $table) {
$table->filter($className, $parameters); $table->filter($className, $parameters);
} }
} }
......
...@@ -184,7 +184,6 @@ class Rss extends Renderer ...@@ -184,7 +184,6 @@ class Rss extends Renderer
} }
} }
$html .= "\n</tr>"; $html .= "\n</tr>";
$colspan = count($allColumns);
foreach ($tableStructure as $row) { foreach ($tableStructure as $row) {
$html .= "\n\n<tr>"; $html .= "\n\n<tr>";
......
...@@ -373,7 +373,7 @@ class Xml extends Renderer ...@@ -373,7 +373,7 @@ class Xml extends Renderer
// Handing case idgoal=7, creating a new array for that one // Handing case idgoal=7, creating a new array for that one
$rowAttribute = ''; $rowAttribute = '';
if (($equalFound = strstr($rowId, '=')) !== false) { if (strstr($rowId, '=') !== false) {
$rowAttribute = explode('=', $rowId); $rowAttribute = explode('=', $rowId);
$rowAttribute = " " . $rowAttribute[0] . "='" . $rowAttribute[1] . "'"; $rowAttribute = " " . $rowAttribute[0] . "='" . $rowAttribute[1] . "'";
} }
......
...@@ -390,7 +390,7 @@ class FrontController extends Singleton ...@@ -390,7 +390,7 @@ class FrontController extends Singleton
// ensure the current Piwik URL is known for later use // ensure the current Piwik URL is known for later use
if (method_exists('Piwik\SettingsPiwik', 'getPiwikUrl')) { if (method_exists('Piwik\SettingsPiwik', 'getPiwikUrl')) {
$host = SettingsPiwik::getPiwikUrl(); SettingsPiwik::getPiwikUrl();
} }
/** /**
...@@ -419,7 +419,7 @@ class FrontController extends Singleton ...@@ -419,7 +419,7 @@ class FrontController extends Singleton
// Force the auth to use the token_auth if specified, so that embed dashboard // Force the auth to use the token_auth if specified, so that embed dashboard
// and all other non widgetized controller methods works fine // and all other non widgetized controller methods works fine
if (($token_auth = Common::getRequestVar('token_auth', false, 'string')) !== false) { if (Common::getRequestVar('token_auth', false, 'string') !== false) {
Request::reloadAuthUsingTokenAuth(); Request::reloadAuthUsingTokenAuth();
} }
SettingsServer::raiseMemoryLimitIfNecessary(); SettingsServer::raiseMemoryLimitIfNecessary();
......
...@@ -170,9 +170,8 @@ class IP ...@@ -170,9 +170,8 @@ class IP
*/ */
public static function isIPv4($ip) public static function isIPv4($ip)
{ {
// in case mbstring overloads strlen and substr functions // in case mbstring overloads strlen function
$strlen = function_exists('mb_orig_strlen') ? 'mb_orig_strlen' : 'strlen'; $strlen = function_exists('mb_orig_strlen') ? 'mb_orig_strlen' : 'strlen';
$substr = function_exists('mb_orig_substr') ? 'mb_orig_substr' : 'substr';
// IPv4 // IPv4
if ($strlen($ip) == 4) { if ($strlen($ip) == 4) {
......
...@@ -63,7 +63,7 @@ class SegmentExpression ...@@ -63,7 +63,7 @@ class SegmentExpression
public function parseSubExpressions() public function parseSubExpressions()
{ {
$parsedSubExpressions = array(); $parsedSubExpressions = array();
foreach ($this->tree as $id => $leaf) { foreach ($this->tree as $leaf) {
$operand = $leaf[self::INDEX_OPERAND]; $operand = $leaf[self::INDEX_OPERAND];
$operand = urldecode($operand); $operand = urldecode($operand);
...@@ -339,7 +339,6 @@ class SegmentExpression ...@@ -339,7 +339,6 @@ class SegmentExpression
if (count($this->tree) == 0) { if (count($this->tree) == 0) {
throw new Exception("Invalid segment, please specify a valid segment."); throw new Exception("Invalid segment, please specify a valid segment.");
} }
$bind = array();
$sql = ''; $sql = '';
$subExpression = false; $subExpression = false;
foreach ($this->tree as $expression) { foreach ($this->tree as $expression) {
......
...@@ -411,8 +411,8 @@ class Tracker ...@@ -411,8 +411,8 @@ class Tracker
require_once PIWIK_INCLUDE_PATH . '/core/Loader.php'; require_once PIWIK_INCLUDE_PATH . '/core/Loader.php';
require_once PIWIK_INCLUDE_PATH . '/core/Option.php'; require_once PIWIK_INCLUDE_PATH . '/core/Option.php';
$access = Access::getInstance(); Access::getInstance();
$config = Config::getInstance(); Config::getInstance();
try { try {
Db::get(); Db::get();
......
...@@ -136,7 +136,6 @@ class UIControl extends \Piwik\View ...@@ -136,7 +136,6 @@ class UIControl extends \Piwik\View
} }
$this->templateVars['clientSideParameters'] = array(); $this->templateVars['clientSideParameters'] = array();
$clientSideParameters = $this->getClientSideParameters();
foreach ($this->getClientSideParameters() as $name) { foreach ($this->getClientSideParameters() as $name) {
$this->templateVars['clientSideParameters'][$name] = $innerTemplateVars[$name]; $this->templateVars['clientSideParameters'][$name] = $innerTemplateVars[$name];
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter