mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-29 14:28:42 +02:00
Fixed phpstan issues
This commit is contained in:
parent
390736cf5a
commit
58d4207b49
6 changed files with 9 additions and 15 deletions
|
@ -69,8 +69,8 @@ class CheckRequirementsCommand extends Command
|
||||||
if ($io->isVerbose()) {
|
if ($io->isVerbose()) {
|
||||||
$io->comment('Checking PHP version...');
|
$io->comment('Checking PHP version...');
|
||||||
}
|
}
|
||||||
//We recommend PHP 8.2, but 8.1 is the minimum
|
//We recommend PHP 8.2, but 8.2 is the minimum
|
||||||
if (PHP_VERSION_ID < 80200) {
|
if (PHP_VERSION_ID < 80400) {
|
||||||
$io->warning('You are using PHP '. PHP_VERSION .'. This will work, but a newer version is recommended.');
|
$io->warning('You are using PHP '. PHP_VERSION .'. This will work, but a newer version is recommended.');
|
||||||
} elseif (!$only_issues) {
|
} elseif (!$only_issues) {
|
||||||
$io->success('PHP version is sufficient.');
|
$io->success('PHP version is sufficient.');
|
||||||
|
@ -84,7 +84,7 @@ class CheckRequirementsCommand extends Command
|
||||||
$io->success('You are using a 64-bit system.');
|
$io->success('You are using a 64-bit system.');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$io->warning('You are using a system with an unknown bit size. That is interesting xD');
|
$io->warning(' areYou using a system with an unknown bit size. That is interesting xD');
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if opcache is enabled
|
//Check if opcache is enabled
|
||||||
|
|
|
@ -44,7 +44,7 @@ class ImportPartKeeprCommand extends Command
|
||||||
protected PKDatastructureImporter $datastructureImporter, protected PKPartImporter $partImporter, protected PKImportHelper $importHelper,
|
protected PKDatastructureImporter $datastructureImporter, protected PKPartImporter $partImporter, protected PKImportHelper $importHelper,
|
||||||
protected PKOptionalImporter $optionalImporter)
|
protected PKOptionalImporter $optionalImporter)
|
||||||
{
|
{
|
||||||
parent::__construct(self::$defaultName);
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configure(): void
|
protected function configure(): void
|
||||||
|
|
|
@ -39,14 +39,7 @@ final class UpgradePermissionsSchemaCommand extends Command
|
||||||
{
|
{
|
||||||
public function __construct(private readonly PermissionSchemaUpdater $permissionSchemaUpdater, private readonly EntityManagerInterface $em, private readonly EventCommentHelper $eventCommentHelper)
|
public function __construct(private readonly PermissionSchemaUpdater $permissionSchemaUpdater, private readonly EntityManagerInterface $em, private readonly EventCommentHelper $eventCommentHelper)
|
||||||
{
|
{
|
||||||
parent::__construct(self::$defaultName);
|
parent::__construct();
|
||||||
}
|
|
||||||
|
|
||||||
protected function configure(): void
|
|
||||||
{
|
|
||||||
$this
|
|
||||||
->setDescription(self::$defaultDescription)
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
|
|
|
@ -46,7 +46,7 @@ class UsersPermissionsCommand extends Command
|
||||||
{
|
{
|
||||||
$this->userRepository = $entityManager->getRepository(User::class);
|
$this->userRepository = $entityManager->getRepository(User::class);
|
||||||
|
|
||||||
parent::__construct(self::$defaultName);
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configure(): void
|
protected function configure(): void
|
||||||
|
|
|
@ -39,6 +39,7 @@ use App\Entity\Attachments\SupplierAttachment;
|
||||||
use App\Entity\Attachments\UserAttachment;
|
use App\Entity\Attachments\UserAttachment;
|
||||||
use App\Entity\Parameters\AbstractParameter;
|
use App\Entity\Parameters\AbstractParameter;
|
||||||
use App\Entity\Parts\Category;
|
use App\Entity\Parts\Category;
|
||||||
|
use App\Entity\PriceInformations\Pricedetail;
|
||||||
use App\Entity\ProjectSystem\Project;
|
use App\Entity\ProjectSystem\Project;
|
||||||
use App\Entity\ProjectSystem\ProjectBOMEntry;
|
use App\Entity\ProjectSystem\ProjectBOMEntry;
|
||||||
use App\Entity\Parts\Footprint;
|
use App\Entity\Parts\Footprint;
|
||||||
|
@ -67,7 +68,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||||
* Every database table which are managed with this class (or a subclass of it)
|
* Every database table which are managed with this class (or a subclass of it)
|
||||||
* must have the table row "id"!! The ID is the unique key to identify the elements.
|
* must have the table row "id"!! The ID is the unique key to identify the elements.
|
||||||
*/
|
*/
|
||||||
#[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])]
|
#[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])]
|
||||||
#[ORM\MappedSuperclass(repositoryClass: DBElementRepository::class)]
|
#[ORM\MappedSuperclass(repositoryClass: DBElementRepository::class)]
|
||||||
abstract class AbstractDBElement implements JsonSerializable
|
abstract class AbstractDBElement implements JsonSerializable
|
||||||
{
|
{
|
||||||
|
|
|
@ -137,7 +137,7 @@ class EntityExporter
|
||||||
$options = [
|
$options = [
|
||||||
'format' => $request->get('format') ?? 'json',
|
'format' => $request->get('format') ?? 'json',
|
||||||
'level' => $request->get('level') ?? 'extended',
|
'level' => $request->get('level') ?? 'extended',
|
||||||
'include_children' => $request->request->getBoolean('include_children') ?? false,
|
'include_children' => $request->request->getBoolean('include_children'),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!is_array($entities)) {
|
if (!is_array($entities)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue