fix static analysis

This commit is contained in:
Dennis Eichhorn 2023-04-11 00:20:12 +02:00
parent cb0f6c1f49
commit 3afb200021
11 changed files with 44 additions and 8 deletions

View File

@ -8,11 +8,14 @@ assignees: ''
---
# What is the feature you request
* A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
* A clear and concise description of what you want to happen.
# Alternatives
A clear and concise description of any alternative solutions or features you've considered.
# Additional Information
Add any other context or screenshots about the feature request here.

View File

@ -53,7 +53,12 @@ final class Installer extends InstallerAbstract
return;
}
/** @var array $attributes */
$attributes = \json_decode($fileContent, true);
if ($attributes === false) {
return;
}
$attrTypes = self::createClientAttributeTypes($app, $attributes);
$attrValues = self::createClientAttributeValues($app, $attrTypes, $attributes);
@ -63,8 +68,13 @@ final class Installer extends InstallerAbstract
return;
}
/** @var array $localizations */
$localizations = \json_decode($fileContent, true);
$l11nTypes = self::createClientL11nTypes($app, $localizations);
if ($localizations === false) {
return;
}
$l11nTypes = self::createClientL11nTypes($app, $localizations);
}
/**

View File

@ -129,7 +129,7 @@ final class ApiController extends Controller
if (\in_array($client->mainAddress->getCountry(), ISO3166CharEnum::getRegion('eu'))) {
$validate = EUVATVies::validateQualified(
$request->getDataString('vat_id') ?? '',
$unit->getAttribute('vat_id')?->value->getValue() ?? '',
$unit->getAttribute('vat_id')?->value->valueStr ?? '',
$client->account->name1,
$client->mainAddress->city,
$client->mainAddress->postal,

View File

@ -24,6 +24,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of Attribute
* @extends DataMapperFactory<T>
*/
final class ClientAttributeMapper extends DataMapperFactory
{
@ -60,7 +63,7 @@ final class ClientAttributeMapper extends DataMapperFactory
/**
* Model to use by the mapper.
*
* @var class-string
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = Attribute::class;

View File

@ -24,6 +24,9 @@ use phpOMS\Localization\BaseStringL11n;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of BaseStringL11n
* @extends DataMapperFactory<T>
*/
final class ClientAttributeTypeL11nMapper extends DataMapperFactory
{
@ -59,7 +62,7 @@ final class ClientAttributeTypeL11nMapper extends DataMapperFactory
/**
* Model to use by the mapper.
*
* @var class-string
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = BaseStringL11n::class;

View File

@ -24,6 +24,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of AttributeType
* @extends DataMapperFactory<T>
*/
final class ClientAttributeTypeMapper extends DataMapperFactory
{
@ -68,7 +71,7 @@ final class ClientAttributeTypeMapper extends DataMapperFactory
/**
* Model to use by the mapper.
*
* @var class-string
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = AttributeType::class;

View File

@ -24,6 +24,9 @@ use phpOMS\Localization\BaseStringL11n;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of BaseStringL11n
* @extends DataMapperFactory<T>
*/
final class ClientAttributeValueL11nMapper extends DataMapperFactory
{
@ -59,7 +62,7 @@ final class ClientAttributeValueL11nMapper extends DataMapperFactory
/**
* Model to use by the mapper.
*
* @var class-string
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = BaseStringL11n::class;

View File

@ -24,6 +24,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of AttributeValue
* @extends DataMapperFactory<T>
*/
final class ClientAttributeValueMapper extends DataMapperFactory
{
@ -63,7 +66,7 @@ final class ClientAttributeValueMapper extends DataMapperFactory
/**
* Model to use by the mapper.
*
* @var class-string
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = AttributeValue::class;

View File

@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of BaseStringL11n
* @extends DataMapperFactory<T>
*/
final class ClientL11nMapper extends DataMapperFactory
{

View File

@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of ClientL11nType
* @extends DataMapperFactory<T>
*/
final class ClientL11nTypeMapper extends DataMapperFactory
{

View File

@ -20,7 +20,6 @@ use Modules\Editor\Models\EditorDocMapper;
use Modules\Media\Models\MediaMapper;
use Modules\Payment\Models\PaymentMapper;
use Modules\Profile\Models\ContactElementMapper;
use Modules\Profile\Models\ProfileMapper;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
/**
@ -30,6 +29,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of Client
* @extends DataMapperFactory<T>
*/
final class ClientMapper extends DataMapperFactory
{