rechtlogisch/steuer-id
最新稳定版本:v1.3.0
Composer 安装命令:
composer require rechtlogisch/steuer-id
包简介
Validates the German Tax-ID (Steuerliche Identifikationsnummer)
README 文档
README
steuer-id
Validates the German Tax-ID (Steuerliche Identifikationsnummer)
Based on the official ELSTER documentation (chapter: 2; as of 2025-02-24).
Note
This package validates solely the syntax and check digit of the provided input. It does not confirm, that the validated Steuer-ID was assigned to a person. Please contact the Bundeszentralamt für Steuern in case you are unsure about your Steuer-ID.
Installation
You can install the package via composer:
composer require rechtlogisch/steuer-id
Usage
isSteuerIdValid('02476291358'); // => true
or
use Rechtlogisch\SteuerId\SteuerId; (new SteuerId('02476291358')) ->validate() // ValidationResult::class ->isValid(); // => true
Test-Steuer-IDs
Support for test Steuer-IDs (starting with 0) is enabled by default. Test Steuer-IDs are typically invalid in production. It is recommended to disable them with the following environment variable:
STEUERID_PRODUCTION=true
or in PHP:
putenv('STEUERID_PRODUCTION=true');
Validation errors
You can get a list of errors explaining why the provided input is invalid. The validate() method returns a DTO with a getErrors() method.
Note
The keys of getErrors() hold the stringified reference to the exception class. You can check for a particular error by comparing to the ::class constant. For example: Rechtlogisch\UstId\Exceptions\InvalidUstIdLength::class.
validateSteuerId('x2476291358')->getErrors(); // [ // 'Rechtlogisch\SteuerId\Exceptions\SteuerIdCanContainOnlyDigits' // => ['Only digits are allowed.'] // ]
or
use Rechtlogisch\SteuerId\SteuerId; (new SteuerId('x2476291358')) ->validate() // ValidationResult::class ->getErrors(); // [ // 'Rechtlogisch\SteuerId\Exceptions\SteuerIdCanContainOnlyDigits' // => ['Only digits are allowed.'] // ]
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
If you discover any security-related issues, please email open-source@rechtlogisch.de instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 426
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-14
