Skip to content

Commit a2a63d3

Browse files
committed
fix core folder with php-cs-fixer for psr-2
1 parent b2f5b54 commit a2a63d3

327 files changed

Lines changed: 689 additions & 908 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/API/ApiRenderer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ final public function __construct($request)
2828
$this->init();
2929
}
3030

31-
protected function init() {}
31+
protected function init()
32+
{
33+
}
3234

3335
abstract public function sendHeader();
3436

@@ -126,5 +128,4 @@ private static function getFormatFromClass($klassname)
126128

127129
return strtolower(end($klass));
128130
}
129-
130131
}

core/API/CORSHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ public function handle()
3838
}
3939
}
4040
}
41-
}
41+
}

core/API/DataTableGenericFilter.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Exception;
1212
use Piwik\Common;
1313
use Piwik\DataTable;
14-
use Piwik\Plugin;
1514
use Piwik\Plugin\ProcessedMetric;
1615
use Piwik\Plugin\Report;
1716

@@ -39,7 +38,7 @@ class DataTableGenericFilter
3938
*
4039
* @param $request
4140
*/
42-
function __construct($request, $report)
41+
public function __construct($request, $report)
4342
{
4443
$this->request = $request;
4544
$this->report = $report;
@@ -225,4 +224,4 @@ private function containsProcessedMetric($metrics, $name)
225224
}
226225
return false;
227226
}
228-
}
227+
}

core/API/DataTableManipulator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use Exception;
1212
use Piwik\Archive\DataTableFactory;
13-
use Piwik\Common;
1413
use Piwik\DataTable\Row;
1514
use Piwik\DataTable;
1615
use Piwik\Period\Range;
@@ -63,7 +62,7 @@ protected function manipulate($dataTable)
6362
{
6463
if ($dataTable instanceof DataTable\Map) {
6564
return $this->manipulateDataTableMap($dataTable);
66-
} else if ($dataTable instanceof DataTable) {
65+
} elseif ($dataTable instanceof DataTable) {
6766
return $this->manipulateDataTable($dataTable);
6867
} else {
6968
return $dataTable;
@@ -90,7 +89,7 @@ protected function manipulateDataTableMap($dataTable)
9089
* Manipulates a single DataTable instance. Derived classes must define
9190
* this function.
9291
*/
93-
protected abstract function manipulateDataTable($dataTable);
92+
abstract protected function manipulateDataTable($dataTable);
9493

9594
/**
9695
* Load the subtable for a row.
@@ -136,7 +135,7 @@ protected function loadSubtable($dataTable, $row)
136135
* @param $request
137136
* @return
138137
*/
139-
protected abstract function manipulateSubtableRequest($request);
138+
abstract protected function manipulateSubtableRequest($request);
140139

141140
/**
142141
* Extract the API method for loading subtables from the meta data

core/API/DataTableManipulator/ReportTotalsCalculator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use Piwik\API\DataTableManipulator;
1212
use Piwik\DataTable;
13-
use Piwik\DataTable\Row;
1413
use Piwik\Metrics;
1514
use Piwik\Period;
1615
use Piwik\Plugin\Report;
@@ -62,7 +61,7 @@ public function calculate($table)
6261

6362
try {
6463
return $this->manipulate($table);
65-
} catch(\Exception $e) {
64+
} catch (\Exception $e) {
6665
// eg. requests with idSubtable may trigger this exception
6766
// (where idSubtable was removed in
6867
// ?module=API&method=Events.getNameFromCategoryId&idSubtable=1&secondaryDimension=eventName&format=XML&idSite=1&period=day&date=yesterday&flat=0
@@ -89,7 +88,7 @@ protected function manipulateDataTable($dataTable)
8988

9089
$metricNames = array();
9190
foreach ($metricsToCalculate as $metricId) {
92-
$metricNames[$metricId] = Metrics::getReadableColumnName($metricId);;
91+
$metricNames[$metricId] = Metrics::getReadableColumnName($metricId);
9392
}
9493

9594
foreach ($firstLevelTable->getRows() as $row) {

core/API/DataTablePostProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,4 +432,4 @@ public function applyComputeProcessedMetrics(DataTableInterface $dataTable)
432432
{
433433
$dataTable->filter(array($this, 'computeProcessedMetrics'));
434434
}
435-
}
435+
}

core/API/Inconsistencies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ public function getPercentMetricsToFormat()
3939
'/goal_.*_conversion_rate/'
4040
);
4141
}
42-
}
42+
}

core/API/Proxy.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function registerClass($className)
7878
$this->checkClassIsSingleton($className);
7979

8080
$rClass = new ReflectionClass($className);
81-
if(!$this->shouldHideAPIMethod($rClass->getDocComment())) {
81+
if (!$this->shouldHideAPIMethod($rClass->getDocComment())) {
8282
foreach ($rClass->getMethods() as $method) {
8383
$this->loadMethodMetadata($className, $method);
8484
}
@@ -388,7 +388,6 @@ private function getRequestParametersArray($requiredParameters, $parametersReque
388388
$requestValue = Common::getRequestVar($name, null, null, $parametersRequest);
389389
} else {
390390
try {
391-
392391
if ($name == 'segment' && !empty($parametersRequest['segment'])) {
393392
// segment parameter is an exception: we do not want to sanitize user input or it would break the segment encoding
394393
$requestValue = ($parametersRequest['segment']);

core/API/Request.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ public function process()
238238
$returnedValue = Proxy::getInstance()->call($apiClassName, $method, $this->request);
239239

240240
$toReturn = $response->getResponse($returnedValue, $module, $method);
241-
242241
} catch (Exception $e) {
243242
Log::debug($e);
244243

core/API/ResponseBuilder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Piwik\DataTable\DataTableInterface;
1616
use Piwik\DataTable\Filter\ColumnDelete;
1717
use Piwik\DataTable\Filter\Pattern;
18-
use Piwik\Plugin\Report;
1918

2019
/**
2120
*/

0 commit comments

Comments
 (0)