mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 17:34:32 +02:00
Fixed phpstan issues
This commit is contained in:
parent
afcbbe0f43
commit
3a8c5a788f
11 changed files with 25 additions and 124 deletions
|
@ -231,7 +231,7 @@ final class DTOtoEntityConverter
|
|||
* @phpstan-param class-string<T> $class
|
||||
* @param string $name The name of the entity to create
|
||||
* @return AbstractStructuralDBElement
|
||||
* @phpstan-return T|null
|
||||
* @phpstan-return T
|
||||
*/
|
||||
private function getOrCreateEntityNonNull(string $class, string $name): AbstractStructuralDBElement
|
||||
{
|
||||
|
@ -263,7 +263,7 @@ final class DTOtoEntityConverter
|
|||
$tmp = $this->em->getRepository(AttachmentType::class)->findOrCreateForInfoProvider(self::TYPE_DATASHEETS_NAME);
|
||||
|
||||
//If the entity was newly created, set the file filter
|
||||
if ($tmp->getId() === null) {
|
||||
if ($tmp->getID() === null) {
|
||||
$tmp->setFiletypeFilter('application/pdf');
|
||||
$tmp->setAlternativeNames(self::TYPE_DATASHEETS_NAME);
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ final class DTOtoEntityConverter
|
|||
$tmp = $this->em->getRepository(AttachmentType::class)->findOrCreateForInfoProvider(self::TYPE_IMAGE_NAME);
|
||||
|
||||
//If the entity was newly created, set the file filter
|
||||
if ($tmp->getId() === null) {
|
||||
if ($tmp->getID() === null) {
|
||||
$tmp->setFiletypeFilter('image/*');
|
||||
$tmp->setAlternativeNames(self::TYPE_DATASHEETS_NAME);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ final class PartInfoRetriever
|
|||
* The result is cached for 4 days.
|
||||
* @param string $provider_key
|
||||
* @param string $part_id
|
||||
* @return
|
||||
* @return PartDetailDTO
|
||||
*/
|
||||
public function getDetails(string $provider_key, string $part_id): PartDetailDTO
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ final class ProviderRegistry
|
|||
/**
|
||||
* @param iterable<InfoProviderInterface> $providers
|
||||
*/
|
||||
public function __construct(private readonly iterable $providers)
|
||||
public function __construct(iterable $providers)
|
||||
{
|
||||
foreach ($providers as $provider) {
|
||||
$key = $provider->getProviderKey();
|
||||
|
|
|
@ -243,9 +243,9 @@ class Element14Provider implements InfoProviderInterface
|
|||
|
||||
/**
|
||||
* @param array|null $attributes
|
||||
* @return ParameterDTO[]|null
|
||||
* @return ParameterDTO[]
|
||||
*/
|
||||
private function attributesToParameters(?array $attributes): ?array
|
||||
private function attributesToParameters(?array $attributes): array
|
||||
{
|
||||
$result = [];
|
||||
|
||||
|
@ -258,7 +258,7 @@ class Element14Provider implements InfoProviderInterface
|
|||
}
|
||||
|
||||
//tariffCode is a special case, we prepend a # to prevent conversion to float
|
||||
if (in_array($attribute['attributeLabel'], ['tariffCode', 'hazardCode'])) {
|
||||
if (in_array($attribute['attributeLabel'], ['tariffCode', 'hazardCode'], true)) {
|
||||
$attribute['attributeValue'] = '#' . $attribute['attributeValue'];
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class TMEProvider implements InfoProviderInterface
|
|||
public function __construct(private readonly TMEClient $tmeClient, private readonly string $country,
|
||||
private readonly string $language, private readonly string $currency,
|
||||
/** @var bool If true, the prices are gross prices. If false, the prices are net prices. */
|
||||
private readonly string $get_gross_prices)
|
||||
private readonly bool $get_gross_prices)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue