Skip to content

Commit

Permalink
Updated PHPDocs using messages from PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Oct 17, 2024
1 parent 01e7fcc commit 9eb3959
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
18 changes: 10 additions & 8 deletions build/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
parameters:
paths:
- ../src
- ../tests
level: 5
treatPhpDocTypesAsCertain: false
excludePaths:
- ../src/entities/*
parameters:
paths:
- ../src
- ../tests
level: 5
treatPhpDocTypesAsCertain: false
excludePaths:
- ../src/entities/*
- ../tests/testcases/issues/Issue32Test.php
- ../src/quick/ZugferdQuickDescriptor.php
3 changes: 1 addition & 2 deletions src/ZugferdDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use GoetasWebservices\Xsd\XsdToPhpRuntime\Jms\Handler\BaseTypesHandler;
use GoetasWebservices\Xsd\XsdToPhpRuntime\Jms\Handler\XmlSchemaDateHandler;
use horstoeko\stringmanagement\PathUtils;
use horstoeko\zugferd\entities\en16931\rsm\CrossIndustryInvoiceType;
use horstoeko\zugferd\exception\ZugferdUnknownProfileParameterException;
use horstoeko\zugferd\jms\ZugferdTypesHandler;
use horstoeko\zugferd\ZugferdObjectHelper;
Expand Down Expand Up @@ -58,7 +57,7 @@ class ZugferdDocument

/**
* @internal
* @var CrossIndustryInvoiceType The internal invoice object
* @var \horstoeko\zugferd\entities\basic\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\basicwl\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\en16931\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\extended\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\minimum\rsm\CrossIndustryInvoice The internal invoice object
*/
private $invoiceObject = null;

Expand Down
2 changes: 1 addition & 1 deletion src/ZugferdDocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function initDocumentSummation(): ZugferdDocumentBuilder
*
* @param string $foreignCurrencyCode __BT-6, From BASIC WL__ Foreign currency code
* @param float $foreignTaxAmount __BT-, From __ Required from EXTENDED Tax total amount in the foreign currency
* @param float|null $foreignTaxAmount __BT-X-260, From EXTENDED __ Exchange Rate
* @param float|null $exchangeRate __BT-X-260, From EXTENDED __ Exchange Rate
* @return ZugferdDocumentBuilder
*/
public function setForeignCurrency(string $foreignCurrencyCode, float $foreignTaxAmount, ?float $exchangeRate = null): ZugferdDocumentBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/ZugferdObjectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ public function getTradeCountryType(?string $id = null): ?object
/**
* Undocumented function
*
* @return \horstoeko\zugferd\entities\basic\rsm\CrossIndustryInvoiceType|\horstoeko\zugferd\entities\basicwl\rsm\CrossIndustryInvoiceType|\horstoeko\zugferd\entities\en16931\rsm\CrossIndustryInvoiceType|\horstoeko\zugferd\entities\extended\rsm\CrossIndustryInvoiceType
* @return \horstoeko\zugferd\entities\basic\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\basicwl\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\en16931\rsm\CrossIndustryInvoice|\horstoeko\zugferd\entities\extended\rsm\CrossIndustryInvoice
*/
public function getCrossIndustryInvoice()
{
Expand Down
6 changes: 5 additions & 1 deletion tests/testcases/ObjectHelperExtendedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,11 @@ public function testGetTaxApplicableTradeCurrencyExchangeType(): void
$this->assertNotNull($currencyExchangeType);
$this->assertEquals("EUR", $currencyExchangeType->getSourceCurrencyCode());
$this->assertEquals("USD", $currencyExchangeType->getTargetCurrencyCode());
$this->assertEquals(10.0, $currencyExchangeType->getConversionRate()->value());
/**
* @var \horstoeko\zugferd\entities\extended\udt\RateType
*/
$rate = $currencyExchangeType->getConversionRate();
$this->assertEquals(10.0, $rate->value());
$this->assertEquals("20180305", $currencyExchangeType->getConversionRateDateTime()->getDateTimeString()->value());
$this->assertEquals("102", $currencyExchangeType->getConversionRateDateTime()->getDateTimeString()->getFormat());

Expand Down

0 comments on commit 9eb3959

Please sign in to comment.