Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/composer.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:

- name: PHPUnit
run: docker compose exec -e APP_ENV=testing -T api vendor/bin/phpunit
- name: Psalm
run: docker compose exec -T api vendor/bin/psalm
- name: Linting
run: docker compose exec api vendor/bin/pint --test -v

Expand Down
3 changes: 0 additions & 3 deletions app/EventPageUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class EventPageUpdate extends Model {
'namespace',
];

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsTo<Wiki>
*/
public function wiki(): \Illuminate\Database\Eloquent\Relations\BelongsTo {
return $this->belongsTo(Wiki::class);
}
Expand Down
3 changes: 0 additions & 3 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ public function register(Request $request) {

event(new Registered($user));

/**
* @psalm-suppress UndefinedInterfaceMethod
*/
Auth::guard()->login($user);

// HTTP Response
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/WikiSettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
class WikiSettingController extends Controller {
/**
* @return (SettingWikibaseManifestEquivEntities|string)[][]
*
* @psalm-return array{wgDefaultSkin: array{0: 'required', 1: 'string', 2: 'in:vector,modern,timeless'}, wwExtEnableConfirmAccount: array{0: 'required', 1: 'boolean'}, wwExtEnableWikibaseLexeme: array{0: 'required', 1: 'boolean'}, wwWikibaseStringLengthString: array{0: 'required', 1: 'integer', 2: 'between:400,2500'}, wwWikibaseStringLengthMonolingualText: array{0: 'required', 1: 'integer', 2: 'between:400,2500'}, wwWikibaseStringLengthMultilang: array{0: 'required', 1: 'integer', 2: 'between:250,2500'}, wikibaseFedPropsEnable: array{0: 'required', 1: 'boolean'}, wikibaseManifestEquivEntities: array{0: 'required', 1: 'json', 2: SettingWikibaseManifestEquivEntities}, wwUseQuestyCaptcha: array{0: 'required, 1: 'boolean}, wwCaptchaQuestions: array:{0: 'required', 1: 'json', 2: SettingCaptchaQuestions}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only thing I feel is a bit sad to lose but I think retaining it isn't worth it

*/
private function getSettingValidations(): array {
// FIXME: this list is evil and should be kept in sync with the model in Wiki.php?! (mostly)
Expand Down
3 changes: 0 additions & 3 deletions app/Jobs/DeleteWikiDbJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ public function handle(DatabaseManager $manager) {
$replacedCount = 0;
$tableWithoutPrefix = str_replace($wikiDB->prefix . '_', '', $table, $replacedCount);
if ($replacedCount !== 1) {
/**
* @psalm-suppress InvalidCast
*/
throw new \RuntimeException("Did not find prefix '{$wikiDB->prefix}' in tablename '{$table}' ");
}
$pdo->exec(sprintf('RENAME TABLE %s.%s TO %s.%s', $wikiDB->name, $table, $deletedDatabaseName, $tableWithoutPrefix));
Expand Down
3 changes: 0 additions & 3 deletions app/QsBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class QsBatch extends Model {
'pending_since' => 'datetime',
];

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsTo<Wiki>
*/
public function wiki(): \Illuminate\Database\Eloquent\Relations\BelongsTo {
return $this->belongsTo(Wiki::class);
}
Expand Down
3 changes: 0 additions & 3 deletions app/QueryserviceNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ class QueryserviceNamespace extends Model {
'backend',
];

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsTo<Wiki>
*/
public function wiki(): \Illuminate\Database\Eloquent\Relations\BelongsTo {
return $this->belongsTo(Wiki::class);
}
Expand Down
3 changes: 0 additions & 3 deletions app/Rules/SettingCaptchaQuestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ public function passes($attribute, $value) {
if (!is_string($question)) {
return false;
}
/**
* @psalm-suppress NoValue
*/
if (strlen($question) > 200) {
return false;
}
Expand Down
3 changes: 0 additions & 3 deletions app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ public function sendPasswordResetNotification($token) {
$this->notify(new ResetPasswordNotification($token));
}

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Wiki>
*/
public function managesWikis(): \Illuminate\Database\Eloquent\Relations\BelongsToMany {
return $this->belongsToMany(Wiki::class, 'wiki_managers');
}
Expand Down
3 changes: 0 additions & 3 deletions app/UserVerificationToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class UserVerificationToken extends Model {
'token',
];

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsTo<User>
*/
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo {
return $this->belongsTo(User::class);
}
Expand Down
15 changes: 0 additions & 15 deletions app/Wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,11 @@ class Wiki extends Model {
];

public function wikiDbVersion() {
/**
* @psalm-suppress InvalidArgument
*/
return $this->hasOne(WikiDb::class)->select(['id', 'wiki_id', 'version']);
}

// TODO these should just be on the backend model? =] Or marked as a private relationship or something?
// OR some sort of access control needs to be done..
/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\HasOne<WikiDb>
*/
public function wikiDb(): \Illuminate\Database\Eloquent\Relations\HasOne {
return $this->hasOne(WikiDb::class);
}
Expand All @@ -105,17 +99,11 @@ public function wikiManagers(): \Illuminate\Database\Eloquent\Relations\HasMany
return $this->hasMany(WikiManager::class);
}

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\HasOne<QueryserviceNamespace>
*/
public function wikiQueryserviceNamespace(): \Illuminate\Database\Eloquent\Relations\HasOne {
return $this->hasOne(QueryserviceNamespace::class);
}

// FIXME: rename to privateSettings / allSettings for clarity?
/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\HasMany<WikiSetting>
*/
public function settings(): \Illuminate\Database\Eloquent\Relations\HasMany {
return $this->hasMany(WikiSetting::class);
}
Expand All @@ -142,9 +130,6 @@ public function publicSettings() {

public function wikiManagersWithEmail() {
// TODO should this be hasMany ?
/**
* @psalm-suppress InvalidArgument
*/
return $this->belongsToMany(User::class, 'wiki_managers')->select(['email']);
}

Expand Down
3 changes: 0 additions & 3 deletions app/WikiDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ class WikiDb extends Model {
'wiki_id',
];

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsTo<Wiki>
*/
public function wiki(): \Illuminate\Database\Eloquent\Relations\BelongsTo {
return $this->belongsTo(Wiki::class);
}
Expand Down
3 changes: 0 additions & 3 deletions app/WikiDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ class WikiDomain extends Model {
'wiki_id',
];

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\HasOne<Wiki>
*/
public function wiki(): \Illuminate\Database\Eloquent\Relations\HasOne {
return $this->hasOne(Wiki::class);
}
Expand Down
6 changes: 0 additions & 6 deletions app/WikiManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,10 @@ class WikiManager extends Model {
];

// TODO remove these relationships if they are not used...
/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsTo<Wiki>
*/
public function wiki(): \Illuminate\Database\Eloquent\Relations\BelongsTo {
return $this->belongsTo(Wiki::class);
}

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsTo<User>
*/
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo {
return $this->belongsTo(User::class);
}
Expand Down
3 changes: 0 additions & 3 deletions app/WikiSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ class WikiSetting extends Model {
'value',
];

/**
* @psalm-return \Illuminate\Database\Eloquent\Relations\BelongsTo<Wiki>
*/
public function wiki(): \Illuminate\Database\Eloquent\Relations\BelongsTo {
return $this->belongsTo(Wiki::class);
}
Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
"laravel/pint": "^1.22",
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^10.5",
"psalm/plugin-laravel": "^2.8",
"timacdonald/log-fake": "^2.1",
"vimeo/psalm": "^5.19"
"timacdonald/log-fake": "^2.1"
},
"autoload": {
"classmap": [
Expand All @@ -64,10 +62,9 @@
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"test": [
"@psalm",
"@pint",
"@phpunit"
],
"psalm": "vendor/bin/psalm",
"phpunit": "vendor/bin/phpunit",
"pint": "vendor/bin/pint"
},
Expand Down
Loading
Loading