Set native return types

Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
Michael Weimann 2022-12-14 19:15:20 +01:00
parent 2b88322c0c
commit aff8826c99
No known key found for this signature in database
GPG Key ID: 34F0524D4DA694A1
386 changed files with 1038 additions and 2008 deletions

View File

@ -27,5 +27,9 @@
<exclude-pattern>/includes</exclude-pattern>
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude-pattern>/includes</exclude-pattern>
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
</rule>
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />
</ruleset>

View File

@ -17,7 +17,7 @@ $route->get('/logout', 'AuthController@logout');
// OAuth
$route->addGroup(
'/oauth/{provider}',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'OAuthController@index');
$route->post('/connect', 'OAuthController@connect');
$route->post('/disconnect', 'OAuthController@disconnect');
@ -27,7 +27,7 @@ $route->addGroup(
// User settings
$route->addGroup(
'/settings',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('/profile', 'SettingsController@profile');
$route->post('/profile', 'SettingsController@saveProfile');
$route->get('/password', 'SettingsController@password');
@ -43,7 +43,7 @@ $route->addGroup(
// Password recovery
$route->addGroup(
'/password/reset',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'PasswordResetController@reset');
$route->post('', 'PasswordResetController@postReset');
$route->get('/{token:.+}', 'PasswordResetController@resetPassword');
@ -59,7 +59,7 @@ $route->get('/stats', 'Metrics\\Controller@stats');
$route->get('/meetings', 'NewsController@meetings');
$route->addGroup(
'/news',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'NewsController@index');
$route->get('/{news_id:\d+}', 'NewsController@show');
$route->post('/{news_id:\d+}', 'NewsController@comment');
@ -73,7 +73,7 @@ $route->get('/faq', 'FaqController@index');
// Questions
$route->addGroup(
'/questions',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'QuestionsController@index');
$route->post('', 'QuestionsController@delete');
$route->get('/new', 'QuestionsController@add');
@ -84,7 +84,7 @@ $route->addGroup(
// Messages
$route->addGroup(
'/messages',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'MessagesController@index');
$route->post('', 'MessagesController@redirectToConversation');
$route->get('/{user_id:\d+}', 'MessagesController@messagesOfConversation');
@ -102,11 +102,11 @@ $route->get('/design', 'DesignController@index');
// Administration
$route->addGroup(
'/admin',
function (RouteCollector $route) {
function (RouteCollector $route): void {
// FAQ
$route->addGroup(
'/faq',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('[/{faq_id:\d+}]', 'Admin\\FaqController@edit');
$route->post('[/{faq_id:\d+}]', 'Admin\\FaqController@save');
}
@ -115,7 +115,7 @@ $route->addGroup(
// Log
$route->addGroup(
'/logs',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'Admin\\LogsController@index');
$route->post('', 'Admin\\LogsController@index');
}
@ -124,7 +124,7 @@ $route->addGroup(
// Schedule
$route->addGroup(
'/schedule',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'Admin\\Schedule\\ImportSchedule@index');
$route->get('/edit[/{schedule_id:\d+}]', 'Admin\\Schedule\\ImportSchedule@edit');
$route->post('/edit[/{schedule_id:\d+}]', 'Admin\\Schedule\\ImportSchedule@save');
@ -136,7 +136,7 @@ $route->addGroup(
// Questions
$route->addGroup(
'/questions',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'Admin\\QuestionsController@index');
$route->post('', 'Admin\\QuestionsController@delete');
$route->get('/{question_id:\d+}', 'Admin\\QuestionsController@edit');
@ -147,11 +147,11 @@ $route->addGroup(
// User
$route->addGroup(
'/user/{user_id:\d+}',
function (RouteCollector $route) {
function (RouteCollector $route): void {
// Shirts
$route->addGroup(
'/shirt',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('', 'Admin\\UserShirtController@editShirt');
$route->post('', 'Admin\\UserShirtController@saveShirt');
}
@ -160,7 +160,7 @@ $route->addGroup(
// Worklogs
$route->addGroup(
'/worklog',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('[/{worklog_id:\d+}]', 'Admin\\UserWorkLogController@editWorklog');
$route->post('[/{worklog_id:\d+}]', 'Admin\\UserWorkLogController@saveWorklog');
$route->get(
@ -179,7 +179,7 @@ $route->addGroup(
// News
$route->addGroup(
'/news',
function (RouteCollector $route) {
function (RouteCollector $route): void {
$route->get('[/{news_id:\d+}]', 'Admin\\NewsController@edit');
$route->post('[/{news_id:\d+}]', 'Admin\\NewsController@save');
}

View File

@ -13,7 +13,7 @@ class FaqFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'question' => $this->faker->text(100),

View File

@ -13,7 +13,7 @@ class GroupFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->unique()->word(),

View File

@ -14,7 +14,7 @@ class MessageFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'user_id' => User::factory(),

View File

@ -15,7 +15,7 @@ class NewsCommentFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'news_id' => News::factory(),

View File

@ -14,7 +14,7 @@ class NewsFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'title' => $this->faker->text(50),

View File

@ -13,7 +13,7 @@ class PrivilegeFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->unique()->word(),

View File

@ -15,7 +15,7 @@ class QuestionFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'user_id' => User::factory(),

View File

@ -13,7 +13,7 @@ class RoomFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->unique()->firstName(),

View File

@ -13,7 +13,7 @@ class ScheduleFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->unique()->words(4, true),

View File

@ -13,7 +13,7 @@ class ContactFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'dect' => $this->faker->optional()->numberBetween(1000, 9999),

View File

@ -13,7 +13,7 @@ class LicenseFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
$drive_car = $this->faker->boolean(.8);
$drive_3_5t = $drive_car && $this->faker->boolean(.7);

View File

@ -13,7 +13,7 @@ class PasswordResetFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'token' => bin2hex(random_bytes(16)),

View File

@ -14,7 +14,7 @@ class PersonalDataFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
$arrival = $this->faker->optional()->dateTimeThisMonth('2 weeks');
$departure = $this->faker->optional()->dateTimeThisMonth('2 weeks');

View File

@ -13,7 +13,7 @@ class SettingsFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'language' => $this->faker->locale(),

View File

@ -14,7 +14,7 @@ class StateFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
$arrival = $this->faker->optional()->dateTimeThisMonth();
@ -31,9 +31,8 @@ class StateFactory extends Factory
/**
* Indicate that the user is arrived
*
* @return self
*/
public function arrived()
public function arrived(): self
{
return $this->state(
function (array $attributes) {

View File

@ -13,7 +13,7 @@ class UserFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->unique()->userName(),

View File

@ -14,7 +14,7 @@ class WorklogFactory extends Factory
/**
* @return array
*/
public function definition()
public function definition(): array
{
return [
'user_id' => User::factory(),

View File

@ -31,7 +31,7 @@ class ImportInstallSql extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
foreach ($this->oldTables as $table) {
if ($this->schema->hasTable($table)) {
@ -47,7 +47,7 @@ class ImportInstallSql extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->getConnection()->statement('SET FOREIGN_KEY_CHECKS=0;');

View File

@ -9,7 +9,7 @@ class ImportUpdateSql extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if ($this->schema->hasTable('UserWorkLog')) {
return;
@ -22,7 +22,7 @@ class ImportUpdateSql extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->dropIfExists('UserWorkLog');
}

View File

@ -10,7 +10,7 @@ class FixOldTables extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$connection = $this->schema->getConnection();
@ -29,7 +29,7 @@ class FixOldTables extends Migration
->where($column, '<', '0001-01-01 00:00:00')
->update([$column => '0001-01-01 00:00:00']);
$this->schema->table($table, function (Blueprint $table) use ($column) {
$this->schema->table($table, function (Blueprint $table) use ($column): void {
$table->dateTime($column)->default('0001-01-01 00:00:00')->change();
});
}
@ -38,7 +38,7 @@ class FixOldTables extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
}
}

View File

@ -9,7 +9,7 @@ class CleanupGroupPrivileges extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('GroupPrivileges')) {
return;
@ -43,7 +43,7 @@ class CleanupGroupPrivileges extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('GroupPrivileges')) {
return;

View File

@ -15,7 +15,7 @@ class AddAngelSupporterPermissions extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('GroupPrivileges')) {
return;
@ -39,7 +39,7 @@ class AddAngelSupporterPermissions extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('GroupPrivileges')) {
return;
@ -52,10 +52,7 @@ class AddAngelSupporterPermissions extends Migration
);
}
/**
* @return string
*/
protected function getQuery(string $type)
protected function getQuery(string $type): string
{
return sprintf('
%s FROM GroupPrivileges

View File

@ -10,9 +10,9 @@ class CreateLogEntriesTable extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->create('log_entries', function (Blueprint $table) {
$this->schema->create('log_entries', function (Blueprint $table): void {
$table->increments('id');
$table->string('level', 20);
$table->text('message');
@ -32,9 +32,9 @@ class CreateLogEntriesTable extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->create('LogEntries', function (Blueprint $table) {
$this->schema->create('LogEntries', function (Blueprint $table): void {
$table->increments('id');
$table->string('level', 20);
$table->text('message');

View File

@ -10,9 +10,9 @@ class CreateSessionsTable extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->create('sessions', function (Blueprint $table) {
$this->schema->create('sessions', function (Blueprint $table): void {
$table->string('id')->unique();
$table->text('payload');
$table->dateTime('last_activity')->useCurrent();
@ -22,7 +22,7 @@ class CreateSessionsTable extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->dropIfExists('sessions');
}

View File

@ -20,11 +20,11 @@ class CreateEventConfigTable extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
foreach (['json', 'text'] as $type) {
try {
$this->schema->create('event_config', function (Blueprint $table) use ($type) {
$this->schema->create('event_config', function (Blueprint $table) use ($type): void {
$table->string('name')->index()->unique();
$table->{$type}('value');
$table->timestamps();
@ -69,11 +69,11 @@ class CreateEventConfigTable extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$connection = $this->schema->getConnection();
$this->schema->create('EventConfig', function (Blueprint $table) {
$this->schema->create('EventConfig', function (Blueprint $table): void {
$table->string('event_name')->nullable();
$table->integer('buildup_start_date')->nullable();
$table->integer('event_start_date')->nullable();
@ -112,10 +112,7 @@ class CreateEventConfigTable extends Migration
$this->schema->dropIfExists('event_config');
}
/**
* @return mixed|null
*/
protected function getConfigValue(Collection $config, string $name)
protected function getConfigValue(Collection $config, string $name): mixed
{
$value = $config->where('name', $name)->first('value', (object)['value' => null])->value;

View File

@ -15,9 +15,9 @@ class CreateUsersTables extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->create('users', function (Blueprint $table) {
$this->schema->create('users', function (Blueprint $table): void {
$table->increments('id');
$table->string('name', 24)->unique();
@ -29,7 +29,7 @@ class CreateUsersTables extends Migration
$table->timestamps();
});
$this->schema->create('users_personal_data', function (Blueprint $table) {
$this->schema->create('users_personal_data', function (Blueprint $table): void {
$this->referencesUser($table, true);
$table->string('first_name', 64)->nullable();
@ -40,7 +40,7 @@ class CreateUsersTables extends Migration
$table->date('planned_departure_date')->nullable();
});
$this->schema->create('users_contact', function (Blueprint $table) {
$this->schema->create('users_contact', function (Blueprint $table): void {
$this->referencesUser($table, true);
$table->string('dect', 5)->nullable();
@ -48,7 +48,7 @@ class CreateUsersTables extends Migration
$table->string('email', 254)->nullable();
});
$this->schema->create('users_settings', function (Blueprint $table) {
$this->schema->create('users_settings', function (Blueprint $table): void {
$this->referencesUser($table, true);
$table->string('language', 64);
@ -57,7 +57,7 @@ class CreateUsersTables extends Migration
$table->boolean('email_shiftinfo')->default(false);
});
$this->schema->create('users_state', function (Blueprint $table) {
$this->schema->create('users_state', function (Blueprint $table): void {
$this->referencesUser($table, true);
$table->boolean('arrived')->default(false);
@ -68,7 +68,7 @@ class CreateUsersTables extends Migration
$table->integer('got_voucher')->default(0);
});
$this->schema->create('password_resets', function (Blueprint $table) {
$this->schema->create('password_resets', function (Blueprint $table): void {
$this->referencesUser($table, true);
$table->text('token');
@ -155,11 +155,11 @@ class CreateUsersTables extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$connection = $this->schema->getConnection();
$this->schema->create('User', function (Blueprint $table) {
$this->schema->create('User', function (Blueprint $table): void {
$table->integer('UID', true);
$table->string('Nick', 23)->unique()->default('');

View File

@ -16,7 +16,7 @@ class ChangeUsersContactDectFieldSize extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->changeDectTo(40);
}
@ -24,19 +24,19 @@ class ChangeUsersContactDectFieldSize extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->changeDectTo(5);
}
protected function changeDectTo(int $length)
protected function changeDectTo(int $length): void
{
foreach ($this->tables as $table => $column) {
if (!$this->schema->hasTable($table)) {
continue;
}
$this->schema->table($table, function (Blueprint $table) use ($column, $length) {
$this->schema->table($table, function (Blueprint $table) use ($column, $length): void {
$table->string($column, $length)->change();
});
}

View File

@ -10,7 +10,7 @@ class FixMissingArrivalDates extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$connection = $this->schema->getConnection();
@ -36,7 +36,7 @@ class FixMissingArrivalDates extends Migration
/**
* Down is not possible and not needed since this is a bugfix.
*/
public function down()
public function down(): void
{
}
}

View File

@ -9,7 +9,7 @@ class FixUserLanguages extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$connection = $this->schema->getConnection();
$connection
@ -22,7 +22,7 @@ class FixUserLanguages extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$connection = $this->schema->getConnection();
$connection

View File

@ -9,7 +9,7 @@ class MigrateAdminSchedulePermissions extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('Privileges')) {
return;
@ -29,7 +29,7 @@ class MigrateAdminSchedulePermissions extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('Privileges')) {
return;

View File

@ -12,11 +12,11 @@ class CreateScheduleShiftTable extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->create(
'schedules',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->increments('id');
$table->string('url');
}
@ -24,7 +24,7 @@ class CreateScheduleShiftTable extends Migration
$this->schema->create(
'schedule_shift',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->integer('shift_id')->index()->unique();
if ($this->schema->hasTable('Shifts')) {
// Legacy table access
@ -42,7 +42,7 @@ class CreateScheduleShiftTable extends Migration
if ($this->schema->hasTable('Shifts')) {
$this->schema->table(
'Shifts',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('PSID');
}
);
@ -51,7 +51,7 @@ class CreateScheduleShiftTable extends Migration
if ($this->schema->hasTable('Room')) {
$this->schema->table(
'Room',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('from_frab');
}
);
@ -61,12 +61,12 @@ class CreateScheduleShiftTable extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if ($this->schema->hasTable('Room')) {
$this->schema->table(
'Room',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->boolean('from_frab')
->default(false);
}
@ -76,7 +76,7 @@ class CreateScheduleShiftTable extends Migration
if ($this->schema->hasTable('Shifts')) {
$this->schema->table(
'Shifts',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->integer('PSID')
->nullable()->default(null)
->unique();

View File

@ -64,12 +64,9 @@ class CreateNewsTable extends Migration
$this->schema->drop('new_news');
}
/**
* @return void
*/
private function createNewNewsTable(): void
{
$this->schema->create('news', function (Blueprint $table) {
$this->schema->create('news', function (Blueprint $table): void {
$table->increments('id');
$table->string('title', 150);
$table->text('text');
@ -79,9 +76,6 @@ class CreateNewsTable extends Migration
});
}
/**
* @return void
*/
private function copyPreviousToNewNewsTable(): void
{
$connection = $this->schema->getConnection();
@ -104,12 +98,9 @@ class CreateNewsTable extends Migration
}
}
/**
* @return void
*/
private function createPreviousNewsTable(): void
{
$this->schema->create('News', function (Blueprint $table) {
$this->schema->create('News', function (Blueprint $table): void {
$table->increments('ID');
$table->integer('Datum');
$table->string('Betreff', 150)
@ -120,9 +111,6 @@ class CreateNewsTable extends Migration
});
}
/**
* @return void
*/
private function copyNewToPreviousNewsTable(): void
{
$connection = $this->schema->getConnection();

View File

@ -53,12 +53,9 @@ class CreateNewsCommentsTable extends Migration
$this->schema->drop('news_comments');
}
/**
* @return void
*/
private function createNewNewsCommentsTable(): void
{
$this->schema->create('news_comments', function (Blueprint $table) {
$this->schema->create('news_comments', function (Blueprint $table): void {
$table->increments('id');
$this->references($table, 'news', 'news_id');
$table->text('text');
@ -67,9 +64,6 @@ class CreateNewsCommentsTable extends Migration
});
}
/**
* @return void
*/
private function copyPreviousToNewNewsCommentsTable(): void
{
$connection = $this->schema->getConnection();
@ -90,12 +84,9 @@ class CreateNewsCommentsTable extends Migration
}
}
/**
* @return void
*/
private function createPreviousNewsCommentsTable(): void
{
$this->schema->create('NewsComments', function (Blueprint $table) {
$this->schema->create('NewsComments', function (Blueprint $table): void {
$table->increments('ID');
$this->references($table, 'news', 'Refid');
$table->dateTime('Datum');
@ -104,9 +95,6 @@ class CreateNewsCommentsTable extends Migration
});
}
/**
* @return void
*/
private function copyNewToPreviousNewsCommentsTable(): void
{
$connection = $this->schema->getConnection();

View File

@ -64,14 +64,11 @@ class CreateMessagesTable extends Migration
$this->schema->drop('new_messages');
}
/**
* @return void
*/
private function createNewMessagesTable(): void
{
$this->schema->create(
'messages',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->increments('id');
$this->referencesUser($table);
$this->references($table, 'users', 'receiver_id');
@ -82,9 +79,6 @@ class CreateMessagesTable extends Migration
);
}
/**
* @return void
*/
private function copyPreviousToNewMessagesTable(): void
{
$connection = $this->schema->getConnection();
@ -109,14 +103,11 @@ class CreateMessagesTable extends Migration
}
}
/**
* @return void
*/
private function createPreviousMessagesTable(): void
{
$this->schema->create(
'Messages',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->increments('id');
$table->integer('Datum');
$this->references($table, 'users', 'SUID');
@ -128,9 +119,6 @@ class CreateMessagesTable extends Migration
);
}
/**
* @return void
*/
private function copyNewToPreviousMessagesTable(): void
{
$connection = $this->schema->getConnection();

View File

@ -17,9 +17,6 @@ class CreateQuestionsTable extends Migration
use ChangesReferences;
use Reference;
/**
* @return void
*/
public function up(): void
{
$hasPreviousQuestionsTable = $this->schema->hasTable('Questions');
@ -43,9 +40,6 @@ class CreateQuestionsTable extends Migration
}
}
/**
* @return void
*/
public function down(): void
{
// Rename as some SQL DBMS handle identifiers case insensitive
@ -63,14 +57,11 @@ class CreateQuestionsTable extends Migration
$this->schema->drop('new_questions');
}
/**
* @return void
*/
private function createNewQuestionsTable(): void
{
$this->schema->create(
'questions',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->increments('id');
$this->referencesUser($table);
$table->text('text');
@ -82,9 +73,6 @@ class CreateQuestionsTable extends Migration
);
}
/**
* @return void
*/
private function copyPreviousToNewQuestionsTable(): void
{
$connection = $this->schema->getConnection();
@ -104,14 +92,11 @@ class CreateQuestionsTable extends Migration
}
}
/**
* @return void
*/
private function createPreviousQuestionsTable(): void
{
$this->schema->create(
'Questions',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->increments('QID');
$this->references($table, 'users', 'UID');
$table->text('Question');
@ -123,9 +108,6 @@ class CreateQuestionsTable extends Migration
);
}
/**
* @return void
*/
private function copyNewToPreviousQuestionsTable(): void
{
$connection = $this->schema->getConnection();

View File

@ -14,7 +14,7 @@ class UserPersonalDataAddPronounField extends Migration
*/
public function up(): void
{
$this->schema->table('users_personal_data', function (Blueprint $table) {
$this->schema->table('users_personal_data', function (Blueprint $table): void {
$table->string('pronoun', 15)
->nullable()
->default(null)
@ -27,7 +27,7 @@ class UserPersonalDataAddPronounField extends Migration
*/
public function down(): void
{
$this->schema->table('users_personal_data', function (Blueprint $table) {
$this->schema->table('users_personal_data', function (Blueprint $table): void {
$table->dropColumn('pronoun');
});
}

View File

@ -18,7 +18,7 @@ class CreateRoomsTable extends Migration
*/
public function up(): void
{
$this->schema->create('rooms', function (Blueprint $table) {
$this->schema->create('rooms', function (Blueprint $table): void {
$table->increments('id');
$table->string('name', 35)->unique();
$table->string('map_url', 300)->nullable();
@ -61,7 +61,7 @@ class CreateRoomsTable extends Migration
{
$connection = $this->schema->getConnection();
$this->schema->create('Room', function (Blueprint $table) {
$this->schema->create('Room', function (Blueprint $table): void {
$table->increments('RID');
$table->string('Name', 35)->unique();
$table->string('map_url', 300)->nullable();

View File

@ -19,7 +19,7 @@ class CreateWorklogsTable extends Migration
*/
public function up(): void
{
$this->schema->create('worklogs', function (Blueprint $table) {
$this->schema->create('worklogs', function (Blueprint $table): void {
$table->increments('id');
$this->referencesUser($table);
$this->references($table, 'users', 'creator_id');
@ -70,7 +70,7 @@ class CreateWorklogsTable extends Migration
{
$connection = $this->schema->getConnection();
$this->schema->create('UserWorkLog', function (Blueprint $table) {
$this->schema->create('UserWorkLog', function (Blueprint $table): void {
$table->increments('id');
$this->referencesUser($table);
$table->integer('work_timestamp');

View File

@ -9,7 +9,7 @@ class CreateWelcomeAngelPermissionsGroup extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('Groups')) {
return;
@ -38,7 +38,7 @@ class CreateWelcomeAngelPermissionsGroup extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('Groups')) {
return;

View File

@ -18,7 +18,7 @@ class AddTimestampsToQuestions extends Migration
$connection = $this->schema->getConnection();
$now = Carbon::now();
$this->schema->table('questions', function (Blueprint $table) {
$this->schema->table('questions', function (Blueprint $table): void {
$table->timestamp('answered_at')->after('answerer_id')->nullable();
$table->timestamps();
});
@ -40,7 +40,7 @@ class AddTimestampsToQuestions extends Migration
*/
public function down(): void
{
$this->schema->table('questions', function (Blueprint $table) {
$this->schema->table('questions', function (Blueprint $table): void {
$table->dropColumn('answered_at');
$table->dropTimestamps();
});

View File

@ -10,9 +10,9 @@ class CreateFaqTableAndPermissions extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->create('faq', function (Blueprint $table) {
$this->schema->create('faq', function (Blueprint $table): void {
$table->increments('id');
$table->string('question');
$table->text('text');
@ -46,7 +46,7 @@ class CreateFaqTableAndPermissions extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->drop('faq');

View File

@ -9,7 +9,7 @@ class CreateQuestionsPermissions extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if ($this->schema->hasTable('Privileges')) {
$db = $this->schema->getConnection();
@ -36,7 +36,7 @@ class CreateQuestionsPermissions extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('Privileges')) {
return;

View File

@ -16,7 +16,7 @@ class CreateOauthTable extends Migration
*/
public function up(): void
{
$this->schema->create('oauth', function (Blueprint $table) {
$this->schema->create('oauth', function (Blueprint $table): void {
$table->increments('id');
$this->referencesUser($table);
$table->string('provider');

View File

@ -13,13 +13,13 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$connection = $this->schema->getConnection();
$this->schema->table(
'schedules',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->string('name')->default('')->after('id');
$table->integer('shift_type')->default(0)->after('name');
$table->integer('minutes_before')->default(0)->after('shift_type');
@ -37,7 +37,7 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration
$this->schema->table(
'schedules',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->string('name')->default(null)->change();
$table->integer('shift_type')->default(null)->change();
$table->integer('minutes_before')->default(null)->change();
@ -61,7 +61,7 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration
$this->schema->table(
'schedules',
function (Blueprint $table) {
function (Blueprint $table): void {
$this->addReference($table, 'shift_type', 'ShiftTypes');
}
);
@ -71,11 +71,11 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table(
'schedules',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropForeign('schedules_shift_type_foreign');
$table->dropColumn('name');
$table->dropColumn('shift_type');

View File

@ -12,11 +12,11 @@ class AddEmailNewsToUsersSettings extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table(
'users_settings',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->boolean('email_news')->default(false)->after('email_shiftinfo');
}
);
@ -25,11 +25,11 @@ class AddEmailNewsToUsersSettings extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table(
'users_settings',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('email_news');
}
);

View File

@ -12,11 +12,11 @@ class OauthAddTokens extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table(
'oauth',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->string('access_token')->nullable()->default(null)->after('identifier');
$table->string('refresh_token')->nullable()->default(null)->after('access_token');
$table->dateTime('expires_at')->nullable()->default(null)->after('refresh_token');
@ -27,11 +27,11 @@ class OauthAddTokens extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table(
'oauth',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('access_token');
$table->dropColumn('refresh_token');
$table->dropColumn('expires_at');

View File

@ -12,11 +12,11 @@ class NewsAddIsPinned extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table(
'news',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->boolean('is_pinned')->default(false)->after('is_meeting');
}
);
@ -25,11 +25,11 @@ class NewsAddIsPinned extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table(
'news',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('is_pinned');
}
);

View File

@ -12,11 +12,11 @@ class OauthChangeTokensToText extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table(
'oauth',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->text('access_token')->change();
$table->text('refresh_token')->change();
}
@ -26,11 +26,11 @@ class OauthChangeTokensToText extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table(
'oauth',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->string('access_token')->change();
$table->string('refresh_token')->change();
}

View File

@ -28,7 +28,7 @@ class SetAdminPassword extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$admin = $this->auth->authenticate('admin', 'asdfasdf');
$setupPassword = $this->config->get('setup_admin_password');

View File

@ -9,7 +9,7 @@ class AddShirtEditPermissions extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('GroupPrivileges')) {
return;
@ -40,7 +40,7 @@ class AddShirtEditPermissions extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('GroupPrivileges')) {
return;

View File

@ -12,7 +12,7 @@ class AddShiftsDescription extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('Shifts')) {
return;
@ -20,7 +20,7 @@ class AddShiftsDescription extends Migration
$this->schema->table(
'Shifts',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->text('description')->nullable()->after('shifttype_id');
}
);
@ -29,7 +29,7 @@ class AddShiftsDescription extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('Shifts')) {
return;
@ -37,7 +37,7 @@ class AddShiftsDescription extends Migration
$this->schema->table(
'Shifts',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('description');
}
);

View File

@ -16,7 +16,7 @@ class CreateUserLicensesTable extends Migration
*/
public function up(): void
{
$this->schema->create('users_licenses', function (Blueprint $table) {
$this->schema->create('users_licenses', function (Blueprint $table): void {
$this->referencesUser($table, true);
$table->boolean('has_car')->default(false);
$table->boolean('drive_forklift')->default(false);
@ -54,7 +54,7 @@ class CreateUserLicensesTable extends Migration
*/
public function down(): void
{
$this->schema->create('UserDriverLicenses', function (Blueprint $table) {
$this->schema->create('UserDriverLicenses', function (Blueprint $table): void {
$this->referencesUser($table, true);
$table->boolean('has_car');
$table->boolean('has_license_car');

View File

@ -10,9 +10,9 @@ class IncreaseSessionsTablePayloadSize extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table('sessions', function (Blueprint $table) {
$this->schema->table('sessions', function (Blueprint $table): void {
$table->mediumText('payload')->change();
});
}
@ -20,9 +20,9 @@ class IncreaseSessionsTablePayloadSize extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table('sessions', function (Blueprint $table) {
$this->schema->table('sessions', function (Blueprint $table): void {
$table->text('payload')->change();
});
}

View File

@ -12,13 +12,13 @@ class UsersSettingsAddEmailGoody extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$connection = $this->schema->getConnection();
$this->schema->table(
'users_settings',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->boolean('email_goody')->default(false)->after('email_human');
}
);
@ -31,11 +31,11 @@ class UsersSettingsAddEmailGoody extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table(
'users_settings',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('email_goody');
}
);

View File

@ -9,7 +9,7 @@ class RemoveAdminNewsHtmlPrivilege extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('GroupPrivileges')) {
return;
@ -27,7 +27,7 @@ class RemoveAdminNewsHtmlPrivilege extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('GroupPrivileges')) {
return;

View File

@ -13,9 +13,9 @@ class IncreaseTshirtFieldWidth extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table('users_personal_data', function (Blueprint $table) {
$this->schema->table('users_personal_data', function (Blueprint $table): void {
$table->string('shirt_size', 10)->change();
});
}
@ -23,9 +23,9 @@ class IncreaseTshirtFieldWidth extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table('users_personal_data', function (Blueprint $table) {
$this->schema->table('users_personal_data', function (Blueprint $table): void {
$table->string('shirt_size', 4)->change();
});
}

View File

@ -9,7 +9,7 @@ class CreateVoucherEditPermission extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('Privileges')) {
return;
@ -36,7 +36,7 @@ class CreateVoucherEditPermission extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('Privileges')) {
return;

View File

@ -18,7 +18,7 @@ class ShiftsAddTransactionId extends Migration
return;
}
$this->schema->table('Shifts', function (Blueprint $table) {
$this->schema->table('Shifts', function (Blueprint $table): void {
$table->uuid('transaction_id')->index()->nullable()->default(null);
});
}
@ -32,7 +32,7 @@ class ShiftsAddTransactionId extends Migration
return;
}
$this->schema->table('Shifts', function (Blueprint $table) {
$this->schema->table('Shifts', function (Blueprint $table): void {
$table->dropColumn('transaction_id');
});
}

View File

@ -32,7 +32,7 @@ class FixOldGroupsTableIdAndName extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->migrate($this->naming, $this->ids);
}
@ -40,7 +40,7 @@ class FixOldGroupsTableIdAndName extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->migrate(array_flip($this->naming), array_flip($this->ids));
}
@ -49,7 +49,7 @@ class FixOldGroupsTableIdAndName extends Migration
* @param string[] $naming
* @param int[] $ids
*/
protected function migrate(array $naming, array $ids)
protected function migrate(array $naming, array $ids): void
{
if (!$this->schema->hasTable('Groups')) {
return;

View File

@ -10,11 +10,11 @@ class AddMobileShowToUsersSettings extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table(
'users_settings',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->boolean('mobile_show')->default(false)->after('email_news');
}
);
@ -23,11 +23,11 @@ class AddMobileShowToUsersSettings extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table(
'users_settings',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('mobile_show');
}
);

View File

@ -10,11 +10,11 @@ class AddDectToRooms extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table(
'rooms',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->text('dect')->nullable()->after('description');
}
);
@ -23,11 +23,11 @@ class AddDectToRooms extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table(
'rooms',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('dect');
}
);

View File

@ -10,7 +10,7 @@ class AddHideRegisterToAngeltypes extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
if (!$this->schema->hasTable('AngelTypes')) {
return;
@ -18,7 +18,7 @@ class AddHideRegisterToAngeltypes extends Migration
$this->schema->table(
'AngelTypes',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->boolean('hide_register')->default(false)->after('show_on_dashboard');
}
);
@ -27,7 +27,7 @@ class AddHideRegisterToAngeltypes extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
if (!$this->schema->hasTable('AngelTypes')) {
return;
@ -35,7 +35,7 @@ class AddHideRegisterToAngeltypes extends Migration
$this->schema->table(
'AngelTypes',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropColumn('hide_register');
}
);

View File

@ -108,59 +108,53 @@ class CreatePrivilegesAndGroupsRelatedTables extends Migration
$this->schema->drop('privileges_new');
}
/**
* @return void
*/
protected function createNew(): void
{
$this->schema->create('groups', function (Blueprint $table) {
$this->schema->create('groups', function (Blueprint $table): void {
$table->increments('id');
$table->string('name', 35)->unique();
});
$this->schema->create('privileges', function (Blueprint $table) {
$this->schema->create('privileges', function (Blueprint $table): void {
$table->increments('id');
$table->string('name', 128)->unique();
$table->string('description', 1024);
});
$this->schema->create('users_groups', function (Blueprint $table) {
$this->schema->create('users_groups', function (Blueprint $table): void {
$table->increments('id');
$this->referencesUser($table)->index();
$this->references($table, 'groups')->index();
});
$this->schema->create('group_privileges', function (Blueprint $table) {
$this->schema->create('group_privileges', function (Blueprint $table): void {
$table->increments('id');
$this->references($table, 'groups')->index();
$this->references($table, 'privileges')->index();
});
}
/**
* @return void
*/
protected function createOldTable(): void
{
$this->schema->create('Groups', function (Blueprint $table) {
$this->schema->create('Groups', function (Blueprint $table): void {
$table->string('Name', 35);
$table->integer('UID')->primary();
});
$this->schema->create('Privileges', function (Blueprint $table) {
$this->schema->create('Privileges', function (Blueprint $table): void {
$table->increments('id');
$table->string('name', 128)->unique();
$table->string('desc', 1024);
});
$this->schema->create('UserGroups', function (Blueprint $table) {
$this->schema->create('UserGroups', function (Blueprint $table): void {
$table->increments('id');
$this->references($table, 'users', 'uid');
$this->references($table, 'Groups', 'group_id', 'UID', false, 'integer')->index();
$table->index(['uid', 'group_id']);
});
$this->schema->create('GroupPrivileges', function (Blueprint $table) {
$this->schema->create('GroupPrivileges', function (Blueprint $table): void {
$table->increments('id');
$this->references($table, 'Groups', 'group_id', 'UID', false, 'integer');
$this->references($table, 'Privileges', 'privilege_id')->index();
@ -168,9 +162,6 @@ class CreatePrivilegesAndGroupsRelatedTables extends Migration
});
}
/**
* @return void
*/
protected function copyOldToNew(): void
{
$connection = $this->schema->getConnection();
@ -220,9 +211,6 @@ class CreatePrivilegesAndGroupsRelatedTables extends Migration
}
}
/**
* @return void
*/
protected function copyNewToOld(): void
{
$connection = $this->schema->getConnection();

View File

@ -20,7 +20,7 @@ class ShifttypeRemoveAngeltype extends Migration
$this->schema->table(
'ShiftTypes',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->dropForeign('shifttypes_ibfk_1');
$table->dropColumn('angeltype_id');
}
@ -38,7 +38,7 @@ class ShifttypeRemoveAngeltype extends Migration
$this->schema->table(
'ShiftTypes',
function (Blueprint $table) {
function (Blueprint $table): void {
$table->integer('angeltype_id')
->after('name')
->index()

View File

@ -18,7 +18,7 @@ class CreateShiftTypesTable extends Migration
public function up(): void
{
$connection = $this->schema->getConnection();
$this->schema->create('shift_types', function (Blueprint $table) {
$this->schema->create('shift_types', function (Blueprint $table): void {
$table->increments('id');
$table->string('name')->unique();
$table->text('description');
@ -56,7 +56,7 @@ class CreateShiftTypesTable extends Migration
public function down(): void
{
$connection = $this->schema->getConnection();
$this->schema->create('ShiftTypes', function (Blueprint $table) {
$this->schema->create('ShiftTypes', function (Blueprint $table): void {
$table->increments('id');
$table->string('name', 255);
$table->mediumText('description');

View File

@ -19,7 +19,7 @@ class CreateAngelTypesTable extends Migration
public function up(): void
{
$connection = $this->schema->getConnection();
$this->schema->create('angel_types', function (Blueprint $table) {
$this->schema->create('angel_types', function (Blueprint $table): void {
$table->increments('id');
$table->string('name')->unique();
$table->text('description')->default('');
@ -77,7 +77,7 @@ class CreateAngelTypesTable extends Migration
public function down(): void
{
$connection = $this->schema->getConnection();
$this->schema->create('AngelTypes', function (Blueprint $table) {
$this->schema->create('AngelTypes', function (Blueprint $table): void {
$table->integer('id', true);
$table->string('name', 50)->default('')->unique();
$table->boolean('restricted');

View File

@ -20,7 +20,7 @@ class CreateUserAngelTypesTable extends Migration
{
$connection = $this->schema->getConnection();
$this->schema->create('user_angel_type', function (Blueprint $table) {
$this->schema->create('user_angel_type', function (Blueprint $table): void {
$table->increments('id');
$this->referencesUser($table);
$this->references($table, 'angel_types')->index();
@ -65,7 +65,7 @@ class CreateUserAngelTypesTable extends Migration
{
$connection = $this->schema->getConnection();
$this->schema->create('UserAngelTypes', function (Blueprint $table) {
$this->schema->create('UserAngelTypes', function (Blueprint $table): void {
$table->increments('id');
$this->referencesUser($table);
$this->references($table, 'angel_types', 'angeltype_id')->index('angeltype_id');

View File

@ -12,9 +12,9 @@ class ChangeApiKeyLength extends Migration
/**
* Run the migration
*/
public function up()
public function up(): void
{
$this->schema->table('users', function (Blueprint $table) {
$this->schema->table('users', function (Blueprint $table): void {
$table->string('api_key', 64)->change();
});
}
@ -22,9 +22,9 @@ class ChangeApiKeyLength extends Migration
/**
* Reverse the migration
*/
public function down()
public function down(): void
{
$this->schema->table('users', function (Blueprint $table) {
$this->schema->table('users', function (Blueprint $table): void {
$table->string('api_key', 32)->change();
});
}

View File

@ -13,18 +13,18 @@ trait ChangesReferences
string $targetTable,
string $targetColumn,
string $type = 'unsignedInteger'
) {
): void {
$references = $this->getReferencingTables($fromTable, $fromColumn);
foreach ($references as $reference) {
/** @var stdClass $reference */
$this->schema->table($reference->table, function (Blueprint $table) use ($reference) {
$this->schema->table($reference->table, function (Blueprint $table) use ($reference): void {
$table->dropForeign($reference->constraint);
});
$this->schema->table(
$reference->table,
function (Blueprint $table) use ($reference, $targetTable, $targetColumn, $type) {
function (Blueprint $table) use ($reference, $targetTable, $targetColumn, $type): void {
$table->{$type}($reference->column)->change();
$table->foreign($reference->column)

View File

@ -8,17 +8,11 @@ use Illuminate\Support\Str;
trait Reference
{
/**
* @return ColumnDefinition
*/
protected function referencesUser(Blueprint $table, bool $setPrimary = false): ColumnDefinition
{
return $this->references($table, 'users', null, null, $setPrimary);
}
/**
* @return ColumnDefinition
*/
protected function references(
Blueprint $table,
string $targetTable,

View File

@ -41,7 +41,7 @@ class Application extends Container
$this->registerBaseBindings();
}
protected function registerBaseBindings()
protected function registerBaseBindings(): void
{
static::setInstance($this);
Container::setInstance($this);
@ -54,10 +54,7 @@ class Application extends Container
$this->bind(ContainerInterface::class, self::class);
}
/**
* @return ServiceProvider
*/
public function register(string|ServiceProvider $provider)
public function register(string|ServiceProvider $provider): ServiceProvider
{
if (is_string($provider)) {
$provider = $this->make($provider);
@ -79,7 +76,7 @@ class Application extends Container
*
* @param Config|null $config
*/
public function bootstrap(Config $config = null)
public function bootstrap(Config $config = null): void
{
if ($this->isBootstrapped) {
return;
@ -100,7 +97,7 @@ class Application extends Container
$this->isBootstrapped = true;
}
protected function registerPaths()
protected function registerPaths(): void
{
$appPath = $this->appPath;
@ -124,7 +121,7 @@ class Application extends Container
*
* @return static
*/
public function setAppPath(string $appPath)
public function setAppPath(string $appPath): static
{
$appPath = realpath($appPath);
$appPath = rtrim($appPath, DIRECTORY_SEPARATOR);
@ -136,18 +133,12 @@ class Application extends Container
return $this;
}
/**
* @return string|null
*/
public function path()
public function path(): ?string
{
return $this->appPath;
}
/**
* @return bool
*/
public function isBooted()
public function isBooted(): bool
{
return $this->isBootstrapped;
}
@ -155,7 +146,7 @@ class Application extends Container
/**
* @return MiddlewareInterface[]|string[]
*/
public function getMiddleware()
public function getMiddleware(): array
{
return $this->middleware;
}

View File

@ -16,7 +16,7 @@ class Config extends Fluent
/**
* @param string|array $key
*/
public function get(mixed $key, mixed $default = null)
public function get(mixed $key, mixed $default = null): mixed
{
if (is_null($key)) {
return $this->attributes;
@ -32,7 +32,7 @@ class Config extends Fluent
/**
* @param string|array $key
*/
public function set(mixed $key, mixed $value = null)
public function set(mixed $key, mixed $value = null): void
{
if (is_array($key)) {
foreach ($key as $configKey => $configValue) {
@ -47,9 +47,8 @@ class Config extends Fluent
/**
* @param string $key
* @return bool
*/
public function has(mixed $key)
public function has(mixed $key): bool
{
return $this->offsetExists($key);
}
@ -57,7 +56,7 @@ class Config extends Fluent
/**
* @param string $key
*/
public function remove(mixed $key)
public function remove(mixed $key): void
{
$this->offsetUnset($key);
}

View File

@ -23,7 +23,7 @@ class ConfigServiceProvider extends ServiceProvider
$this->eventConfig = $eventConfig;
}
public function register()
public function register(): void
{
$config = $this->app->make(Config::class);
$this->app->instance(Config::class, $config);
@ -48,7 +48,7 @@ class ConfigServiceProvider extends ServiceProvider
}
}
public function boot()
public function boot(): void
{
if (!$this->eventConfig) {
return;
@ -80,7 +80,6 @@ class ConfigServiceProvider extends ServiceProvider
/**
* Get the config path
*
* @return string
*/
protected function getConfigPath(string $path = ''): string
{

View File

@ -21,14 +21,14 @@ abstract class ServiceProvider
/**
* Register container bindings
*/
public function register()
public function register(): void
{
}
/**
* Called after other services had been registered
*/
public function boot()
public function boot(): void
{
}
}

View File

@ -44,10 +44,6 @@ class FaqController extends BaseController
$this->response = $response;
}
/**
*
* @return Response
*/
public function edit(Request $request): Response
{
$faqId = $request->getAttribute('faq_id'); // optional
@ -57,10 +53,6 @@ class FaqController extends BaseController
return $this->showEdit($faq);
}
/**
*
* @return Response
*/
public function save(Request $request): Response
{
$faqId = $request->getAttribute('faq_id'); // optional
@ -101,10 +93,6 @@ class FaqController extends BaseController
return $this->redirect->to('/faq#faq-' . $faq->id);
}
/**
*
* @return Response
*/
protected function showEdit(?Faq $faq): Response
{
return $this->response->withView(

View File

@ -26,9 +26,6 @@ class LogsController extends BaseController
$this->response = $response;
}
/**
* @return Response
*/
public function index(Request $request): Response
{
$search = $request->input('search');

View File

@ -49,10 +49,6 @@ class NewsController extends BaseController
$this->response = $response;
}
/**
*
* @return Response
*/
public function edit(Request $request): Response
{
$newsId = $request->getAttribute('news_id'); // optional
@ -63,10 +59,6 @@ class NewsController extends BaseController
return $this->showEdit($news, $isMeeting);
}
/**
*
* @return Response
*/
protected function showEdit(?News $news, bool $isMeetingDefault = false): Response
{
return $this->response->withView(
@ -79,10 +71,6 @@ class NewsController extends BaseController
);
}
/**
*
* @return Response
*/
public function save(Request $request): Response
{
$newsId = $request->getAttribute('news_id'); // optional

View File

@ -51,9 +51,6 @@ class QuestionsController extends BaseController
$this->response = $response;
}
/**
* @return Response
*/
public function index(): Response
{
$questions = $this->question
@ -67,10 +64,6 @@ class QuestionsController extends BaseController
);
}
/**
*
* @return Response
*/
public function delete(Request $request): Response
{
$data = $this->validate($request, [
@ -87,10 +80,6 @@ class QuestionsController extends BaseController
return $this->redirect->to('/admin/questions');
}
/**
*
* @return Response
*/
public function edit(Request $request): Response
{
$questionId = (int)$request->getAttribute('question_id');
@ -100,10 +89,6 @@ class QuestionsController extends BaseController
return $this->showEdit($questions);
}
/**
*
* @return Response
*/
public function save(Request $request): Response
{
$questionId = (int)$request->getAttribute('question_id');
@ -149,10 +134,6 @@ class QuestionsController extends BaseController
return $this->redirect->to('/admin/questions');
}
/**
*
* @return Response
*/
protected function showEdit(?Question $question): Response
{
return $this->response->withView(

View File

@ -56,10 +56,6 @@ class UserShirtController extends BaseController
$this->user = $user;
}
/**
*
* @return Response
*/
public function editShirt(Request $request): Response
{
$userId = (int)$request->getAttribute('user_id');
@ -72,10 +68,6 @@ class UserShirtController extends BaseController
);
}
/**
*
* @return Response
*/
public function saveShirt(Request $request): Response
{
$userId = (int)$request->getAttribute('user_id');

View File

@ -63,9 +63,6 @@ class UserWorkLogController extends BaseController
$this->user = $user;
}
/**
* @return Response
*/
public function editWorklog(Request $request): Response
{
$userId = (int)$request->getAttribute('user_id');
@ -85,9 +82,6 @@ class UserWorkLogController extends BaseController
}
}
/**
* @return Response
*/
public function saveWorklog(Request $request): Response
{
$userId = (int)$request->getAttribute('user_id');
@ -123,9 +117,6 @@ class UserWorkLogController extends BaseController
// TODO Once User_view.php gets removed, change this to withView + getNotifications
}
/**
* @return Response
*/
public function showDeleteWorklog(Request $request): Response
{
$userId = (int)$request->getAttribute('user_id');
@ -144,9 +135,6 @@ class UserWorkLogController extends BaseController
);
}
/**
* @return Response
*/
public function deleteWorklog(Request $request): Response
{
$userId = (int)$request->getAttribute('user_id');
@ -184,9 +172,6 @@ class UserWorkLogController extends BaseController
);
}
/**
* @return Carbon
*/
private function getWorkDateSuggestion(): Carbon
{
$buildup_start = config('buildup_start');

View File

@ -14,10 +14,7 @@ class ApiController extends BaseController
$this->response = $response;
}
/**
* @return Response
*/
public function index()
public function index(): Response
{
return $this->response
->setStatusCode(501)

View File

@ -50,17 +50,11 @@ class AuthController extends BaseController
$this->auth = $auth;
}
/**
* @return Response
*/
public function login(): Response
{
return $this->showLogin();
}
/**
* @return Response
*/
protected function showLogin(): Response
{
return $this->response->withView(
@ -72,7 +66,6 @@ class AuthController extends BaseController
/**
* Posted login form
*
* @return Response
*/
public function postLogin(Request $request): Response
{
@ -92,10 +85,6 @@ class AuthController extends BaseController
return $this->loginUser($user);
}
/**
*
* @return Response
*/
public function loginUser(User $user): Response
{
$previousPage = $this->session->get('previous_page');
@ -110,9 +99,6 @@ class AuthController extends BaseController
return $this->redirect->to($previousPage ?: $this->config->get('home_site'));
}
/**
* @return Response
*/
public function logout(): Response
{
$this->session->invalidate();

View File

@ -16,7 +16,7 @@ abstract class BaseController
*
* @return string[]|string[][]
*/
public function getPermissions()
public function getPermissions(): array
{
return $this->permissions;
}

View File

@ -7,9 +7,6 @@ use DateTime;
trait ChecksArrivalsAndDepartures
{
/**
* @return bool
*/
protected function isArrivalDateValid(?string $arrival, ?string $departure): bool
{
$arrival_carbon = $this->toCarbon($arrival);
@ -26,9 +23,6 @@ trait ChecksArrivalsAndDepartures
return !$this->isBeforeBuildup($arrival_carbon) && !$this->isAfterTeardown($arrival_carbon);
}
/**
* @return bool
*/
protected function isDepartureDateValid(?string $arrival, ?string $departure): bool
{
$arrival_carbon = $this->toCarbon($arrival);

View File

@ -24,10 +24,7 @@ class CreditsController extends BaseController
$this->version = $version;
}
/**
* @return Response
*/
public function index()
public function index(): Response
{
return $this->response->withView(
'pages/credits.twig',

View File

@ -26,9 +26,8 @@ class DesignController extends BaseController
/**
* Show the design overview page
*
* @return Response
*/
public function index()
public function index(): Response
{
$demoUser = (new User())->forceFill([
'id' => 42,

View File

@ -34,9 +34,6 @@ class FaqController extends BaseController
$this->response = $response;
}
/**
* @return Response
*/
public function index(): Response
{
$text = $this->config->get('faq_text');

View File

@ -7,7 +7,7 @@ use Illuminate\Support\Collection;
trait HasUserNotifications
{
protected function addNotification(string|array $value, string $type = 'messages')
protected function addNotification(string|array $value, string $type = 'messages'): void
{
session()->set(
$type,

View File

@ -14,9 +14,6 @@ class HealthController extends BaseController
$this->response = $response;
}
/**
* @return Response
*/
public function index(): Response
{
return $this->response->withContent('Ok');

View File

@ -25,9 +25,6 @@ class HomeController extends BaseController
$this->redirect = $redirect;
}
/**
* @return Response
*/
public function index(): Response
{
return $this->redirect->to($this->auth->user() ? $this->config->get('home_site') : 'login');

View File

@ -59,9 +59,6 @@ class MessagesController extends BaseController
$this->user = $user;
}
/**
* @return Response
*/
public function index(): Response
{
return $this->listConversations();
@ -127,11 +124,11 @@ class MessagesController extends BaseController
$otherUser = $this->user->findOrFail($userId);
$messages = $this->message
->where(function ($query) use ($currentUser, $otherUser) {
->where(function ($query) use ($currentUser, $otherUser): void {
$query->whereUserId($currentUser->id)
->whereReceiverId($otherUser->id);
})
->orWhere(function ($query) use ($currentUser, $otherUser) {
->orWhere(function ($query) use ($currentUser, $otherUser): void {
$query->whereUserId($otherUser->id)
->whereReceiverId($currentUser->id);
})
@ -235,16 +232,13 @@ class MessagesController extends BaseController
// then getting the full message objects for each ID.
return $this->message
->joinSub($latestMessageIds, 'conversations', function ($join) {
->joinSub($latestMessageIds, 'conversations', function ($join): void {
$join->on('messages.id', '=', 'conversations.last_id');
})
->orderBy('created_at', 'DESC')
->get();
}
/**
* @return QueryExpression
*/
protected function raw(mixed $value): QueryExpression
{
return $this->db->getConnection()->raw($value);

View File

@ -47,10 +47,7 @@ class Controller extends BaseController
$this->version = $version;
}
/**
* @return Response
*/
public function metrics()
public function metrics(): Response
{
$now = microtime(true);
$this->checkAuth();
@ -212,10 +209,7 @@ class Controller extends BaseController
->withContent($this->engine->get('/metrics', $data));
}
/**
* @return Response
*/
public function stats()
public function stats(): Response
{
$this->checkAuth(true);
@ -235,7 +229,7 @@ class Controller extends BaseController
* Ensure that the if the request is authorized
*
*/
protected function checkAuth(bool $isJson = false)
protected function checkAuth(bool $isJson = false): void
{
$apiKey = $this->config->get('api_key');
if (empty($apiKey) || $this->request->get('api_key') == $apiKey) {

View File

@ -14,7 +14,6 @@ class MetricsEngine implements EngineInterface
*
* @param mixed[] $data
*
* @return string
*
* @example $data = ['foo' => [['labels' => ['foo'=>'bar'], 'value'=>42]], 'bar'=>123]
*/
@ -121,7 +120,6 @@ class MetricsEngine implements EngineInterface
/**
*
* @return string
* @see https://prometheus.io/docs/instrumenting/exposition_formats/
*/
protected function formatData(string $name, mixed $row): string
@ -152,11 +150,7 @@ class MetricsEngine implements EngineInterface
return '{' . implode(',', $labels) . '}';
}
/**
*
* @return mixed
*/
protected function renderValue(mixed $row)
protected function renderValue(mixed $row): mixed
{
if (is_array($row)) {
$row = array_pop($row);
@ -165,11 +159,7 @@ class MetricsEngine implements EngineInterface
return $this->formatValue($row);
}
/**
*
* @return mixed
*/
protected function formatValue(mixed $value)
protected function formatValue(mixed $value): mixed
{
if (is_bool($value)) {
return (int)$value;
@ -178,11 +168,7 @@ class MetricsEngine implements EngineInterface
return $this->escape($value);
}
/**
*
* @return mixed
*/
protected function escape(mixed $value)
protected function escape(mixed $value): mixed
{
$replace = [
'\\' => '\\\\',
@ -197,10 +183,6 @@ class MetricsEngine implements EngineInterface
);
}
/**
*
* @return bool
*/
public function canRender(string $path): bool
{
return $path == '/metrics';

View File

@ -23,6 +23,7 @@ use Engelsystem\Models\User\State;
use Engelsystem\Models\User\User;
use Engelsystem\Models\Worklog;
use Illuminate\Contracts\Database\Query\Builder as BuilderContract;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\Expression as QueryExpression;
use Illuminate\Support\Collection;
@ -41,7 +42,6 @@ class Stats
* The number of not arrived users
*
* @param bool|null $working
* @return int
*/
public function arrivedUsers(bool $working = null): int
{
@ -54,7 +54,7 @@ class Stats
->leftJoin('ShiftEntry', 'ShiftEntry.UID', '=', 'users_state.user_id')
->distinct();
$query->where(function ($query) use ($working) {
$query->where(function ($query) use ($working): void {
/** @var QueryBuilder $query */
if ($working) {
$query
@ -77,33 +77,22 @@ class Stats
/**
* The number of not arrived users
*
* @return int
*/
public function newUsers(): int
{
return State::whereArrived(false)->count();
}
/**
* @return int
*/
public function forceActiveUsers(): int
{
return State::whereForceActive(true)->count();
}
/**
* @return int
*/
public function usersPronouns(): int
{
return PersonalData::where('pronoun', '!=', '')->count();
}
/**
*
* @return int
*/
public function email(string $type): int
{
switch ($type) {
@ -130,7 +119,6 @@ class Stats
* The number of currently working users
*
* @param bool|null $freeloaded
* @return int
* @codeCoverageIgnore
*/
public function currentlyWorkingUsers(bool $freeloaded = null): int
@ -148,17 +136,11 @@ class Stats
return $query->count();
}
/**
* @return QueryBuilder
*/
protected function vouchersQuery()
protected function vouchersQuery(): Builder
{
return State::query();
}
/**
* @return int
*/
public function vouchers(): int
{
return (int)$this->vouchersQuery()->sum('got_voucher');
@ -185,17 +167,11 @@ class Stats
return $return;
}
/**
* @return int
*/
public function tshirts(): int
{
return State::whereGotShirt(true)->count();
}
/**
* @return Collection
*/
public function tshirtSizes(): Collection
{
return PersonalData::query()
@ -205,9 +181,6 @@ class Stats
->get();
}
/**
* @return Collection
*/
public function languages(): Collection
{
return Settings::query()
@ -216,9 +189,6 @@ class Stats
->get();
}
/**
* @return Collection
*/
public function themes(): Collection
{
return Settings::query()
@ -229,7 +199,6 @@ class Stats
/**
* @param string|null $vehicle
* @return int
*/
public function licenses(string $vehicle): int
{
@ -254,7 +223,6 @@ class Stats
* @param bool|null $freeloaded
*
* @codeCoverageIgnore
* @return QueryBuilder
*/
protected function workSecondsQuery(bool $done = null, bool $freeloaded = null): QueryBuilder
{
@ -279,7 +247,6 @@ class Stats
* @param bool|null $done
* @param bool|null $freeloaded
*
* @return int
* @codeCoverageIgnore
*/
public function workSeconds(bool $done = null, bool $freeloaded = null): int
@ -340,7 +307,6 @@ class Stats
}
/**
* @return int
* @codeCoverageIgnore
*/
public function worklogSeconds(): int
@ -366,9 +332,6 @@ class Stats
);
}
/**
* @return int
*/
public function rooms(): int
{
return Room::query()
@ -376,7 +339,6 @@ class Stats
}
/**
* @return int
* @codeCoverageIgnore
*/
public function shifts(): int
@ -388,7 +350,6 @@ class Stats
/**
* @param bool|null $meeting
* @return int
*/
public function announcements(bool $meeting = null): int
{
@ -397,9 +358,6 @@ class Stats
return $query->count();
}
/**
* @return int
*/
public function comments(): int
{
return NewsComment::query()
@ -408,7 +366,6 @@ class Stats
/**
* @param bool|null $answered
* @return int
*/
public function questions(bool $answered = null): int
{
@ -424,25 +381,16 @@ class Stats
return $query->count();
}
/**
* @return int
*/
public function faq(): int
{
return Faq::query()->count();
}
/**
* @return int
*/
public function messages(): int
{
return Message::query()->count();
}
/**
* @return int
*/
public function sessions(): int
{
return $this
@ -450,9 +398,6 @@ class Stats
->count();
}
/**
* @return Collection
*/
public function oauth(): Collection
{
return OAuth::query()
@ -461,9 +406,6 @@ class Stats
->get();
}
/**
* @return float
*/
public function databaseRead(): float
{
$start = microtime(true);
@ -473,9 +415,6 @@ class Stats
return microtime(true) - $start;
}
/**
* @return float
*/
public function databaseWrite(): float
{
$config = (new EventConfig())->findOrNew('last_metrics');
@ -492,7 +431,6 @@ class Stats
/**
* @param string|null $level
* @return int
*/
public function logEntries(string $level = null): int
{
@ -501,17 +439,11 @@ class Stats
return $query->count();
}
/**
* @return int
*/
public function passwordResets(): int
{
return PasswordReset::query()->count();
}
/**
* @return QueryBuilder
*/
protected function getQuery(string $table): QueryBuilder
{
return $this->db
@ -519,9 +451,6 @@ class Stats
->table($table);
}
/**
* @return QueryExpression
*/
protected function raw(mixed $value): QueryExpression
{
return $this->db->getConnection()->raw($value);

View File

@ -68,25 +68,16 @@ class NewsController extends BaseController
$this->request = $request;
}
/**
* @return Response
*/
public function index()
public function index(): Response
{
return $this->showOverview();
}
/**
* @return Response
*/
public function meetings(): Response
{
return $this->showOverview(true);
}
/**
* @return Response
*/
public function show(Request $request): Response
{
$newsId = (int)$request->getAttribute('news_id');
@ -99,9 +90,6 @@ class NewsController extends BaseController
return $this->renderView('pages/news/news.twig', ['news' => $news]);
}
/**
* @return Response
*/
public function comment(Request $request): Response
{
$newsId = (int)$request->getAttribute('news_id');
@ -131,10 +119,6 @@ class NewsController extends BaseController
return $this->redirect->back();
}
/**
*
* @return Response
*/
public function deleteComment(Request $request): Response
{
$commentId = (int)$request->getAttribute('comment_id');
@ -166,9 +150,6 @@ class NewsController extends BaseController
return $this->redirect->to('/news/' . $comment->news->id);
}
/**
* @return Response
*/
protected function showOverview(bool $onlyMeetings = false): Response
{
$query = $this->news;
@ -203,7 +184,6 @@ class NewsController extends BaseController
/**
* @param array $data
* @return Response
*/
protected function renderView(string $page, array $data): Response
{

View File

@ -69,10 +69,6 @@ class OAuthController extends BaseController
$this->url = $url;
}
/**
*
* @return Response
*/
public function index(Request $request): Response
{
$providerName = $request->getAttribute('provider');
@ -201,10 +197,6 @@ class OAuthController extends BaseController
return $response;
}
/**
*
* @return Response
*/
public function connect(Request $request): Response
{
$providerName = $request->getAttribute('provider');
@ -216,10 +208,6 @@ class OAuthController extends BaseController
return $this->index($request);
}
/**
*
* @return Response
*/
public function disconnect(Request $request): Response
{
$providerName = $request->getAttribute('provider');
@ -235,10 +223,6 @@ class OAuthController extends BaseController
return $this->redirector->back();
}
/**
*
* @return AbstractProvider
*/
protected function getProvider(string $name): AbstractProvider
{
$this->requireProvider($name);
@ -257,10 +241,7 @@ class OAuthController extends BaseController
);
}
/**
* @return mixed
*/
protected function getId(string $providerName, ResourceOwner $resourceOwner)
protected function getId(string $providerName, ResourceOwner $resourceOwner): mixed
{
$config = $this->config->get('oauth')[$providerName];
if (empty($config['nested_info'])) {
@ -278,10 +259,6 @@ class OAuthController extends BaseController
}
}
/**
*
* @return bool
*/
protected function isValidProvider(string $name): bool
{
$config = $this->config->get('oauth');
@ -339,7 +316,6 @@ class OAuthController extends BaseController
/**
* @param array $config
*
* @return Response
*/
protected function redirectRegister(
string $providerName,

View File

@ -47,17 +47,11 @@ class PasswordResetController extends BaseController
$this->session = $session;
}
/**
* @return Response
*/
public function reset(): Response
{
return $this->showView('pages/password/reset');
}
/**
* @return Response
*/
public function postReset(Request $request): Response
{
$data = $this->validate($request, [
@ -88,9 +82,6 @@ class PasswordResetController extends BaseController
return $this->showView('pages/password/reset-success', ['type' => 'email']);
}
/**
* @return Response
*/
public function resetPassword(Request $request): Response
{
$this->requireToken($request);
@ -101,9 +92,6 @@ class PasswordResetController extends BaseController
);
}
/**
* @return Response
*/
public function postResetPassword(Request $request): Response
{
$reset = $this->requireToken($request);
@ -127,7 +115,6 @@ class PasswordResetController extends BaseController
/**
* @param array $data
* @return Response
*/
protected function showView(string $view = 'pages/password/reset', array $data = []): Response
{
@ -137,9 +124,6 @@ class PasswordResetController extends BaseController
);
}
/**
* @return PasswordReset
*/
protected function requireToken(Request $request): PasswordReset
{
$token = $request->getAttribute('token');

View File

@ -48,9 +48,6 @@ class QuestionsController extends BaseController
$this->response = $response;
}
/**
* @return Response
*/
public function index(): Response
{
$questions = $this->question
@ -65,9 +62,6 @@ class QuestionsController extends BaseController
);
}
/**
* @return Response
*/
public function add(): Response
{
return $this->response->withView(
@ -76,10 +70,6 @@ class QuestionsController extends BaseController
);
}
/**
*
* @return Response
*/
public function delete(Request $request): Response
{
$data = $this->validate(
@ -103,10 +93,6 @@ class QuestionsController extends BaseController
return $this->redirect->to('/questions');
}
/**
*
* @return Response
*/
public function save(Request $request): Response
{
$data = $this->validate(

Some files were not shown because too many files have changed in this diff Show More