mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 12:18:54 +02:00
Fixed PHPstan issues for level 5.
This commit is contained in:
parent
a9293b7ceb
commit
da72f5b3ec
24 changed files with 87 additions and 49 deletions
|
@ -86,7 +86,7 @@ class CleanAttachmentsCommand extends Command
|
|||
|
||||
$table = new Table($output);
|
||||
$table->setHeaders(['Filename', 'MIME Type', 'Last modified date']);
|
||||
$dateformatter = IntlDateFormatter::create(null, IntlDateFormatter::SHORT, IntlDateFormatter::SHORT);
|
||||
$dateformatter = IntlDateFormatter::create(\Locale::getDefault(), IntlDateFormatter::SHORT, IntlDateFormatter::SHORT);
|
||||
|
||||
foreach ($finder as $file) {
|
||||
//If not attachment object uses this file, print it
|
||||
|
|
|
@ -64,14 +64,15 @@ class SetPasswordCommand extends Command
|
|||
|
||||
/** @var User[] $users */
|
||||
$users = $this->entityManager->getRepository(User::class)->findBy(['name' => $user_name]);
|
||||
$user = $users[0];
|
||||
|
||||
if (null === $user) {
|
||||
if (empty($users)) {
|
||||
$io->error(sprintf('No user with the given username %s found in the database!', $user_name));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$user = $users[0];
|
||||
|
||||
$io->note('User found!');
|
||||
|
||||
$proceed = $io->confirm(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue