Skip to content

Commit

Permalink
Merge branch 'hotfix/0.12.13' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerendir committed Oct 19, 2024
2 parents 0afde19 + bee646a commit 72f2da8
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .baseline-phan.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
// PhanTypeMismatchArgumentSuperType : 4 occurrences
// PhanTypeMismatchArgumentNullable : 3 occurrences
// PhanUnusedPublicFinalMethodParameter : 3 occurrences
// PhanWriteOnlyPrivateProperty : 3 occurrences
// PhanCompatibleUnionType : 2 occurrences
// PhanTypeArraySuspicious : 2 occurrences
// PhanTypeMismatchDimAssignment : 2 occurrences
// PhanUndeclaredTypeParameter : 2 occurrences
// PhanUnusedVariable : 2 occurrences
// PhanWriteOnlyPrivateProperty : 2 occurrences
// ConstReferenceClassNotImported : 1 occurrence
// PhanAccessClassInternal : 1 occurrence
// PhanCompatiblePHP7 : 1 occurrence
Expand Down Expand Up @@ -73,7 +73,7 @@
'src/Model/Feature/Subscribed/SubscribedBooleanFeature.php' => ['PhanUnreferencedPrivateProperty'],
'src/Model/Feature/Subscribed/SubscribedCountableFeature.php' => ['ConstReferenceClassNotImported', 'PhanUndeclaredMethod'],
'src/Model/Feature/Subscribed/SubscribedFeaturesCollection.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDeclaredReturn', 'PhanUnreferencedProtectedMethod'],
'src/Model/Feature/Subscribed/SubscribedRechargeableFeature.php' => ['PhanCompatibleUnionType', 'PhanTypeMismatchReturnSuperType', 'PhanWriteOnlyPrivateProperty'],
'src/Model/Feature/Subscribed/SubscribedRechargeableFeature.php' => ['PhanCompatibleUnionType', 'PhanTypeMismatchReturnSuperType'],
'src/Model/Invoice.php' => ['PhanDeprecatedFunction', 'PhanParamSignatureMismatch', 'PhanTypeArraySuspicious', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimAssignment', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnNullable'],
'src/Model/InvoiceInterface.php' => ['PhanUnextractableAnnotationElementName', 'PhanUnextractableAnnotationSuffix'],
'src/Model/InvoiceLine.php' => ['PhanPossiblyNullTypeMismatchProperty'],
Expand Down
65 changes: 65 additions & 0 deletions .baseline-phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,46 @@ parameters:
count: 1
path: src/Model/Feature/Subscribed/SubscribedBooleanFeature.php

-
message: "#^Class DateTime is unsafe to use\\. Its methods can return FALSE instead of throwing an exception\\. Please add 'use Safe\\\\DateTime;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library\\.$#"
count: 6
path: src/Model/Feature/Subscribed/SubscribedCountableFeature.php

-
message: "#^Instanceof between SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedCountableFeaturePack and SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Configured\\\\ConfiguredCountableFeaturePack will always evaluate to false\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedCountableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedCountableFeature\\:\\:RecurringFeatureConstruct\\(\\) has parameter \\$details with no value type specified in iterable type array\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedCountableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedCountableFeature\\:\\:__construct\\(\\) has parameter \\$details with no value type specified in iterable type array\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedCountableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedCountableFeature\\:\\:consumedToArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedCountableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedCountableFeature\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedCountableFeature.php

-
message: "#^Strict comparison using \\=\\=\\= between null and DateTimeInterface will always evaluate to false\\.$#"
count: 2
path: src/Model/Feature/Subscribed/SubscribedCountableFeature.php

-
message: "#^Strict comparison using \\=\\=\\= between null and int will always evaluate to false\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedCountableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedFeaturePack\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -515,6 +555,31 @@ parameters:
count: 1
path: src/Model/Feature/Subscribed/SubscribedFeaturesCollection.php

-
message: "#^Class DateTime is unsafe to use\\. Its methods can return FALSE instead of throwing an exception\\. Please add 'use Safe\\\\DateTime;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library\\.$#"
count: 2
path: src/Model/Feature/Subscribed/SubscribedRechargeableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedRechargeableFeature\\:\\:__construct\\(\\) has parameter \\$details with no value type specified in iterable type array\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedRechargeableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedRechargeableFeature\\:\\:consumedToArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedRechargeableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedRechargeableFeature\\:\\:setLastRechargedOn\\(\\) has parameter \\$lastRechargeOn with no value type specified in iterable type array\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedRechargeableFeature.php

-
message: "#^Method SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\Feature\\\\Subscribed\\\\SubscribedRechargeableFeature\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Model/Feature/Subscribed/SubscribedRechargeableFeature.php

-
message: "#^Cannot access offset '_header' on SerendipityHQ\\\\Bundle\\\\FeaturesBundle\\\\Model\\\\InvoiceSection\\.$#"
count: 1
Expand Down
3 changes: 0 additions & 3 deletions .baseline-psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,6 @@
<PropertyNotSetInConstructor>
<code><![CDATA[$rechargingPack]]></code>
</PropertyNotSetInConstructor>
<RedundantCondition>
<code><![CDATA[null !== $this->rechargingPack]]></code>
</RedundantCondition>
</file>
<file src="src/Model/Invoice.php">
<ArgumentTypeCoercion>
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Feature/Property/CanBeConsumedProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
trait CanBeConsumedProperty
{
/** @var int $consumedQuantity How many units are consumed at this time */
private $consumedQuantity = 0;
private int $consumedQuantity = 0;

/** @var int $remaining The num of units remained from the last subscription cycle */
private $remainedQuantity = 0;
private int $remainedQuantity = 0;

public function consume(int $quantity): CanBeConsumedInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Model/Feature/Subscribed/SubscribedCountableFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ final class SubscribedCountableFeature extends AbstractSubscribedFeature impleme
public const FIELD_SUBSCRIBED_PACK = 'subscribed_pack';
public const FIELD_SUBSCRIBED_NUM_OF_UNITS = 'num_of_units';

/** @var int $previousRemainedQuantity Internally used by cumulate() */
private int $previousRemainedQuantity = 0;

public int $previousRemainedQuantity = 0;
private \DateTimeInterface $lastRefreshOn;
private SubscribedCountableFeaturePack $subscribedPack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ final class SubscribedRechargeableFeature extends AbstractSubscribedFeature impl

private SubscribedRechargeableFeaturePack $rechargingPack;

/** @var int $remainedQuantity The amount of remained units */
private int $remainedQuantity = 0;

public function __construct(string $name, array $details = [])
{
// Set the type
Expand Down

0 comments on commit 72f2da8

Please sign in to comment.