Skip to content

Commit

Permalink
Fixes PSR test
Browse files Browse the repository at this point in the history
  • Loading branch information
AltamashShaikh committed Oct 17, 2024
1 parent 75cbc51 commit f06f639
Show file tree
Hide file tree
Showing 26 changed files with 62 additions and 54 deletions.
2 changes: 1 addition & 1 deletion API.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -94,5 +95,4 @@ public function getLogConfig()

return Config::getInstance()->log;
}

}
1 change: 1 addition & 0 deletions Controller.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
2 changes: 1 addition & 1 deletion Log/Line.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand All @@ -16,5 +17,4 @@ public function __construct($content)
{
$this->content = $content;
}

}
1 change: 1 addition & 0 deletions Log/Log.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions Log/Parser.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
2 changes: 1 addition & 1 deletion Log/Parser/Piwik.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -52,5 +53,4 @@ private function removeForumMessageIfPresent($message)

return $message;
}

}
1 change: 1 addition & 0 deletions Log/Query.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
2 changes: 1 addition & 1 deletion Log/Reader.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand All @@ -18,5 +19,4 @@ interface Reader
* @return Line|null Returns next log line or null if end of log
*/
public function nextLine();

}
3 changes: 1 addition & 2 deletions Log/Reader/Database.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -71,7 +72,5 @@ private function fetchLines()
}

return $lines;

}

}
1 change: 1 addition & 0 deletions Log/Reader/File.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions Log/Result.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions LogReaderFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions LogViewer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
1 change: 1 addition & 0 deletions Menu.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down
70 changes: 35 additions & 35 deletions tests/Fixtures/EmptySite.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<?php

/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\LogViewer\tests\Fixtures;

use Piwik\Tests\Framework\Fixture;

/**
* Fixture that adds one site with no visits
*/
class EmptySite extends Fixture
{
public $idSite = 1;
public function setUp(): void
{
Fixture::createSuperUser();
$this->setUpWebsites();
}
public function tearDown(): void
{
// empty
}
private function setUpWebsites()
{
if (!self::siteCreated($idSite = 1)) {
self::createWebsite('2021-01-01');
}
}
}
<?php

/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

namespace Piwik\Plugins\LogViewer\tests\Fixtures;

use Piwik\Tests\Framework\Fixture;

/**
* Fixture that adds one site with no visits
*/
class EmptySite extends Fixture
{
public $idSite = 1;
public function setUp(): void
{
Fixture::createSuperUser();
$this->setUpWebsites();
}
public function tearDown(): void
{
// empty
}
private function setUpWebsites()
{
if (!self::siteCreated($idSite = 1)) {
self::createWebsite('2021-01-01');
}
}
}
2 changes: 1 addition & 1 deletion tests/Framework/TestCase/IntegrationTestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -38,5 +39,4 @@ protected function setLogWriters($writer)
$log['log_writers'] = $writer;
Config::getInstance()->log = $log;
}

}
2 changes: 1 addition & 1 deletion tests/Integration/ApiTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -127,5 +128,4 @@ public function provideContainerConfig()
'Piwik\Access' => new FakeAccess()
);
}

}
3 changes: 1 addition & 2 deletions tests/Integration/Log/Reader/DatabaseTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -92,6 +93,4 @@ private function createLogEntry($message, $time, $severity = 'DEBUG', $tag = '2c

Db::query($sql, array($tag, $time, $severity, $message));
}


}
2 changes: 1 addition & 1 deletion tests/Integration/Log/Reader/FileTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -67,5 +68,4 @@ private function createFile($path)
{
return new File($path);
}

}
2 changes: 1 addition & 1 deletion tests/Integration/LogReaderFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -118,5 +119,4 @@ public function provideContainerConfig()
'log.file.filename' => PIWIK_INCLUDE_PATH . '/plugins/LogViewer/tests/resources/piwik.log'
);
}

}
4 changes: 2 additions & 2 deletions tests/System/ApiTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -68,5 +69,4 @@ public static function provideContainerConfigBeforeClass()
'log.file.filename' => PIWIK_INCLUDE_PATH . '/plugins/LogViewer/tests/resources/piwik.log'
);
}

}
}
3 changes: 2 additions & 1 deletion tests/System/CheckDirectDependencyUseCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Piwik - free/libre analytics platform
*
Expand Down Expand Up @@ -44,4 +45,4 @@ public function testCommand()
],
], $checkDirectDependencyUse->usesFoundList[$pluginName]);
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/Log/LineTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand All @@ -23,5 +24,4 @@ public function test__construct_shouldSaveContentInProperty()
$line = new Line('MyTestMessage');
$this->assertSame('MyTestMessage', $line->content);
}

}
2 changes: 1 addition & 1 deletion tests/Unit/Log/Parser/PiwikTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -65,5 +66,4 @@ private function buildParsed($message = '', $severity = '', $tag = '', $datetime
'message' => $message,
);
}

}
2 changes: 1 addition & 1 deletion tests/Unit/Log/QueryTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -60,5 +61,4 @@ private function buildQuery($query)
{
return new Query($query);
}

}
2 changes: 1 addition & 1 deletion tests/Unit/Log/ResultTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Matomo - free/libre analytics platform
*
Expand Down Expand Up @@ -119,5 +120,4 @@ private function buildResult($limitPerPage, $page)
{
return new Result($limitPerPage, $page);
}

}

0 comments on commit f06f639

Please sign in to comment.