diff --git a/.github/user_feature_request.md b/.github/user_feature_request.md index 6eb8ddc..c9595e8 100755 --- a/.github/user_feature_request.md +++ b/.github/user_feature_request.md @@ -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. diff --git a/Admin/Installer.php b/Admin/Installer.php index 28f140e..62cbd66 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -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); } /** diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 3e5bd3c..870a417 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -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, diff --git a/Models/ClientAttributeMapper.php b/Models/ClientAttributeMapper.php index e979d41..9cc4ecd 100755 --- a/Models/ClientAttributeMapper.php +++ b/Models/ClientAttributeMapper.php @@ -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 */ 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 * @since 1.0.0 */ public const MODEL = Attribute::class; diff --git a/Models/ClientAttributeTypeL11nMapper.php b/Models/ClientAttributeTypeL11nMapper.php index 823b309..2708dfb 100755 --- a/Models/ClientAttributeTypeL11nMapper.php +++ b/Models/ClientAttributeTypeL11nMapper.php @@ -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 */ 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 * @since 1.0.0 */ public const MODEL = BaseStringL11n::class; diff --git a/Models/ClientAttributeTypeMapper.php b/Models/ClientAttributeTypeMapper.php index 5a4ac1f..9a02b48 100755 --- a/Models/ClientAttributeTypeMapper.php +++ b/Models/ClientAttributeTypeMapper.php @@ -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 */ 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 * @since 1.0.0 */ public const MODEL = AttributeType::class; diff --git a/Models/ClientAttributeValueL11nMapper.php b/Models/ClientAttributeValueL11nMapper.php index ec8c5c4..6904ad8 100755 --- a/Models/ClientAttributeValueL11nMapper.php +++ b/Models/ClientAttributeValueL11nMapper.php @@ -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 */ 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 * @since 1.0.0 */ public const MODEL = BaseStringL11n::class; diff --git a/Models/ClientAttributeValueMapper.php b/Models/ClientAttributeValueMapper.php index 69fafcd..1a97952 100755 --- a/Models/ClientAttributeValueMapper.php +++ b/Models/ClientAttributeValueMapper.php @@ -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 */ 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 * @since 1.0.0 */ public const MODEL = AttributeValue::class; diff --git a/Models/ClientL11nMapper.php b/Models/ClientL11nMapper.php index c1c5f28..e421b57 100755 --- a/Models/ClientL11nMapper.php +++ b/Models/ClientL11nMapper.php @@ -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 */ final class ClientL11nMapper extends DataMapperFactory { diff --git a/Models/ClientL11nTypeMapper.php b/Models/ClientL11nTypeMapper.php index c80927b..a489445 100755 --- a/Models/ClientL11nTypeMapper.php +++ b/Models/ClientL11nTypeMapper.php @@ -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 */ final class ClientL11nTypeMapper extends DataMapperFactory { diff --git a/Models/ClientMapper.php b/Models/ClientMapper.php index c91eefe..2fde67e 100755 --- a/Models/ClientMapper.php +++ b/Models/ClientMapper.php @@ -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 */ final class ClientMapper extends DataMapperFactory {