Skip to content

Commit 58d4207

Browse files
committed
Fixed phpstan issues
1 parent 390736c commit 58d4207

File tree

6 files changed

+9
-15
lines changed

6 files changed

+9
-15
lines changed

src/Command/CheckRequirementsCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ protected function checkPHP(SymfonyStyle $io, bool $only_issues = false): void
6969
if ($io->isVerbose()) {
7070
$io->comment('Checking PHP version...');
7171
}
72-
//We recommend PHP 8.2, but 8.1 is the minimum
73-
if (PHP_VERSION_ID < 80200) {
72+
//We recommend PHP 8.2, but 8.2 is the minimum
73+
if (PHP_VERSION_ID < 80400) {
7474
$io->warning('You are using PHP '. PHP_VERSION .'. This will work, but a newer version is recommended.');
7575
} elseif (!$only_issues) {
7676
$io->success('PHP version is sufficient.');
@@ -84,7 +84,7 @@ protected function checkPHP(SymfonyStyle $io, bool $only_issues = false): void
8484
$io->success('You are using a 64-bit system.');
8585
}
8686
} else {
87-
$io->warning('You are using a system with an unknown bit size. That is interesting xD');
87+
$io->warning(' areYou using a system with an unknown bit size. That is interesting xD');
8888
}
8989

9090
//Check if opcache is enabled

src/Command/Migrations/ImportPartKeeprCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(protected EntityManagerInterface $em, protected MySQ
4444
protected PKDatastructureImporter $datastructureImporter, protected PKPartImporter $partImporter, protected PKImportHelper $importHelper,
4545
protected PKOptionalImporter $optionalImporter)
4646
{
47-
parent::__construct(self::$defaultName);
47+
parent::__construct();
4848
}
4949

5050
protected function configure(): void

src/Command/User/UpgradePermissionsSchemaCommand.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,7 @@ final class UpgradePermissionsSchemaCommand extends Command
3939
{
4040
public function __construct(private readonly PermissionSchemaUpdater $permissionSchemaUpdater, private readonly EntityManagerInterface $em, private readonly EventCommentHelper $eventCommentHelper)
4141
{
42-
parent::__construct(self::$defaultName);
43-
}
44-
45-
protected function configure(): void
46-
{
47-
$this
48-
->setDescription(self::$defaultDescription)
49-
;
42+
parent::__construct();
5043
}
5144

5245
protected function execute(InputInterface $input, OutputInterface $output): int

src/Command/User/UsersPermissionsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(protected EntityManagerInterface $entityManager, pro
4646
{
4747
$this->userRepository = $entityManager->getRepository(User::class);
4848

49-
parent::__construct(self::$defaultName);
49+
parent::__construct();
5050
}
5151

5252
protected function configure(): void

src/Entity/Base/AbstractDBElement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
use App\Entity\Attachments\UserAttachment;
4040
use App\Entity\Parameters\AbstractParameter;
4141
use App\Entity\Parts\Category;
42+
use App\Entity\PriceInformations\Pricedetail;
4243
use App\Entity\ProjectSystem\Project;
4344
use App\Entity\ProjectSystem\ProjectBOMEntry;
4445
use App\Entity\Parts\Footprint;
@@ -67,7 +68,7 @@
6768
* Every database table which are managed with this class (or a subclass of it)
6869
* must have the table row "id"!! The ID is the unique key to identify the elements.
6970
*/
70-
#[DiscriminatorMap(typeProperty: 'type', mapping: ['attachment_type' => AttachmentType::class, 'attachment' => Attachment::class, 'attachment_type_attachment' => AttachmentTypeAttachment::class, 'category_attachment' => CategoryAttachment::class, 'currency_attachment' => CurrencyAttachment::class, 'footprint_attachment' => FootprintAttachment::class, 'group_attachment' => GroupAttachment::class, 'label_attachment' => LabelAttachment::class, 'manufacturer_attachment' => ManufacturerAttachment::class, 'measurement_unit_attachment' => MeasurementUnitAttachment::class, 'part_attachment' => PartAttachment::class, 'project_attachment' => ProjectAttachment::class, 'storelocation_attachment' => StorageLocationAttachment::class, 'supplier_attachment' => SupplierAttachment::class, 'user_attachment' => UserAttachment::class, 'category' => Category::class, 'project' => Project::class, 'project_bom_entry' => ProjectBOMEntry::class, 'footprint' => Footprint::class, 'group' => Group::class, 'manufacturer' => Manufacturer::class, 'orderdetail' => Orderdetail::class, 'part' => Part::class, 'pricedetail' => 'App\Entity\PriceInformation\Pricedetail', 'storelocation' => StorageLocation::class, 'part_lot' => PartLot::class, 'currency' => Currency::class, 'measurement_unit' => MeasurementUnit::class, 'parameter' => AbstractParameter::class, 'supplier' => Supplier::class, 'user' => User::class])]
71+
#[DiscriminatorMap(typeProperty: 'type', mapping: ['attachment_type' => AttachmentType::class, 'attachment' => Attachment::class, 'attachment_type_attachment' => AttachmentTypeAttachment::class, 'category_attachment' => CategoryAttachment::class, 'currency_attachment' => CurrencyAttachment::class, 'footprint_attachment' => FootprintAttachment::class, 'group_attachment' => GroupAttachment::class, 'label_attachment' => LabelAttachment::class, 'manufacturer_attachment' => ManufacturerAttachment::class, 'measurement_unit_attachment' => MeasurementUnitAttachment::class, 'part_attachment' => PartAttachment::class, 'project_attachment' => ProjectAttachment::class, 'storelocation_attachment' => StorageLocationAttachment::class, 'supplier_attachment' => SupplierAttachment::class, 'user_attachment' => UserAttachment::class, 'category' => Category::class, 'project' => Project::class, 'project_bom_entry' => ProjectBOMEntry::class, 'footprint' => Footprint::class, 'group' => Group::class, 'manufacturer' => Manufacturer::class, 'orderdetail' => Orderdetail::class, 'part' => Part::class, 'pricedetail' => Pricedetail::class, 'storelocation' => StorageLocation::class, 'part_lot' => PartLot::class, 'currency' => Currency::class, 'measurement_unit' => MeasurementUnit::class, 'parameter' => AbstractParameter::class, 'supplier' => Supplier::class, 'user' => User::class])]
7172
#[ORM\MappedSuperclass(repositoryClass: DBElementRepository::class)]
7273
abstract class AbstractDBElement implements JsonSerializable
7374
{

src/Services/ImportExportSystem/EntityExporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function exportEntityFromRequest(AbstractNamedDBElement|array $entities,
137137
$options = [
138138
'format' => $request->get('format') ?? 'json',
139139
'level' => $request->get('level') ?? 'extended',
140-
'include_children' => $request->request->getBoolean('include_children') ?? false,
140+
'include_children' => $request->request->getBoolean('include_children'),
141141
];
142142

143143
if (!is_array($entities)) {

0 commit comments

Comments
 (0)