diff --git a/config/config.default.php b/config/config.default.php
index 66590ee4..f0dc2aee 100644
--- a/config/config.default.php
+++ b/config/config.default.php
@@ -102,7 +102,7 @@ return [
// Whether the DECT field should be enabled
'enable_dect' => true,
- // Enables the planned arrival/leave date
+ // Enables the planned arrival/leave date
'enable_planned_arrival' => true,
// Enables the T-Shirt configuration on signup and profile
diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php
index 773238ce..a193aff7 100644
--- a/includes/pages/admin_user.php
+++ b/includes/pages/admin_user.php
@@ -77,7 +77,7 @@ function admin_user()
// Gekommen?
$html .= '
Gekommen | ' . "\n";
- if($user_source->state->arrived) {
+ if ($user_source->state->arrived) {
$html .= _('Yes');
} else {
$html .= _('No');
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php
index a4bf4808..7b6eb9c1 100644
--- a/includes/pages/guest_login.php
+++ b/includes/pages/guest_login.php
@@ -150,7 +150,7 @@ function guest_register()
$valid = false;
error(__('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.'));
}
- } else if ($enable_planned_arrival) {
+ } elseif ($enable_planned_arrival) {
$valid = false;
error(__('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.'));
}
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index 1f3c1127..718e89c6 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -28,7 +28,7 @@ function User_settings_view(
$enable_dect = config('enable_dect');
$enable_planned_arrival = config('enable_planned_arrival');
- return page_with_title(settings_title(), [
+ return page_with_title(settings_title(), [
msg(),
div('row', [
div('col-md-6', [
diff --git a/src/Config/ConfigServiceProvider.php b/src/Config/ConfigServiceProvider.php
index cb8e96ce..2c320fdd 100644
--- a/src/Config/ConfigServiceProvider.php
+++ b/src/Config/ConfigServiceProvider.php
@@ -59,8 +59,8 @@ class ConfigServiceProvider extends ServiceProvider
/** @var Config $config */
$config = $this->app->get('config');
- /** @var EventConfig[] $values */
try {
+ /** @var EventConfig[] $values */
$values = $this->eventConfig->newQuery()->get(['name', 'value']);
} catch (QueryException $e) {
return;
diff --git a/src/Container/ServiceProvider.php b/src/Container/ServiceProvider.php
index 2a1bbebf..c9a0324e 100644
--- a/src/Container/ServiceProvider.php
+++ b/src/Container/ServiceProvider.php
@@ -22,10 +22,14 @@ abstract class ServiceProvider
/**
* Register container bindings
*/
- public function register() { }
+ public function register()
+ {
+ }
/**
* Called after other services had been registered
*/
- public function boot() { }
+ public function boot()
+ {
+ }
}
diff --git a/src/Controllers/Metrics/Controller.php b/src/Controllers/Metrics/Controller.php
index 86c21562..e0824c05 100644
--- a/src/Controllers/Metrics/Controller.php
+++ b/src/Controllers/Metrics/Controller.php
@@ -117,7 +117,7 @@ class Controller extends BaseController
'type' => 'counter',
[
'labels' => ['level' => LogLevel::EMERGENCY],
- 'value' => $this->stats->logEntries(LogLevel::EMERGENCY)
+ 'value' => $this->stats->logEntries(LogLevel::EMERGENCY),
],
['labels' => ['level' => LogLevel::ALERT], 'value' => $this->stats->logEntries(LogLevel::ALERT)],
['labels' => ['level' => LogLevel::CRITICAL], 'value' => $this->stats->logEntries(LogLevel::CRITICAL)],
@@ -132,7 +132,7 @@ class Controller extends BaseController
$data['scrape_duration_seconds'] = [
'type' => 'gauge',
'help' => 'Duration of the current request',
- microtime(true) - $this->request->server->get('REQUEST_TIME_FLOAT', $now)
+ microtime(true) - $this->request->server->get('REQUEST_TIME_FLOAT', $now),
];
return $this->response
diff --git a/src/Controllers/Metrics/MetricsEngine.php b/src/Controllers/Metrics/MetricsEngine.php
index eeb47d8a..1e0f6957 100644
--- a/src/Controllers/Metrics/MetricsEngine.php
+++ b/src/Controllers/Metrics/MetricsEngine.php
@@ -69,7 +69,8 @@ class MetricsEngine implements EngineInterface
'%s%s %s',
$name,
$this->renderLabels($row),
- $this->renderValue($row));
+ $this->renderValue($row)
+ );
}
/**
diff --git a/src/Controllers/Metrics/Stats.php b/src/Controllers/Metrics/Stats.php
index c841be10..a2b37d0c 100644
--- a/src/Controllers/Metrics/Stats.php
+++ b/src/Controllers/Metrics/Stats.php
@@ -27,6 +27,7 @@ class Stats
*/
public function arrivedUsers($working = null): int
{
+ /** @var QueryBuilder $query */
$query = $this
->getQuery('users')
->join('users_state', 'user_id', '=', 'id')
@@ -40,7 +41,6 @@ class Stats
->distinct();
$query->where(function ($query) use ($working) {
- /** @var QueryBuilder $query */
if ($working) {
$query
->whereNotNull('ShiftEntry.SID')
diff --git a/src/Database/Migration/Migrate.php b/src/Database/Migration/Migrate.php
index 4e238152..c8ee9456 100644
--- a/src/Database/Migration/Migrate.php
+++ b/src/Database/Migration/Migrate.php
@@ -36,7 +36,8 @@ class Migrate
{
$this->app = $app;
$this->schema = $schema;
- $this->output = function () { };
+ $this->output = function () {
+ };
}
/**
diff --git a/src/Exceptions/Handlers/Legacy.php b/src/Exceptions/Handlers/Legacy.php
index 39683f72..461dabe1 100644
--- a/src/Exceptions/Handlers/Legacy.php
+++ b/src/Exceptions/Handlers/Legacy.php
@@ -21,7 +21,8 @@ class Legacy implements HandlerInterface
*/
public function report(Throwable $e)
{
- error_log(sprintf('Exception: Code: %s, Message: %s, File: %s:%u, Trace: %s',
+ error_log(sprintf(
+ 'Exception: Code: %s, Message: %s, File: %s:%u, Trace: %s',
$e->getCode(),
$e->getMessage(),
$this->stripBasePath($e->getFile()),
diff --git a/src/Exceptions/Handlers/LegacyDevelopment.php b/src/Exceptions/Handlers/LegacyDevelopment.php
index 86f86f4c..cfa4efa4 100644
--- a/src/Exceptions/Handlers/LegacyDevelopment.php
+++ b/src/Exceptions/Handlers/LegacyDevelopment.php
@@ -48,7 +48,7 @@ class LegacyDevelopment extends Legacy
$return[] = [
'file' => $path . ':' . $line,
- $functionName => isset($trace['args']) ? $trace['args'] : null,
+ $functionName => $trace['args'] ?? null,
];
}
diff --git a/src/Http/Exceptions/HttpException.php b/src/Http/Exceptions/HttpException.php
index 07853d1e..6efc2fad 100644
--- a/src/Http/Exceptions/HttpException.php
+++ b/src/Http/Exceptions/HttpException.php
@@ -48,4 +48,4 @@ class HttpException extends RuntimeException
{
return $this->statusCode;
}
-}
\ No newline at end of file
+}
diff --git a/src/Http/MessageTrait.php b/src/Http/MessageTrait.php
index 17fbf5db..0b12ce61 100644
--- a/src/Http/MessageTrait.php
+++ b/src/Http/MessageTrait.php
@@ -2,7 +2,6 @@
namespace Engelsystem\Http;
-
use Nyholm\Psr7\Stream;
use Psr\Http\Message\StreamInterface;
diff --git a/src/Http/Psr7ServiceProvider.php b/src/Http/Psr7ServiceProvider.php
index a9194272..d58ee6e9 100644
--- a/src/Http/Psr7ServiceProvider.php
+++ b/src/Http/Psr7ServiceProvider.php
@@ -13,7 +13,6 @@ use Psr\Http\Message\UploadedFileFactoryInterface;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface;
-
class Psr7ServiceProvider extends ServiceProvider
{
public function register()
diff --git a/src/Http/Request.php b/src/Http/Request.php
index 8b5abf2f..0e1acf76 100644
--- a/src/Http/Request.php
+++ b/src/Http/Request.php
@@ -328,9 +328,8 @@ class Request extends SymfonyRequest implements ServerRequestInterface
public function getUploadedFiles()
{
$files = [];
+ /** @var SymfonyFile $file */
foreach ($this->files as $file) {
- /** @var SymfonyFile $file */
-
$files[] = new UploadedFile(
$file->getRealPath(),
$file->getSize(),
diff --git a/src/Http/UrlGenerator.php b/src/Http/UrlGenerator.php
index 7ced769e..d84a02b5 100644
--- a/src/Http/UrlGenerator.php
+++ b/src/Http/UrlGenerator.php
@@ -4,7 +4,7 @@ namespace Engelsystem\Http;
/**
* Provides urls when rewriting on the webserver is enabled. (default)
- *
+ *
* The urls have the form /?
*/
class UrlGenerator implements UrlGeneratorInterface
diff --git a/src/Logger/EngelsystemLogger.php b/src/Logger/EngelsystemLogger.php
index aab8026a..aead90fb 100644
--- a/src/Logger/EngelsystemLogger.php
+++ b/src/Logger/EngelsystemLogger.php
@@ -23,6 +23,11 @@ class EngelsystemLogger extends AbstractLogger
/** @var LogEntry */
protected $log;
+ /**
+ * EngelsystemLogger constructor.
+ *
+ * @param LogEntry $log
+ */
public function __construct(LogEntry $log)
{
$this->log = $log;
diff --git a/src/Mail/Transport/Transport.php b/src/Mail/Transport/Transport.php
index 691faf60..b83620a6 100644
--- a/src/Mail/Transport/Transport.php
+++ b/src/Mail/Transport/Transport.php
@@ -21,12 +21,16 @@ abstract class Transport implements SwiftTransport
/**
* Start this Transport mechanism.
*/
- public function start() { }
+ public function start()
+ {
+ }
/**
* Stop this Transport mechanism.
*/
- public function stop() { }
+ public function stop()
+ {
+ }
/**
* Check if this Transport mechanism is alive.
@@ -59,7 +63,9 @@ abstract class Transport implements SwiftTransport
*
* @param Swift_Events_EventListener $plugin
*/
- public function registerPlugin(Swift_Events_EventListener $plugin) { }
+ public function registerPlugin(Swift_Events_EventListener $plugin)
+ {
+ }
/**
* Returns a unified list of all recipients
diff --git a/src/Middleware/LegacyMiddleware.php b/src/Middleware/LegacyMiddleware.php
index 0aca3813..2467f25c 100644
--- a/src/Middleware/LegacyMiddleware.php
+++ b/src/Middleware/LegacyMiddleware.php
@@ -29,7 +29,7 @@ class LegacyMiddleware implements MiddlewareInterface
'users',
'user_driver_licenses',
'user_password_recovery',
- 'user_worklog'
+ 'user_worklog',
];
/** @var ContainerInterface */
diff --git a/tests/Feature/Logger/EngelsystemLoggerTest.php b/tests/Feature/Logger/EngelsystemLoggerTest.php
index 89f62765..358b20f1 100644
--- a/tests/Feature/Logger/EngelsystemLoggerTest.php
+++ b/tests/Feature/Logger/EngelsystemLoggerTest.php
@@ -13,7 +13,6 @@ use stdClass;
class EngelsystemLoggerTest extends ApplicationFeatureTest
{
/**
- * @covers \Engelsystem\Logger\EngelsystemLogger::__construct
* @return LoggerInterface
*/
public function getLogger()
diff --git a/tests/Unit/ApplicationTest.php b/tests/Unit/ApplicationTest.php
index a57488d0..e466ecd7 100644
--- a/tests/Unit/ApplicationTest.php
+++ b/tests/Unit/ApplicationTest.php
@@ -34,9 +34,9 @@ class ApplicationTest extends TestCase
}
/**
- * @covers \Engelsystem\Application::setAppPath
- * @covers \Engelsystem\Application::registerPaths
* @covers \Engelsystem\Application::path
+ * @covers \Engelsystem\Application::registerPaths
+ * @covers \Engelsystem\Application::setAppPath
*/
public function testAppPath()
{
@@ -125,8 +125,8 @@ class ApplicationTest extends TestCase
/**
* @covers \Engelsystem\Application::bootstrap
- * @covers \Engelsystem\Application::isBooted
* @covers \Engelsystem\Application::getMiddleware
+ * @covers \Engelsystem\Application::isBooted
*/
public function testBootstrap()
{
diff --git a/tests/Unit/Config/ConfigServiceProviderTest.php b/tests/Unit/Config/ConfigServiceProviderTest.php
index 895496b8..62a662f8 100644
--- a/tests/Unit/Config/ConfigServiceProviderTest.php
+++ b/tests/Unit/Config/ConfigServiceProviderTest.php
@@ -18,8 +18,8 @@ class ConfigServiceProviderTest extends ServiceProviderTest
use ArraySubsetAsserts;
/**
- * @covers \Engelsystem\Config\ConfigServiceProvider::register
* @covers \Engelsystem\Config\ConfigServiceProvider::getConfigPath
+ * @covers \Engelsystem\Config\ConfigServiceProvider::register
*/
public function testRegister()
{
diff --git a/tests/Unit/Container/Stub/ServiceProviderImplementation.php b/tests/Unit/Container/Stub/ServiceProviderImplementation.php
index 36ae2c38..34311003 100644
--- a/tests/Unit/Container/Stub/ServiceProviderImplementation.php
+++ b/tests/Unit/Container/Stub/ServiceProviderImplementation.php
@@ -6,5 +6,4 @@ use Engelsystem\Container\ServiceProvider;
class ServiceProviderImplementation extends ServiceProvider
{
-
}
diff --git a/tests/Unit/Controllers/Metrics/ControllerTest.php b/tests/Unit/Controllers/Metrics/ControllerTest.php
index 56415e23..381e00f2 100644
--- a/tests/Unit/Controllers/Metrics/ControllerTest.php
+++ b/tests/Unit/Controllers/Metrics/ControllerTest.php
@@ -127,8 +127,8 @@ class ControllerTest extends TestCase
}
/**
- * @covers \Engelsystem\Controllers\Metrics\Controller::stats
* @covers \Engelsystem\Controllers\Metrics\Controller::checkAuth
+ * @covers \Engelsystem\Controllers\Metrics\Controller::stats
*/
public function testStats()
{
@@ -149,7 +149,7 @@ class ControllerTest extends TestCase
'user_count' => 13,
'arrived_user_count' => 10,
'done_work_hours' => 99,
- 'users_in_action' => 5
+ 'users_in_action' => 5,
]))
->willReturn($response);
@@ -213,6 +213,6 @@ class ControllerTest extends TestCase
$stats = $this->createMock(Stats::class);
$config = new Config();
- return array($response, $request, $engine, $stats, $config);
+ return [$response, $request, $engine, $stats, $config];
}
}
diff --git a/tests/Unit/Controllers/Metrics/MetricsEngineTest.php b/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
index b810b10a..38817b36 100644
--- a/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
+++ b/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
@@ -8,12 +8,12 @@ use Engelsystem\Test\Unit\TestCase;
class MetricsEngineTest extends TestCase
{
/**
- * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::get
+ * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::escape
* @covers \Engelsystem\Controllers\Metrics\MetricsEngine::formatData
+ * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::formatValue
+ * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::get
* @covers \Engelsystem\Controllers\Metrics\MetricsEngine::renderLabels
* @covers \Engelsystem\Controllers\Metrics\MetricsEngine::renderValue
- * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::formatValue
- * @covers \Engelsystem\Controllers\Metrics\MetricsEngine::escape
*/
public function testGet()
{
@@ -30,13 +30,13 @@ class MetricsEngineTest extends TestCase
$this->assertEquals(
'engelsystem_foo{lorem="ip\\\\sum"} \\"lorem\\n\\\\ipsum\\"',
$engine->get('/metrics', [
- 'foo' => ['labels' => ['lorem' => 'ip\\sum'], 'value' => "\"lorem\n\\ipsum\""]
+ 'foo' => ['labels' => ['lorem' => 'ip\\sum'], 'value' => "\"lorem\n\\ipsum\""],
])
);
$this->assertEquals(
'engelsystem_foo_count{bar="14"} 42',
- $engine->get('/metrics', ['foo_count' => ['labels' => ['bar' => 14], 'value' => 42],])
+ $engine->get('/metrics', ['foo_count' => ['labels' => ['bar' => 14], 'value' => 42]])
);
$this->assertEquals(
diff --git a/tests/Unit/Controllers/Metrics/StatsTest.php b/tests/Unit/Controllers/Metrics/StatsTest.php
index 8dc7459e..9ecd4a66 100644
--- a/tests/Unit/Controllers/Metrics/StatsTest.php
+++ b/tests/Unit/Controllers/Metrics/StatsTest.php
@@ -20,9 +20,9 @@ class StatsTest extends TestCase
use HasDatabase;
/**
- * @covers \Engelsystem\Controllers\Metrics\Stats::newUsers
- * @covers \Engelsystem\Controllers\Metrics\Stats::getQuery
* @covers \Engelsystem\Controllers\Metrics\Stats::__construct
+ * @covers \Engelsystem\Controllers\Metrics\Stats::getQuery
+ * @covers \Engelsystem\Controllers\Metrics\Stats::newUsers
*/
public function testNewUsers()
{
@@ -58,8 +58,8 @@ class StatsTest extends TestCase
}
/**
- * @covers \Engelsystem\Controllers\Metrics\Stats::tshirtSizes
* @covers \Engelsystem\Controllers\Metrics\Stats::raw
+ * @covers \Engelsystem\Controllers\Metrics\Stats::tshirtSizes
*/
public function testTshirtSizes()
{
diff --git a/tests/Unit/Database/DatabaseServiceProviderTest.php b/tests/Unit/Database/DatabaseServiceProviderTest.php
index c9c6f9e3..c3e4c5d0 100644
--- a/tests/Unit/Database/DatabaseServiceProviderTest.php
+++ b/tests/Unit/Database/DatabaseServiceProviderTest.php
@@ -30,7 +30,7 @@ class DatabaseServiceProviderTest extends ServiceProviderTest
list($app, $dbManager, $pdo, $database, $connection) = $this->prepare(
[
'driver' => 'sqlite',
- 'database' => ':memory:'
+ 'database' => ':memory:',
]
);
@@ -51,8 +51,8 @@ class DatabaseServiceProviderTest extends ServiceProviderTest
}
/**
- * @covers \Engelsystem\Database\DatabaseServiceProvider::register()
* @covers \Engelsystem\Database\DatabaseServiceProvider::exitOnError()
+ * @covers \Engelsystem\Database\DatabaseServiceProvider::register()
*/
public function testRegisterError()
{
diff --git a/tests/Unit/Database/DatabaseTest.php b/tests/Unit/Database/DatabaseTest.php
index 7aef51c3..c1f1a717 100644
--- a/tests/Unit/Database/DatabaseTest.php
+++ b/tests/Unit/Database/DatabaseTest.php
@@ -16,8 +16,8 @@ class DatabaseTest extends TestCase
/**
* @covers \Engelsystem\Database\Database::__construct()
- * @covers \Engelsystem\Database\Database::getPdo()
* @covers \Engelsystem\Database\Database::getConnection()
+ * @covers \Engelsystem\Database\Database::getPdo()
*/
public function testInit()
{
@@ -129,7 +129,8 @@ class DatabaseTest extends TestCase
id INT PRIMARY KEY NOT NULL,
data TEXT NOT NULL
);
- ');
+ '
+ );
$connection->statement('CREATE UNIQUE INDEX test_data_id_uindex ON test_data (id);');
$connection->insert("
INSERT INTO test_data (id, data)
diff --git a/tests/Unit/Database/DbTest.php b/tests/Unit/Database/DbTest.php
index a408f78f..09930c4f 100644
--- a/tests/Unit/Database/DbTest.php
+++ b/tests/Unit/Database/DbTest.php
@@ -12,8 +12,8 @@ use PHPUnit\Framework\TestCase;
class DbTest extends TestCase
{
/**
- * @covers \Engelsystem\Database\Db::setDbManager()
* @covers \Engelsystem\Database\Db::connection()
+ * @covers \Engelsystem\Database\Db::setDbManager()
*/
public function testSetDbManager()
{
@@ -132,7 +132,8 @@ class DbTest extends TestCase
id INT PRIMARY KEY NOT NULL,
data TEXT NOT NULL
);
- ');
+ '
+ );
Db::connection()->statement('CREATE UNIQUE INDEX test_data_id_uindex ON test_data (id);');
Db::insert("
INSERT INTO test_data (id, data)
diff --git a/tests/Unit/Database/Migration/MigrateTest.php b/tests/Unit/Database/Migration/MigrateTest.php
index 6dffbe2f..b1954fab 100644
--- a/tests/Unit/Database/Migration/MigrateTest.php
+++ b/tests/Unit/Database/Migration/MigrateTest.php
@@ -15,8 +15,8 @@ class MigrateTest extends TestCase
{
/**
* @covers \Engelsystem\Database\Migration\Migrate::__construct
- * @covers \Engelsystem\Database\Migration\Migrate::run
* @covers \Engelsystem\Database\Migration\Migrate::getMigrations
+ * @covers \Engelsystem\Database\Migration\Migrate::run
* @covers \Engelsystem\Database\Migration\Migrate::setOutput
*/
public function testRun()
@@ -112,11 +112,11 @@ class MigrateTest extends TestCase
/**
* @covers \Engelsystem\Database\Migration\Migrate::getMigrated
+ * @covers \Engelsystem\Database\Migration\Migrate::getMigrationFiles
+ * @covers \Engelsystem\Database\Migration\Migrate::getTableQuery
+ * @covers \Engelsystem\Database\Migration\Migrate::initMigration
* @covers \Engelsystem\Database\Migration\Migrate::migrate
* @covers \Engelsystem\Database\Migration\Migrate::setMigrated
- * @covers \Engelsystem\Database\Migration\Migrate::getMigrationFiles
- * @covers \Engelsystem\Database\Migration\Migrate::initMigration
- * @covers \Engelsystem\Database\Migration\Migrate::getTableQuery
*/
public function testRunIntegration()
{
diff --git a/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php b/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
index b484f41f..c0569086 100644
--- a/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
+++ b/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
@@ -15,9 +15,9 @@ use PHPUnit\Framework\MockObject\MockObject;
class ExceptionsServiceProviderTest extends ServiceProviderTest
{
/**
- * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::register()
- * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::addProductionHandler()
* @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::addDevelopmentHandler()
+ * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::addProductionHandler()
+ * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::register()
*/
public function testRegister()
{
diff --git a/tests/Unit/Exceptions/HandlerTest.php b/tests/Unit/Exceptions/HandlerTest.php
index af89dae7..baf2de82 100644
--- a/tests/Unit/Exceptions/HandlerTest.php
+++ b/tests/Unit/Exceptions/HandlerTest.php
@@ -99,8 +99,8 @@ class HandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Exceptions\Handler::setEnvironment()
* @covers \Engelsystem\Exceptions\Handler::getEnvironment()
+ * @covers \Engelsystem\Exceptions\Handler::setEnvironment()
*/
public function testEnvironment()
{
@@ -114,8 +114,8 @@ class HandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Exceptions\Handler::setHandler()
* @covers \Engelsystem\Exceptions\Handler::getHandler()
+ * @covers \Engelsystem\Exceptions\Handler::setHandler()
*/
public function testHandler()
{
@@ -133,8 +133,8 @@ class HandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Exceptions\Handler::setRequest()
* @covers \Engelsystem\Exceptions\Handler::getRequest()
+ * @covers \Engelsystem\Exceptions\Handler::setRequest()
*/
public function testRequest()
{
diff --git a/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php b/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
index bc4625e9..f7355f76 100644
--- a/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
+++ b/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
@@ -2,7 +2,6 @@
namespace Engelsystem\Test\Unit\Exceptions\handlers;
-
use Engelsystem\Exceptions\Handlers\LegacyDevelopment;
use Engelsystem\Http\Request;
use ErrorException;
@@ -12,8 +11,8 @@ use PHPUnit\Framework\TestCase;
class LegacyDevelopmentTest extends TestCase
{
/**
- * @covers \Engelsystem\Exceptions\Handlers\LegacyDevelopment::render()
* @covers \Engelsystem\Exceptions\Handlers\LegacyDevelopment::formatStackTrace()
+ * @covers \Engelsystem\Exceptions\Handlers\LegacyDevelopment::render()
*/
public function testRender()
{
diff --git a/tests/Unit/Exceptions/Handlers/LegacyTest.php b/tests/Unit/Exceptions/Handlers/LegacyTest.php
index d7d65daf..d8ab6565 100644
--- a/tests/Unit/Exceptions/Handlers/LegacyTest.php
+++ b/tests/Unit/Exceptions/Handlers/LegacyTest.php
@@ -2,7 +2,6 @@
namespace Engelsystem\Test\Unit\Exceptions\handlers;
-
use Engelsystem\Exceptions\Handlers\Legacy;
use Engelsystem\Http\Request;
use Exception;
diff --git a/tests/Unit/Exceptions/Handlers/WhoopsTest.php b/tests/Unit/Exceptions/Handlers/WhoopsTest.php
index 74bdc457..67029d4d 100644
--- a/tests/Unit/Exceptions/Handlers/WhoopsTest.php
+++ b/tests/Unit/Exceptions/Handlers/WhoopsTest.php
@@ -2,7 +2,6 @@
namespace Engelsystem\Test\Unit\Exceptions\handlers;
-
use Engelsystem\Application;
use Engelsystem\Exceptions\Handlers\Whoops;
use Engelsystem\Helpers\Authenticator;
diff --git a/tests/Unit/Helpers/TranslationServiceProviderTest.php b/tests/Unit/Helpers/TranslationServiceProviderTest.php
index c5ba7386..41c08aa5 100644
--- a/tests/Unit/Helpers/TranslationServiceProviderTest.php
+++ b/tests/Unit/Helpers/TranslationServiceProviderTest.php
@@ -67,7 +67,7 @@ class TranslationServiceProviderTest extends ServiceProviderTest
[
'locale' => $locale,
'locales' => $locales,
- 'localeChangeCallback' => [$serviceProvider, 'setLocale']
+ 'localeChangeCallback' => [$serviceProvider, 'setLocale'],
]
)
->willReturn($translator);
@@ -82,5 +82,3 @@ class TranslationServiceProviderTest extends ServiceProviderTest
$serviceProvider->register();
}
}
-
-
diff --git a/tests/Unit/Helpers/TranslatorTest.php b/tests/Unit/Helpers/TranslatorTest.php
index 34050e42..45ca769b 100644
--- a/tests/Unit/Helpers/TranslatorTest.php
+++ b/tests/Unit/Helpers/TranslatorTest.php
@@ -11,11 +11,11 @@ class TranslatorTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Helpers\Translator::__construct
- * @covers \Engelsystem\Helpers\Translator::setLocale
- * @covers \Engelsystem\Helpers\Translator::setLocales
* @covers \Engelsystem\Helpers\Translator::getLocale
* @covers \Engelsystem\Helpers\Translator::getLocales
* @covers \Engelsystem\Helpers\Translator::hasLocale
+ * @covers \Engelsystem\Helpers\Translator::setLocale
+ * @covers \Engelsystem\Helpers\Translator::setLocales
*/
public function testInit()
{
@@ -47,8 +47,8 @@ class TranslatorTest extends ServiceProviderTest
}
/**
- * @covers \Engelsystem\Helpers\Translator::translate
* @covers \Engelsystem\Helpers\Translator::replaceText
+ * @covers \Engelsystem\Helpers\Translator::translate
*/
public function testTranslate()
{
@@ -88,5 +88,3 @@ class TranslatorTest extends ServiceProviderTest
$this->assertEquals('2 Äpfel', $return);
}
}
-
-
diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php
index 210e995e..6d182907 100644
--- a/tests/Unit/HelpersTest.php
+++ b/tests/Unit/HelpersTest.php
@@ -174,7 +174,7 @@ class HelpersTest extends TestCase
->withConsecutive(['lor', 'em'], ['foo', 'bar'])
->willReturn($response);
- $this->assertEquals($response, response('Lorem Ipsum?', 501, ['lor' => 'em', 'foo' => 'bar',]));
+ $this->assertEquals($response, response('Lorem Ipsum?', 501, ['lor' => 'em', 'foo' => 'bar']));
}
/**
@@ -285,6 +285,7 @@ class HelpersTest extends TestCase
*/
protected function getAppMock($alias, $object)
{
+ /** @var Application|MockObject $appMock */
$appMock = $this->getMockBuilder(Container::class)
->getMock();
@@ -293,7 +294,6 @@ class HelpersTest extends TestCase
->with($alias)
->willReturn($object);
- /** @var $appMock Application */
Application::setInstance($appMock);
return $appMock;
diff --git a/tests/Unit/Http/Exceptions/HttpExceptionTest.php b/tests/Unit/Http/Exceptions/HttpExceptionTest.php
index ce2b064d..6ab56d62 100644
--- a/tests/Unit/Http/Exceptions/HttpExceptionTest.php
+++ b/tests/Unit/Http/Exceptions/HttpExceptionTest.php
@@ -9,8 +9,8 @@ class HttpExceptionTest extends TestCase
{
/**
* @covers \Engelsystem\Http\Exceptions\HttpException::__construct
- * @covers \Engelsystem\Http\Exceptions\HttpException::getStatusCode
* @covers \Engelsystem\Http\Exceptions\HttpException::getHeaders
+ * @covers \Engelsystem\Http\Exceptions\HttpException::getStatusCode
*/
public function testConstruct()
{
diff --git a/tests/Unit/Http/LegacyUrlGeneratorTest.php b/tests/Unit/Http/LegacyUrlGeneratorTest.php
index 2c087f8f..8caf3c77 100644
--- a/tests/Unit/Http/LegacyUrlGeneratorTest.php
+++ b/tests/Unit/Http/LegacyUrlGeneratorTest.php
@@ -4,8 +4,8 @@ namespace Engelsystem\Test\Unit\Http;
use Engelsystem\Application;
use Engelsystem\Container\Container;
-use Engelsystem\Http\Request;
use Engelsystem\Http\LegacyUrlGenerator;
+use Engelsystem\Http\Request;
use Engelsystem\Http\UrlGeneratorInterface;
use PHPUnit\Framework\TestCase;
diff --git a/tests/Unit/Http/RequestTest.php b/tests/Unit/Http/RequestTest.php
index 26bf0116..4d942311 100644
--- a/tests/Unit/Http/RequestTest.php
+++ b/tests/Unit/Http/RequestTest.php
@@ -163,7 +163,7 @@ class RequestTest extends TestCase
[
'*',
'/foo/bar',
- 'https://lorem.ipsum/test?lor=em'
+ 'https://lorem.ipsum/test?lor=em',
] as $target
) {
$new = $request->withRequestTarget($target);
diff --git a/tests/Unit/Http/ResponseTest.php b/tests/Unit/Http/ResponseTest.php
index 6f57e1db..6f20ff67 100644
--- a/tests/Unit/Http/ResponseTest.php
+++ b/tests/Unit/Http/ResponseTest.php
@@ -26,8 +26,8 @@ class ResponseTest extends TestCase
}
/**
- * @covers \Engelsystem\Http\Response::withStatus
* @covers \Engelsystem\Http\Response::getReasonPhrase
+ * @covers \Engelsystem\Http\Response::withStatus
*/
public function testWithStatus()
{
@@ -85,4 +85,4 @@ class ResponseTest extends TestCase
$response = new Response();
$response->withView('foo');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php b/tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php
index 61ab982d..14f23c00 100644
--- a/tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php
+++ b/tests/Unit/Http/SessionHandlers/DatabaseHandlerTest.php
@@ -12,8 +12,8 @@ class DatabaseHandlerTest extends TestCase
/**
* @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::__construct
- * @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::read
* @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::getQuery
+ * @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::read
*/
public function testRead()
{
@@ -25,8 +25,8 @@ class DatabaseHandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::write
* @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::getCurrentTimestamp
+ * @covers \Engelsystem\Http\SessionHandlers\DatabaseHandler::write
*/
public function testWrite()
{
diff --git a/tests/Unit/Http/SessionServiceProviderTest.php b/tests/Unit/Http/SessionServiceProviderTest.php
index 204cfe1e..08f1945a 100644
--- a/tests/Unit/Http/SessionServiceProviderTest.php
+++ b/tests/Unit/Http/SessionServiceProviderTest.php
@@ -17,8 +17,8 @@ use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface as
class SessionServiceProviderTest extends ServiceProviderTest
{
/**
- * @covers \Engelsystem\Http\SessionServiceProvider::register()
* @covers \Engelsystem\Http\SessionServiceProvider::getSessionStorage()
+ * @covers \Engelsystem\Http\SessionServiceProvider::register()
*/
public function testRegister()
{
@@ -53,13 +53,13 @@ class SessionServiceProviderTest extends ServiceProviderTest
[Session::class],
[
NativeSessionStorage::class,
- ['options' => ['cookie_httponly' => true, 'name' => 'session'], 'handler' => null]
+ ['options' => ['cookie_httponly' => true, 'name' => 'session'], 'handler' => null],
],
[Session::class],
[DatabaseHandler::class],
[
NativeSessionStorage::class,
- ['options' => ['cookie_httponly' => true, 'name' => 'foobar'], 'handler' => $databaseHandler]
+ ['options' => ['cookie_httponly' => true, 'name' => 'foobar'], 'handler' => $databaseHandler],
],
[Session::class]
)
diff --git a/tests/Unit/Mail/EngelsystemMailerTest.php b/tests/Unit/Mail/EngelsystemMailerTest.php
index 0f60ff3b..12dc3b0b 100644
--- a/tests/Unit/Mail/EngelsystemMailerTest.php
+++ b/tests/Unit/Mail/EngelsystemMailerTest.php
@@ -40,9 +40,9 @@ class EngelsystemMailerTest extends TestCase
}
/**
+ * @covers \Engelsystem\Mail\EngelsystemMailer::getSubjectPrefix
* @covers \Engelsystem\Mail\EngelsystemMailer::send
* @covers \Engelsystem\Mail\EngelsystemMailer::setSubjectPrefix
- * @covers \Engelsystem\Mail\EngelsystemMailer::getSubjectPrefix
*/
public function testSend()
{
diff --git a/tests/Unit/Mail/MailerServiceProviderTest.php b/tests/Unit/Mail/MailerServiceProviderTest.php
index 793cd1f2..f0e1775f 100644
--- a/tests/Unit/Mail/MailerServiceProviderTest.php
+++ b/tests/Unit/Mail/MailerServiceProviderTest.php
@@ -79,7 +79,7 @@ class MailerServiceProviderTest extends ServiceProviderTest
[SendmailTransport::class, ['email' => ['driver' => 'sendmail']]],
[
SmtpTransport::class,
- $this->smtpConfig
+ $this->smtpConfig,
],
];
}
diff --git a/tests/Unit/Mail/MailerTest.php b/tests/Unit/Mail/MailerTest.php
index 24c6f69a..bfecdd07 100644
--- a/tests/Unit/Mail/MailerTest.php
+++ b/tests/Unit/Mail/MailerTest.php
@@ -13,8 +13,8 @@ class MailerTest extends TestCase
/**
* @covers \Engelsystem\Mail\Mailer::__construct
* @covers \Engelsystem\Mail\Mailer::getFromAddress
- * @covers \Engelsystem\Mail\Mailer::setFromAddress
* @covers \Engelsystem\Mail\Mailer::getFromName
+ * @covers \Engelsystem\Mail\Mailer::setFromAddress
* @covers \Engelsystem\Mail\Mailer::setFromName
*/
public function testInitAndSettersAndGetters()
diff --git a/tests/Unit/Mail/Transport/TransportTest.php b/tests/Unit/Mail/Transport/TransportTest.php
index 5e7b7b9b..ac7735bb 100644
--- a/tests/Unit/Mail/Transport/TransportTest.php
+++ b/tests/Unit/Mail/Transport/TransportTest.php
@@ -70,8 +70,8 @@ class TransportTest extends TestCase
}
/**
- * @covers \Engelsystem\Mail\Transport\Transport::getTo
* @covers \Engelsystem\Mail\Transport\Transport::formatTo
+ * @covers \Engelsystem\Mail\Transport\Transport::getTo
*/
public function testGetTo()
{
diff --git a/tests/Unit/Middleware/CallableHandlerTest.php b/tests/Unit/Middleware/CallableHandlerTest.php
index a0dbfce8..d59be60d 100644
--- a/tests/Unit/Middleware/CallableHandlerTest.php
+++ b/tests/Unit/Middleware/CallableHandlerTest.php
@@ -6,6 +6,7 @@ use Engelsystem\Container\Container;
use Engelsystem\Http\Response;
use Engelsystem\Middleware\CallableHandler;
use Engelsystem\Test\Unit\Middleware\Stub\HasStaticMethod;
+use InvalidArgumentException;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseInterface;
@@ -18,7 +19,8 @@ class CallableHandlerTest extends TestCase
public function provideCallable()
{
return [
- [function () { }],
+ [function () {
+ }],
[[$this, 'provideCallable']],
[[HasStaticMethod::class, 'foo']],
];
@@ -113,7 +115,7 @@ class CallableHandlerTest extends TestCase
$this->assertEquals($response, $return);
$middleware = new CallableHandler($callable);
- $this->expectException(\InvalidArgumentException::class);
+ $this->expectException(InvalidArgumentException::class);
$middleware->handle($request);
}
diff --git a/tests/Unit/Middleware/RequestHandlerTest.php b/tests/Unit/Middleware/RequestHandlerTest.php
index 7ff803d0..8b943d71 100644
--- a/tests/Unit/Middleware/RequestHandlerTest.php
+++ b/tests/Unit/Middleware/RequestHandlerTest.php
@@ -136,8 +136,8 @@ class RequestHandlerTest extends TestCase
}
/**
- * @covers \Engelsystem\Middleware\RequestHandler::process
* @covers \Engelsystem\Middleware\RequestHandler::checkPermissions
+ * @covers \Engelsystem\Middleware\RequestHandler::process
*/
public function testCheckPermissions()
{
diff --git a/tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php b/tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php
index 320a6d6b..7cd4d9d3 100644
--- a/tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php
+++ b/tests/Unit/Middleware/ResolvesMiddlewareTraitTest.php
@@ -14,8 +14,8 @@ use Psr\Http\Server\MiddlewareInterface;
class ResolvesMiddlewareTraitTest extends TestCase
{
/**
- * @covers \Engelsystem\Middleware\ResolvesMiddlewareTrait::resolveMiddleware
* @covers \Engelsystem\Middleware\ResolvesMiddlewareTrait::isMiddleware
+ * @covers \Engelsystem\Middleware\ResolvesMiddlewareTrait::resolveMiddleware
*/
public function testResolveMiddleware()
{
diff --git a/tests/Unit/Middleware/RouteDispatcherTest.php b/tests/Unit/Middleware/RouteDispatcherTest.php
index d6ed3408..d35c0f6b 100644
--- a/tests/Unit/Middleware/RouteDispatcherTest.php
+++ b/tests/Unit/Middleware/RouteDispatcherTest.php
@@ -16,8 +16,8 @@ use Psr\Http\Server\RequestHandlerInterface;
class RouteDispatcherTest extends TestCase
{
/**
- * @covers \Engelsystem\Middleware\RouteDispatcher::process
* @covers \Engelsystem\Middleware\RouteDispatcher::__construct
+ * @covers \Engelsystem\Middleware\RouteDispatcher::process
*/
public function testProcess()
{
diff --git a/tests/Unit/Middleware/Stub/HasStaticMethod.php b/tests/Unit/Middleware/Stub/HasStaticMethod.php
index 5ca2670e..329e1248 100644
--- a/tests/Unit/Middleware/Stub/HasStaticMethod.php
+++ b/tests/Unit/Middleware/Stub/HasStaticMethod.php
@@ -4,5 +4,7 @@ namespace Engelsystem\Test\Unit\Middleware\Stub;
class HasStaticMethod
{
- public static function foo() { }
+ public static function foo()
+ {
+ }
}
diff --git a/tests/Unit/Middleware/VerifyCsrfTokenTest.php b/tests/Unit/Middleware/VerifyCsrfTokenTest.php
index 636e1f81..cd593106 100644
--- a/tests/Unit/Middleware/VerifyCsrfTokenTest.php
+++ b/tests/Unit/Middleware/VerifyCsrfTokenTest.php
@@ -14,8 +14,8 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
class VerifyCsrfTokenTest extends TestCase
{
/**
- * @covers \Engelsystem\Middleware\VerifyCsrfToken::process
* @covers \Engelsystem\Middleware\VerifyCsrfToken::isReading
+ * @covers \Engelsystem\Middleware\VerifyCsrfToken::process
*/
public function testProcess()
{
diff --git a/tests/Unit/Models/EventConfigTest.php b/tests/Unit/Models/EventConfigTest.php
index 5a0286b5..e2ab5d10 100644
--- a/tests/Unit/Models/EventConfigTest.php
+++ b/tests/Unit/Models/EventConfigTest.php
@@ -102,8 +102,7 @@ class EventConfigTest extends TestCase
*/
protected function getEventConfig()
{
- return new class extends EventConfig
- {
+ return new class extends EventConfig {
/**
* @param string $value
* @param string $type
diff --git a/tests/Unit/Models/User/Stub/HasUserModelImplementation.php b/tests/Unit/Models/User/Stub/HasUserModelImplementation.php
index 0456eb6a..6d442bdd 100644
--- a/tests/Unit/Models/User/Stub/HasUserModelImplementation.php
+++ b/tests/Unit/Models/User/Stub/HasUserModelImplementation.php
@@ -6,5 +6,4 @@ use Engelsystem\Models\User\HasUserModel;
class HasUserModelImplementation extends HasUserModel
{
-
}
diff --git a/tests/Unit/Models/User/UserTest.php b/tests/Unit/Models/User/UserTest.php
index 478c02dd..0e17d137 100644
--- a/tests/Unit/Models/User/UserTest.php
+++ b/tests/Unit/Models/User/UserTest.php
@@ -37,14 +37,14 @@ class UserTest extends TestCase
'dect' => '1234567',
'email' => 'foo@bar.batz',
'mobile' => '1234/12341234',
- ]
+ ],
],
[
PersonalData::class,
'personalData',
[
- 'first_name' => 'Foo'
- ]
+ 'first_name' => 'Foo',
+ ],
],
[
Settings::class,
@@ -52,14 +52,14 @@ class UserTest extends TestCase
[
'language' => 'de_DE',
'theme' => 4,
- ]
+ ],
],
[
State::class,
'state',
[
'force_active' => true,
- ]
+ ],
],
];
}
diff --git a/tests/Unit/Renderer/RendererServiceProviderTest.php b/tests/Unit/Renderer/RendererServiceProviderTest.php
index 36263b0c..224e36d4 100644
--- a/tests/Unit/Renderer/RendererServiceProviderTest.php
+++ b/tests/Unit/Renderer/RendererServiceProviderTest.php
@@ -13,8 +13,8 @@ class RendererServiceProviderTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Renderer\RendererServiceProvider::register()
- * @covers \Engelsystem\Renderer\RendererServiceProvider::registerRenderer()
* @covers \Engelsystem\Renderer\RendererServiceProvider::registerHtmlEngine()
+ * @covers \Engelsystem\Renderer\RendererServiceProvider::registerRenderer()
*/
public function testRegister()
{
diff --git a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
index eb78e1ab..2f64360e 100644
--- a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
+++ b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
@@ -39,6 +39,7 @@ abstract class ExtensionTest extends TestCase
* @param string $name
* @param callable $callback
* @param TwigFunction[] $functions
+ * @param array $options
*/
protected function assertExtensionExists($name, $callback, $functions, $options = [])
{
diff --git a/tests/Unit/Renderer/Twig/Extensions/LegacyTest.php b/tests/Unit/Renderer/Twig/Extensions/LegacyTest.php
index 613af0da..b6c19d14 100644
--- a/tests/Unit/Renderer/Twig/Extensions/LegacyTest.php
+++ b/tests/Unit/Renderer/Twig/Extensions/LegacyTest.php
@@ -29,8 +29,8 @@ class LegacyTest extends ExtensionTest
}
/**
- * @covers \Engelsystem\Renderer\Twig\Extensions\Legacy::getPage
* @covers \Engelsystem\Renderer\Twig\Extensions\Legacy::__construct
+ * @covers \Engelsystem\Renderer\Twig\Extensions\Legacy::getPage
*/
public function testIsAuthenticated()
{
diff --git a/tests/Unit/ServiceProviderTest.php b/tests/Unit/ServiceProviderTest.php
index 27929fc7..bf9f5e3f 100644
--- a/tests/Unit/ServiceProviderTest.php
+++ b/tests/Unit/ServiceProviderTest.php
@@ -13,7 +13,6 @@ abstract class ServiceProviderTest extends TestCase
*/
protected function getApp($methods = ['make', 'instance'])
{
- /** @var Application|MockObject $app */
return $this->getMockBuilder(Application::class)
->setMethods($methods)
->getMock();
diff --git a/tests/autoload.php b/tests/autoload.php
index 3168ce3d..62589e16 100644
--- a/tests/autoload.php
+++ b/tests/autoload.php
@@ -4,5 +4,5 @@ use Composer\Autoload\ClassLoader;
require_once __DIR__ . '/../includes/autoload.php';
-/** @var $loader ClassLoader */
+/** @var ClassLoader $loader */
$loader->addPsr4('Engelsystem\\Test\\', __DIR__ . '/');
|