From 72af68f5a5bf4891d4460047496325dc06b7fa75 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Fri, 17 Nov 2023 10:30:15 -0500 Subject: [PATCH 01/10] fuckery --- docs/contracts/index.md | 60 ++++++++++++++++++- src/SonsOfPHP/Component/Money/Amount.php | 4 +- src/SonsOfPHP/Component/Money/Currency.php | 2 +- .../AbstractCurrencyProvider.php | 2 +- src/SonsOfPHP/Component/Money/Money.php | 4 +- .../Operator/Amount/AddAmountOperator.php | 2 +- .../Operator/Amount/DivideAmountOperator.php | 2 +- .../Amount/MultiplyAmountOperator.php | 2 +- .../Amount/SubtractAmountOperator.php | 2 +- .../Money/Operator/Money/AddMoneyOperator.php | 2 +- .../Operator/Money/DivideMoneyOperator.php | 2 +- .../Operator/Money/MultiplyMoneyOperator.php | 2 +- .../Operator/Money/SubtractMoneyOperator.php | 2 +- .../Query/Amount/IsEqualToAmountQuery.php | 2 +- .../Query/Amount/IsGreaterThanAmountQuery.php | 2 +- .../IsGreaterThanOrEqualToAmountQuery.php | 2 +- .../Query/Amount/IsLessThanAmountQuery.php | 2 +- .../Amount/IsLessThanOrEqualToAmountQuery.php | 2 +- .../Query/Amount/IsNegativeAmountQuery.php | 2 +- .../Query/Amount/IsPositiveAmountQuery.php | 2 +- .../Money/Query/Amount/IsZeroAmountQuery.php | 2 +- .../Query/Currency/IsEqualToCurrencyQuery.php | 2 +- .../CurrencyProvider/GetCurrencyQuery.php | 2 +- .../CurrencyProvider/HasCurrencyQuery.php | 2 +- .../Money/Query/Money/IsEqualToMoneyQuery.php | 2 +- .../Query/Money/IsGreaterThanMoneyQuery.php | 2 +- .../IsGreaterThanOrEqualToMoneyQuery.php | 2 +- .../Query/Money/IsLessThanMoneyQuery.php | 2 +- .../Money/IsLessThanOrEqualToMoneyQuery.php | 2 +- .../Query/Money/IsNegativeMoneyQuery.php | 2 +- .../Query/Money/IsPositiveMoneyQuery.php | 2 +- .../Money/Query/Money/IsZeroMoneyQuery.php | 2 +- .../Operator/Amount/AddAmountOperatorTest.php | 2 +- .../Amount/DivideAmountOperatorTest.php | 2 +- .../Amount/MultiplyAmountOperatorTest.php | 2 +- .../Amount/SubtractAmountOperatorTest.php | 2 +- .../Operator/Money/AddMoneyOperatorTest.php | 2 +- .../Money/DivideMoneyOperatorTest.php | 2 +- .../Money/MultiplyMoneyOperatorTest.php | 2 +- .../Money/SubtractMoneyOperatorTest.php | 2 +- .../Query/Amount/IsEqualToAmountQueryTest.php | 2 +- .../Amount/IsGreaterThanAmountQueryTest.php | 2 +- .../IsGreaterThanOrEqualToAmountQueryTest.php | 2 +- .../Amount/IsLessThanAmountQueryTest.php | 2 +- .../IsLessThanOrEqualToAmountQueryTest.php | 2 +- .../Amount/IsNegativeAmountQueryTest.php | 2 +- .../Amount/IsPositiveAmountQueryTest.php | 2 +- .../Query/Amount/IsZeroAmountQueryTest.php | 2 +- .../Currency/IsEqualToCurrencyQueryTest.php | 2 +- .../CurrencyProvider/GetCurrencyQueryTest.php | 2 +- .../CurrencyProvider/HasCurrencyQueryTest.php | 2 +- .../Query/Money/IsEqualToMoneyQueryTest.php | 2 +- .../Money/IsGreaterThanMoneyQueryTest.php | 2 +- .../IsGreaterThanOrEqualToMoneyQueryTest.php | 2 +- .../Query/Money/IsLessThanMoneyQueryTest.php | 2 +- .../IsLessThanOrEqualToMoneyQueryTest.php | 2 +- .../Query/Money/IsNegativeMoneyQueryTest.php | 2 +- .../Query/Money/IsPositiveMoneyQueryTest.php | 2 +- .../Query/Money/IsZeroMoneyQueryTest.php | 2 +- .../Contract/Money/AmountInterface.php | 17 +++--- .../Amount => }/AmountOperatorInterface.php | 2 +- .../Amount => }/AmountQueryInterface.php | 2 +- .../Contract/Money/CurrencyInterface.php | 2 +- .../Money/CurrencyProviderInterface.php | 2 +- .../CurrencyProviderQueryInterface.php | 2 +- .../Currency => }/CurrencyQueryInterface.php | 2 +- .../Contract/Money/MoneyInterface.php | 6 +- .../Money => }/MoneyOperatorInterface.php | 2 +- .../{Query/Money => }/MoneyQueryInterface.php | 2 +- 69 files changed, 137 insertions(+), 82 deletions(-) rename src/SonsOfPHP/Contract/Money/{Operator/Amount => }/AmountOperatorInterface.php (87%) rename src/SonsOfPHP/Contract/Money/{Query/Amount => }/AmountQueryInterface.php (87%) rename src/SonsOfPHP/Contract/Money/{Query/CurrencyProvider => }/CurrencyProviderQueryInterface.php (86%) rename src/SonsOfPHP/Contract/Money/{Query/Currency => }/CurrencyQueryInterface.php (87%) rename src/SonsOfPHP/Contract/Money/{Operator/Money => }/MoneyOperatorInterface.php (87%) rename src/SonsOfPHP/Contract/Money/{Query/Money => }/MoneyQueryInterface.php (87%) diff --git a/docs/contracts/index.md b/docs/contracts/index.md index 7a160344..531e7927 100644 --- a/docs/contracts/index.md +++ b/docs/contracts/index.md @@ -20,6 +20,64 @@ If you want to provide a concrete library for others to use, add this to your ```json "provide": { - "sonsofphp/core-contract-implementation": "^1.0" + "sonsofphp/common-contract-implementation": "^1.0" }, ``` + +## Method Naming + +Functionality around method names are kept as similar as possible. They SHOULD +follow this convention. + +### with* + +`with*` methods are meant to be used on value objects. They will return a new +object with the value(s) modified. + +Examples: +- `withFirstName` + +### has* + +Will always return a `boolean` value. Used to check if a property or value +exists on the object. Doesn't matter the type of the value. + +Examples +- `hasFirstName` + +### is* + +Will always return a `boolean` value. + +Examples: +- `isNew` +- `isDeleted` + +### get* + +Used to return property values. + +Examples: +- `getFirstName` +- `getLastName` + +### set* + +Used to set property values. SHOULD always return the same instance of the +object to allow chaining. + +Examples: +- `setFirstName` +- `setLastName` + +### to* + +Used to convert an object to a specific format. + +Examples: +- `toJson` +- `toString` +- `toArray` +- `toInteger` +- `toFloat` +- `toBoolean` diff --git a/src/SonsOfPHP/Component/Money/Amount.php b/src/SonsOfPHP/Component/Money/Amount.php index 5fe7cecd..edc4e81b 100644 --- a/src/SonsOfPHP/Component/Money/Amount.php +++ b/src/SonsOfPHP/Component/Money/Amount.php @@ -17,8 +17,8 @@ use SonsOfPHP\Component\Money\Query\Amount\IsPositiveAmountQuery; use SonsOfPHP\Component\Money\Query\Amount\IsZeroAmountQuery; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Currency.php b/src/SonsOfPHP/Component/Money/Currency.php index 517de761..f1188243 100644 --- a/src/SonsOfPHP/Component/Money/Currency.php +++ b/src/SonsOfPHP/Component/Money/Currency.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Query\Currency\IsEqualToCurrencyQuery; use SonsOfPHP\Contract\Money\CurrencyInterface; -use SonsOfPHP\Contract\Money\Query\Currency\CurrencyQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/CurrencyProvider/AbstractCurrencyProvider.php b/src/SonsOfPHP/Component/Money/CurrencyProvider/AbstractCurrencyProvider.php index 6a547481..83204bed 100644 --- a/src/SonsOfPHP/Component/Money/CurrencyProvider/AbstractCurrencyProvider.php +++ b/src/SonsOfPHP/Component/Money/CurrencyProvider/AbstractCurrencyProvider.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Query\CurrencyProvider\HasCurrencyQuery; use SonsOfPHP\Contract\Money\CurrencyInterface; use SonsOfPHP\Contract\Money\CurrencyProviderInterface; -use SonsOfPHP\Contract\Money\Query\CurrencyProvider\CurrencyProviderQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Money.php b/src/SonsOfPHP/Component/Money/Money.php index b4e57beb..94994bde 100644 --- a/src/SonsOfPHP/Component/Money/Money.php +++ b/src/SonsOfPHP/Component/Money/Money.php @@ -19,8 +19,8 @@ use SonsOfPHP\Contract\Money\AmountInterface; use SonsOfPHP\Contract\Money\CurrencyInterface; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Operator/Amount/AddAmountOperator.php b/src/SonsOfPHP/Component/Money/Operator/Amount/AddAmountOperator.php index 2d5cbce2..0c987e5c 100644 --- a/src/SonsOfPHP/Component/Money/Operator/Amount/AddAmountOperator.php +++ b/src/SonsOfPHP/Component/Money/Operator/Amount/AddAmountOperator.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Operator/Amount/DivideAmountOperator.php b/src/SonsOfPHP/Component/Money/Operator/Amount/DivideAmountOperator.php index 689f59b3..0cc403be 100644 --- a/src/SonsOfPHP/Component/Money/Operator/Amount/DivideAmountOperator.php +++ b/src/SonsOfPHP/Component/Money/Operator/Amount/DivideAmountOperator.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Operator/Amount/MultiplyAmountOperator.php b/src/SonsOfPHP/Component/Money/Operator/Amount/MultiplyAmountOperator.php index 70120c86..8ac20c58 100644 --- a/src/SonsOfPHP/Component/Money/Operator/Amount/MultiplyAmountOperator.php +++ b/src/SonsOfPHP/Component/Money/Operator/Amount/MultiplyAmountOperator.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Operator/Amount/SubtractAmountOperator.php b/src/SonsOfPHP/Component/Money/Operator/Amount/SubtractAmountOperator.php index 7881fad3..4fa9dfcf 100644 --- a/src/SonsOfPHP/Component/Money/Operator/Amount/SubtractAmountOperator.php +++ b/src/SonsOfPHP/Component/Money/Operator/Amount/SubtractAmountOperator.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Operator/Money/AddMoneyOperator.php b/src/SonsOfPHP/Component/Money/Operator/Money/AddMoneyOperator.php index 9a54ccf1..9becfbcf 100644 --- a/src/SonsOfPHP/Component/Money/Operator/Money/AddMoneyOperator.php +++ b/src/SonsOfPHP/Component/Money/Operator/Money/AddMoneyOperator.php @@ -7,7 +7,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Operator/Money/DivideMoneyOperator.php b/src/SonsOfPHP/Component/Money/Operator/Money/DivideMoneyOperator.php index 224760c3..eb7f98c0 100644 --- a/src/SonsOfPHP/Component/Money/Operator/Money/DivideMoneyOperator.php +++ b/src/SonsOfPHP/Component/Money/Operator/Money/DivideMoneyOperator.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Operator/Money/MultiplyMoneyOperator.php b/src/SonsOfPHP/Component/Money/Operator/Money/MultiplyMoneyOperator.php index 2e1d0302..f5f22ebc 100644 --- a/src/SonsOfPHP/Component/Money/Operator/Money/MultiplyMoneyOperator.php +++ b/src/SonsOfPHP/Component/Money/Operator/Money/MultiplyMoneyOperator.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Operator/Money/SubtractMoneyOperator.php b/src/SonsOfPHP/Component/Money/Operator/Money/SubtractMoneyOperator.php index 5822b388..d3402bc4 100644 --- a/src/SonsOfPHP/Component/Money/Operator/Money/SubtractMoneyOperator.php +++ b/src/SonsOfPHP/Component/Money/Operator/Money/SubtractMoneyOperator.php @@ -7,7 +7,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Amount/IsEqualToAmountQuery.php b/src/SonsOfPHP/Component/Money/Query/Amount/IsEqualToAmountQuery.php index f6e86581..c3b32926 100644 --- a/src/SonsOfPHP/Component/Money/Query/Amount/IsEqualToAmountQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Amount/IsEqualToAmountQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Amount/IsGreaterThanAmountQuery.php b/src/SonsOfPHP/Component/Money/Query/Amount/IsGreaterThanAmountQuery.php index 6fba3d12..65d71bd3 100644 --- a/src/SonsOfPHP/Component/Money/Query/Amount/IsGreaterThanAmountQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Amount/IsGreaterThanAmountQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Amount/IsGreaterThanOrEqualToAmountQuery.php b/src/SonsOfPHP/Component/Money/Query/Amount/IsGreaterThanOrEqualToAmountQuery.php index 15204625..7e63aa4c 100644 --- a/src/SonsOfPHP/Component/Money/Query/Amount/IsGreaterThanOrEqualToAmountQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Amount/IsGreaterThanOrEqualToAmountQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Amount/IsLessThanAmountQuery.php b/src/SonsOfPHP/Component/Money/Query/Amount/IsLessThanAmountQuery.php index dee98c25..86d98f03 100644 --- a/src/SonsOfPHP/Component/Money/Query/Amount/IsLessThanAmountQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Amount/IsLessThanAmountQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Amount/IsLessThanOrEqualToAmountQuery.php b/src/SonsOfPHP/Component/Money/Query/Amount/IsLessThanOrEqualToAmountQuery.php index c27ae797..e7bd7fa8 100644 --- a/src/SonsOfPHP/Component/Money/Query/Amount/IsLessThanOrEqualToAmountQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Amount/IsLessThanOrEqualToAmountQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Amount/IsNegativeAmountQuery.php b/src/SonsOfPHP/Component/Money/Query/Amount/IsNegativeAmountQuery.php index 82fbf59f..aba098fd 100644 --- a/src/SonsOfPHP/Component/Money/Query/Amount/IsNegativeAmountQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Amount/IsNegativeAmountQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Amount/IsPositiveAmountQuery.php b/src/SonsOfPHP/Component/Money/Query/Amount/IsPositiveAmountQuery.php index d5d16881..e707149f 100644 --- a/src/SonsOfPHP/Component/Money/Query/Amount/IsPositiveAmountQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Amount/IsPositiveAmountQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Amount/IsZeroAmountQuery.php b/src/SonsOfPHP/Component/Money/Query/Amount/IsZeroAmountQuery.php index 34baf643..9a855e03 100644 --- a/src/SonsOfPHP/Component/Money/Query/Amount/IsZeroAmountQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Amount/IsZeroAmountQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Amount; use SonsOfPHP\Contract\Money\AmountInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Currency/IsEqualToCurrencyQuery.php b/src/SonsOfPHP/Component/Money/Query/Currency/IsEqualToCurrencyQuery.php index 94746b7a..188982e9 100644 --- a/src/SonsOfPHP/Component/Money/Query/Currency/IsEqualToCurrencyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Currency/IsEqualToCurrencyQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Currency; use SonsOfPHP\Contract\Money\CurrencyInterface; -use SonsOfPHP\Contract\Money\Query\Currency\CurrencyQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/CurrencyProvider/GetCurrencyQuery.php b/src/SonsOfPHP/Component/Money/Query/CurrencyProvider/GetCurrencyQuery.php index 88786024..bb6ca981 100644 --- a/src/SonsOfPHP/Component/Money/Query/CurrencyProvider/GetCurrencyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/CurrencyProvider/GetCurrencyQuery.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Contract\Money\CurrencyInterface; use SonsOfPHP\Contract\Money\CurrencyProviderInterface; -use SonsOfPHP\Contract\Money\Query\CurrencyProvider\CurrencyProviderQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/CurrencyProvider/HasCurrencyQuery.php b/src/SonsOfPHP/Component/Money/Query/CurrencyProvider/HasCurrencyQuery.php index 1e4fbb1a..3f2b9669 100644 --- a/src/SonsOfPHP/Component/Money/Query/CurrencyProvider/HasCurrencyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/CurrencyProvider/HasCurrencyQuery.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Contract\Money\CurrencyInterface; use SonsOfPHP\Contract\Money\CurrencyProviderInterface; -use SonsOfPHP\Contract\Money\Query\CurrencyProvider\CurrencyProviderQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Money/IsEqualToMoneyQuery.php b/src/SonsOfPHP/Component/Money/Query/Money/IsEqualToMoneyQuery.php index cd8334eb..cdb09659 100644 --- a/src/SonsOfPHP/Component/Money/Query/Money/IsEqualToMoneyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Money/IsEqualToMoneyQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Money; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Money/IsGreaterThanMoneyQuery.php b/src/SonsOfPHP/Component/Money/Query/Money/IsGreaterThanMoneyQuery.php index dd8ac01e..c63bde93 100644 --- a/src/SonsOfPHP/Component/Money/Query/Money/IsGreaterThanMoneyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Money/IsGreaterThanMoneyQuery.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Money/IsGreaterThanOrEqualToMoneyQuery.php b/src/SonsOfPHP/Component/Money/Query/Money/IsGreaterThanOrEqualToMoneyQuery.php index 76ea907d..a474db26 100644 --- a/src/SonsOfPHP/Component/Money/Query/Money/IsGreaterThanOrEqualToMoneyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Money/IsGreaterThanOrEqualToMoneyQuery.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Money/IsLessThanMoneyQuery.php b/src/SonsOfPHP/Component/Money/Query/Money/IsLessThanMoneyQuery.php index a79fc4ed..2b24df34 100644 --- a/src/SonsOfPHP/Component/Money/Query/Money/IsLessThanMoneyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Money/IsLessThanMoneyQuery.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Money/IsLessThanOrEqualToMoneyQuery.php b/src/SonsOfPHP/Component/Money/Query/Money/IsLessThanOrEqualToMoneyQuery.php index 38f88b9b..82880b88 100644 --- a/src/SonsOfPHP/Component/Money/Query/Money/IsLessThanOrEqualToMoneyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Money/IsLessThanOrEqualToMoneyQuery.php @@ -6,7 +6,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Money/IsNegativeMoneyQuery.php b/src/SonsOfPHP/Component/Money/Query/Money/IsNegativeMoneyQuery.php index 441e4602..ba29a77f 100644 --- a/src/SonsOfPHP/Component/Money/Query/Money/IsNegativeMoneyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Money/IsNegativeMoneyQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Money; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Money/IsPositiveMoneyQuery.php b/src/SonsOfPHP/Component/Money/Query/Money/IsPositiveMoneyQuery.php index b1597f44..3a1fb918 100644 --- a/src/SonsOfPHP/Component/Money/Query/Money/IsPositiveMoneyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Money/IsPositiveMoneyQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Money; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Query/Money/IsZeroMoneyQuery.php b/src/SonsOfPHP/Component/Money/Query/Money/IsZeroMoneyQuery.php index 9d7f29d6..b43ffba1 100644 --- a/src/SonsOfPHP/Component/Money/Query/Money/IsZeroMoneyQuery.php +++ b/src/SonsOfPHP/Component/Money/Query/Money/IsZeroMoneyQuery.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Component\Money\Query\Money; use SonsOfPHP\Contract\Money\MoneyInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/AddAmountOperatorTest.php b/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/AddAmountOperatorTest.php index b593eeed..a09f3d86 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/AddAmountOperatorTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/AddAmountOperatorTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Operator\Amount\AddAmountOperator; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Operator\Amount\AddAmountOperator diff --git a/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/DivideAmountOperatorTest.php b/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/DivideAmountOperatorTest.php index e143641e..fcd6afb2 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/DivideAmountOperatorTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/DivideAmountOperatorTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Operator\Amount\DivideAmountOperator; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Operator\Amount\DivideAmountOperator diff --git a/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/MultiplyAmountOperatorTest.php b/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/MultiplyAmountOperatorTest.php index 21844e66..6b8ee735 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/MultiplyAmountOperatorTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/MultiplyAmountOperatorTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Operator\Amount\MultiplyAmountOperator; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Operator\Amount\MultiplyAmountOperator diff --git a/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/SubtractAmountOperatorTest.php b/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/SubtractAmountOperatorTest.php index 0f5cc314..80e08c18 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/SubtractAmountOperatorTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Operator/Amount/SubtractAmountOperatorTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Operator\Amount\SubtractAmountOperator; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Operator\Amount\SubtractAmountOperator diff --git a/src/SonsOfPHP/Component/Money/Tests/Operator/Money/AddMoneyOperatorTest.php b/src/SonsOfPHP/Component/Money/Tests/Operator/Money/AddMoneyOperatorTest.php index e3f29f50..22bf8ade 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Operator/Money/AddMoneyOperatorTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Operator/Money/AddMoneyOperatorTest.php @@ -9,7 +9,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Operator\Money\AddMoneyOperator; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Operator\Money\AddMoneyOperator diff --git a/src/SonsOfPHP/Component/Money/Tests/Operator/Money/DivideMoneyOperatorTest.php b/src/SonsOfPHP/Component/Money/Tests/Operator/Money/DivideMoneyOperatorTest.php index 7948d979..66dbf5a7 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Operator/Money/DivideMoneyOperatorTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Operator/Money/DivideMoneyOperatorTest.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Operator\Money\DivideMoneyOperator; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Operator\Money\DivideMoneyOperator diff --git a/src/SonsOfPHP/Component/Money/Tests/Operator/Money/MultiplyMoneyOperatorTest.php b/src/SonsOfPHP/Component/Money/Tests/Operator/Money/MultiplyMoneyOperatorTest.php index 4ca68b93..0c443f1e 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Operator/Money/MultiplyMoneyOperatorTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Operator/Money/MultiplyMoneyOperatorTest.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Operator\Money\MultiplyMoneyOperator; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Operator\Money\MultiplyMoneyOperator diff --git a/src/SonsOfPHP/Component/Money/Tests/Operator/Money/SubtractMoneyOperatorTest.php b/src/SonsOfPHP/Component/Money/Tests/Operator/Money/SubtractMoneyOperatorTest.php index 5bbc6b9a..7e161ae3 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Operator/Money/SubtractMoneyOperatorTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Operator/Money/SubtractMoneyOperatorTest.php @@ -9,7 +9,7 @@ use SonsOfPHP\Component\Money\Exception\MoneyException; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Operator\Money\SubtractMoneyOperator; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Operator\Money\SubtractMoneyOperator diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsEqualToAmountQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsEqualToAmountQueryTest.php index 669e8a85..efbe16e8 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsEqualToAmountQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsEqualToAmountQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Query\Amount\IsEqualToAmountQuery; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Amount\IsEqualToAmountQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsGreaterThanAmountQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsGreaterThanAmountQueryTest.php index fc17a297..2b9f85a2 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsGreaterThanAmountQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsGreaterThanAmountQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Query\Amount\IsGreaterThanAmountQuery; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Amount\IsGreaterThanAmountQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsGreaterThanOrEqualToAmountQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsGreaterThanOrEqualToAmountQueryTest.php index c975fe43..2157df5a 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsGreaterThanOrEqualToAmountQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsGreaterThanOrEqualToAmountQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Query\Amount\IsGreaterThanOrEqualToAmountQuery; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Amount\IsGreaterThanOrEqualToAmountQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsLessThanAmountQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsLessThanAmountQueryTest.php index 1318ed67..f17b64f2 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsLessThanAmountQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsLessThanAmountQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Query\Amount\IsLessThanAmountQuery; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Amount\IsLessThanAmountQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsLessThanOrEqualToAmountQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsLessThanOrEqualToAmountQueryTest.php index 6f422fc4..2fb87f97 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsLessThanOrEqualToAmountQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsLessThanOrEqualToAmountQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Query\Amount\IsLessThanOrEqualToAmountQuery; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Amount\IsLessThanOrEqualToAmountQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsNegativeAmountQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsNegativeAmountQueryTest.php index f5ed3247..3076b82d 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsNegativeAmountQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsNegativeAmountQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Query\Amount\IsNegativeAmountQuery; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Amount\IsNegativeAmountQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsPositiveAmountQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsPositiveAmountQueryTest.php index 28944e8e..dd8a6050 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsPositiveAmountQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsPositiveAmountQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Query\Amount\IsPositiveAmountQuery; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Amount\IsPositiveAmountQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsZeroAmountQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsZeroAmountQueryTest.php index 87e66965..1f3946c3 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsZeroAmountQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Amount/IsZeroAmountQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Amount; use SonsOfPHP\Component\Money\Query\Amount\IsZeroAmountQuery; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Amount\IsZeroAmountQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Currency/IsEqualToCurrencyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Currency/IsEqualToCurrencyQueryTest.php index 055424b6..78dff0f6 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Currency/IsEqualToCurrencyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Currency/IsEqualToCurrencyQueryTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\Query\Currency\IsEqualToCurrencyQuery; -use SonsOfPHP\Contract\Money\Query\Currency\CurrencyQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Currency\IsEqualToCurrencyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php index 31ca2e67..f6bcb51d 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php @@ -9,7 +9,7 @@ use SonsOfPHP\Component\Money\CurrencyProvider\XCurrencyProvider; use SonsOfPHP\Component\Money\Query\CurrencyProvider\GetCurrencyQuery; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\Query\CurrencyProvider\CurrencyProviderQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\CurrencyProvider\GetCurrencyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php index 9c2681d2..4f92bd54 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php @@ -9,7 +9,7 @@ use SonsOfPHP\Component\Money\CurrencyProvider\XCurrencyProvider; use SonsOfPHP\Component\Money\Query\CurrencyProvider\HasCurrencyQuery; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\Query\CurrencyProvider\CurrencyProviderQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\CurrencyProvider\HasCurrencyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsEqualToMoneyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsEqualToMoneyQueryTest.php index b1ca02df..27adb027 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsEqualToMoneyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsEqualToMoneyQueryTest.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Query\Money\IsEqualToMoneyQuery; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Money\IsEqualToMoneyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsGreaterThanMoneyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsGreaterThanMoneyQueryTest.php index 3bccba6c..a13d2aec 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsGreaterThanMoneyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsGreaterThanMoneyQueryTest.php @@ -9,7 +9,7 @@ use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Query\Money\IsGreaterThanMoneyQuery; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Money\IsGreaterThanMoneyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsGreaterThanOrEqualToMoneyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsGreaterThanOrEqualToMoneyQueryTest.php index 3e1bb096..592f0dff 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsGreaterThanOrEqualToMoneyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsGreaterThanOrEqualToMoneyQueryTest.php @@ -9,7 +9,7 @@ use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Query\Money\IsGreaterThanOrEqualToMoneyQuery; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Money\IsGreaterThanOrEqualToMoneyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsLessThanMoneyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsLessThanMoneyQueryTest.php index bcfe6d81..40ea0b1c 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsLessThanMoneyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsLessThanMoneyQueryTest.php @@ -9,7 +9,7 @@ use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Query\Money\IsLessThanMoneyQuery; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Money\IsLessThanMoneyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsLessThanOrEqualToMoneyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsLessThanOrEqualToMoneyQueryTest.php index f341a9ab..10cf66b7 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsLessThanOrEqualToMoneyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsLessThanOrEqualToMoneyQueryTest.php @@ -9,7 +9,7 @@ use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Query\Money\IsLessThanOrEqualToMoneyQuery; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Money\IsLessThanOrEqualToMoneyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsNegativeMoneyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsNegativeMoneyQueryTest.php index d2b6fbda..cfd9e990 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsNegativeMoneyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsNegativeMoneyQueryTest.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Query\Money\IsNegativeMoneyQuery; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Money\IsNegativeMoneyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsPositiveMoneyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsPositiveMoneyQueryTest.php index 8f9ee2e0..335d2a89 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsPositiveMoneyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsPositiveMoneyQueryTest.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Query\Money\IsPositiveMoneyQuery; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Money\IsPositiveMoneyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsZeroMoneyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsZeroMoneyQueryTest.php index cd7f8991..ee85b349 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsZeroMoneyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/Money/IsZeroMoneyQueryTest.php @@ -8,7 +8,7 @@ use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\Money; use SonsOfPHP\Component\Money\Query\Money\IsZeroMoneyQuery; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\Money\IsZeroMoneyQuery diff --git a/src/SonsOfPHP/Contract/Money/AmountInterface.php b/src/SonsOfPHP/Contract/Money/AmountInterface.php index f5f7a456..8134c573 100644 --- a/src/SonsOfPHP/Contract/Money/AmountInterface.php +++ b/src/SonsOfPHP/Contract/Money/AmountInterface.php @@ -4,24 +4,21 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\Operator\Amount\AmountOperatorInterface; -use SonsOfPHP\Contract\Money\Query\Amount\AmountQueryInterface; +use SonsOfPHP\Contract\Money\AmountOperatorInterface; +use SonsOfPHP\Contract\Money\AmountQueryInterface; /** * Amount. * * The amount is used to represent the Numerical Value of the Money. * + * The amount SHOULD be represented in the smallest form of the currency. So + * for USD a value of `420` would represent `$4.20`. + * * @author Joshua Estes */ -interface AmountInterface +interface AmountInterface// extends \Stringable { - /** - * Considering some of these methods. - */ - // public function getPrecision(): int; - // public function getScale(): int; - /** * Allows you to run you own operations of the amount. */ @@ -31,7 +28,7 @@ public function with(AmountOperatorInterface $operator): self; * Allows you to ask different questions about the amount and get * different results returned to you. */ - public function query(AmountQueryInterface $query); + public function query(AmountQueryInterface $query)/*: mixed*/; /** * Returns the value for this amount as a string. diff --git a/src/SonsOfPHP/Contract/Money/Operator/Amount/AmountOperatorInterface.php b/src/SonsOfPHP/Contract/Money/AmountOperatorInterface.php similarity index 87% rename from src/SonsOfPHP/Contract/Money/Operator/Amount/AmountOperatorInterface.php rename to src/SonsOfPHP/Contract/Money/AmountOperatorInterface.php index be298f24..305d39ae 100644 --- a/src/SonsOfPHP/Contract/Money/Operator/Amount/AmountOperatorInterface.php +++ b/src/SonsOfPHP/Contract/Money/AmountOperatorInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Contract\Money\Operator\Amount; +namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\AmountInterface; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; diff --git a/src/SonsOfPHP/Contract/Money/Query/Amount/AmountQueryInterface.php b/src/SonsOfPHP/Contract/Money/AmountQueryInterface.php similarity index 87% rename from src/SonsOfPHP/Contract/Money/Query/Amount/AmountQueryInterface.php rename to src/SonsOfPHP/Contract/Money/AmountQueryInterface.php index ae4e8272..323829e2 100644 --- a/src/SonsOfPHP/Contract/Money/Query/Amount/AmountQueryInterface.php +++ b/src/SonsOfPHP/Contract/Money/AmountQueryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Contract\Money\Query\Amount; +namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\AmountInterface; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; diff --git a/src/SonsOfPHP/Contract/Money/CurrencyInterface.php b/src/SonsOfPHP/Contract/Money/CurrencyInterface.php index ff08b445..9b050e37 100644 --- a/src/SonsOfPHP/Contract/Money/CurrencyInterface.php +++ b/src/SonsOfPHP/Contract/Money/CurrencyInterface.php @@ -4,7 +4,7 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\Query\Currency\CurrencyQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyQueryInterface; /** * Currency Interface. diff --git a/src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php b/src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php index d3684399..c4287dd6 100644 --- a/src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php +++ b/src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php @@ -5,7 +5,7 @@ namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\Query\CurrencyProvider\CurrencyProviderQueryInterface; +use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; /** * Currency Provider. diff --git a/src/SonsOfPHP/Contract/Money/Query/CurrencyProvider/CurrencyProviderQueryInterface.php b/src/SonsOfPHP/Contract/Money/CurrencyProviderQueryInterface.php similarity index 86% rename from src/SonsOfPHP/Contract/Money/Query/CurrencyProvider/CurrencyProviderQueryInterface.php rename to src/SonsOfPHP/Contract/Money/CurrencyProviderQueryInterface.php index f13d949b..931f4267 100644 --- a/src/SonsOfPHP/Contract/Money/Query/CurrencyProvider/CurrencyProviderQueryInterface.php +++ b/src/SonsOfPHP/Contract/Money/CurrencyProviderQueryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Contract\Money\Query\CurrencyProvider; +namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\CurrencyProviderInterface; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; diff --git a/src/SonsOfPHP/Contract/Money/Query/Currency/CurrencyQueryInterface.php b/src/SonsOfPHP/Contract/Money/CurrencyQueryInterface.php similarity index 87% rename from src/SonsOfPHP/Contract/Money/Query/Currency/CurrencyQueryInterface.php rename to src/SonsOfPHP/Contract/Money/CurrencyQueryInterface.php index bd253722..bbde7eda 100644 --- a/src/SonsOfPHP/Contract/Money/Query/Currency/CurrencyQueryInterface.php +++ b/src/SonsOfPHP/Contract/Money/CurrencyQueryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Contract\Money\Query\Currency; +namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\CurrencyInterface; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; diff --git a/src/SonsOfPHP/Contract/Money/MoneyInterface.php b/src/SonsOfPHP/Contract/Money/MoneyInterface.php index 70f3ebfb..d696c947 100644 --- a/src/SonsOfPHP/Contract/Money/MoneyInterface.php +++ b/src/SonsOfPHP/Contract/Money/MoneyInterface.php @@ -4,8 +4,8 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\Operator\Money\MoneyOperatorInterface; -use SonsOfPHP\Contract\Money\Query\Money\MoneyQueryInterface; +use SonsOfPHP\Contract\Money\MoneyOperatorInterface; +use SonsOfPHP\Contract\Money\MoneyQueryInterface; /** * Money Interface. @@ -14,7 +14,7 @@ * * @author Joshua Estes */ -interface MoneyInterface +interface MoneyInterface// extends \JsonSerializable { public function getAmount(): AmountInterface; diff --git a/src/SonsOfPHP/Contract/Money/Operator/Money/MoneyOperatorInterface.php b/src/SonsOfPHP/Contract/Money/MoneyOperatorInterface.php similarity index 87% rename from src/SonsOfPHP/Contract/Money/Operator/Money/MoneyOperatorInterface.php rename to src/SonsOfPHP/Contract/Money/MoneyOperatorInterface.php index df17d9d3..ad50600c 100644 --- a/src/SonsOfPHP/Contract/Money/Operator/Money/MoneyOperatorInterface.php +++ b/src/SonsOfPHP/Contract/Money/MoneyOperatorInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Contract\Money\Operator\Money; +namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; use SonsOfPHP\Contract\Money\MoneyInterface; diff --git a/src/SonsOfPHP/Contract/Money/Query/Money/MoneyQueryInterface.php b/src/SonsOfPHP/Contract/Money/MoneyQueryInterface.php similarity index 87% rename from src/SonsOfPHP/Contract/Money/Query/Money/MoneyQueryInterface.php rename to src/SonsOfPHP/Contract/Money/MoneyQueryInterface.php index b7a3cfaf..37077561 100644 --- a/src/SonsOfPHP/Contract/Money/Query/Money/MoneyQueryInterface.php +++ b/src/SonsOfPHP/Contract/Money/MoneyQueryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Contract\Money\Query\Money; +namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; use SonsOfPHP\Contract\Money\MoneyInterface; From fdd65603d8215aea4b0d5001564488ac3393a7e8 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Fri, 17 Nov 2023 10:30:46 -0500 Subject: [PATCH 02/10] cs fixes --- .../Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php | 2 +- .../Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php | 2 +- src/SonsOfPHP/Contract/Money/AmountInterface.php | 5 +---- src/SonsOfPHP/Contract/Money/AmountOperatorInterface.php | 1 - src/SonsOfPHP/Contract/Money/AmountQueryInterface.php | 1 - src/SonsOfPHP/Contract/Money/CurrencyInterface.php | 2 -- src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php | 1 - .../Contract/Money/CurrencyProviderQueryInterface.php | 1 - src/SonsOfPHP/Contract/Money/CurrencyQueryInterface.php | 1 - src/SonsOfPHP/Contract/Money/MoneyInterface.php | 5 +---- src/SonsOfPHP/Contract/Money/MoneyOperatorInterface.php | 1 - src/SonsOfPHP/Contract/Money/MoneyQueryInterface.php | 1 - 12 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php index f6bcb51d..c4a89a3a 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php @@ -8,8 +8,8 @@ use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\CurrencyProvider\XCurrencyProvider; use SonsOfPHP\Component\Money\Query\CurrencyProvider\GetCurrencyQuery; -use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; +use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\CurrencyProvider\GetCurrencyQuery diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php index 4f92bd54..922f0019 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php @@ -8,8 +8,8 @@ use SonsOfPHP\Component\Money\Currency; use SonsOfPHP\Component\Money\CurrencyProvider\XCurrencyProvider; use SonsOfPHP\Component\Money\Query\CurrencyProvider\HasCurrencyQuery; -use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; +use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; /** * @coversDefaultClass \SonsOfPHP\Component\Money\Query\CurrencyProvider\HasCurrencyQuery diff --git a/src/SonsOfPHP/Contract/Money/AmountInterface.php b/src/SonsOfPHP/Contract/Money/AmountInterface.php index 8134c573..cd1485df 100644 --- a/src/SonsOfPHP/Contract/Money/AmountInterface.php +++ b/src/SonsOfPHP/Contract/Money/AmountInterface.php @@ -4,9 +4,6 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\AmountOperatorInterface; -use SonsOfPHP\Contract\Money\AmountQueryInterface; - /** * Amount. * @@ -17,7 +14,7 @@ * * @author Joshua Estes */ -interface AmountInterface// extends \Stringable +interface AmountInterface // extends \Stringable { /** * Allows you to run you own operations of the amount. diff --git a/src/SonsOfPHP/Contract/Money/AmountOperatorInterface.php b/src/SonsOfPHP/Contract/Money/AmountOperatorInterface.php index 305d39ae..a1617d21 100644 --- a/src/SonsOfPHP/Contract/Money/AmountOperatorInterface.php +++ b/src/SonsOfPHP/Contract/Money/AmountOperatorInterface.php @@ -4,7 +4,6 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\AmountInterface; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; /** diff --git a/src/SonsOfPHP/Contract/Money/AmountQueryInterface.php b/src/SonsOfPHP/Contract/Money/AmountQueryInterface.php index 323829e2..07a22221 100644 --- a/src/SonsOfPHP/Contract/Money/AmountQueryInterface.php +++ b/src/SonsOfPHP/Contract/Money/AmountQueryInterface.php @@ -4,7 +4,6 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\AmountInterface; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; /** diff --git a/src/SonsOfPHP/Contract/Money/CurrencyInterface.php b/src/SonsOfPHP/Contract/Money/CurrencyInterface.php index 9b050e37..ca99d6d4 100644 --- a/src/SonsOfPHP/Contract/Money/CurrencyInterface.php +++ b/src/SonsOfPHP/Contract/Money/CurrencyInterface.php @@ -4,8 +4,6 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\CurrencyQueryInterface; - /** * Currency Interface. * diff --git a/src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php b/src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php index c4287dd6..1da619ba 100644 --- a/src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php +++ b/src/SonsOfPHP/Contract/Money/CurrencyProviderInterface.php @@ -5,7 +5,6 @@ namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\CurrencyProviderQueryInterface; /** * Currency Provider. diff --git a/src/SonsOfPHP/Contract/Money/CurrencyProviderQueryInterface.php b/src/SonsOfPHP/Contract/Money/CurrencyProviderQueryInterface.php index 931f4267..37925163 100644 --- a/src/SonsOfPHP/Contract/Money/CurrencyProviderQueryInterface.php +++ b/src/SonsOfPHP/Contract/Money/CurrencyProviderQueryInterface.php @@ -4,7 +4,6 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\CurrencyProviderInterface; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; /** diff --git a/src/SonsOfPHP/Contract/Money/CurrencyQueryInterface.php b/src/SonsOfPHP/Contract/Money/CurrencyQueryInterface.php index bbde7eda..52dc9395 100644 --- a/src/SonsOfPHP/Contract/Money/CurrencyQueryInterface.php +++ b/src/SonsOfPHP/Contract/Money/CurrencyQueryInterface.php @@ -4,7 +4,6 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\CurrencyInterface; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; /** diff --git a/src/SonsOfPHP/Contract/Money/MoneyInterface.php b/src/SonsOfPHP/Contract/Money/MoneyInterface.php index d696c947..b8669e4e 100644 --- a/src/SonsOfPHP/Contract/Money/MoneyInterface.php +++ b/src/SonsOfPHP/Contract/Money/MoneyInterface.php @@ -4,9 +4,6 @@ namespace SonsOfPHP\Contract\Money; -use SonsOfPHP\Contract\Money\MoneyOperatorInterface; -use SonsOfPHP\Contract\Money\MoneyQueryInterface; - /** * Money Interface. * @@ -14,7 +11,7 @@ * * @author Joshua Estes */ -interface MoneyInterface// extends \JsonSerializable +interface MoneyInterface // extends \JsonSerializable { public function getAmount(): AmountInterface; diff --git a/src/SonsOfPHP/Contract/Money/MoneyOperatorInterface.php b/src/SonsOfPHP/Contract/Money/MoneyOperatorInterface.php index ad50600c..19cea13d 100644 --- a/src/SonsOfPHP/Contract/Money/MoneyOperatorInterface.php +++ b/src/SonsOfPHP/Contract/Money/MoneyOperatorInterface.php @@ -5,7 +5,6 @@ namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\MoneyInterface; /** * @author Joshua Estes diff --git a/src/SonsOfPHP/Contract/Money/MoneyQueryInterface.php b/src/SonsOfPHP/Contract/Money/MoneyQueryInterface.php index 37077561..268e627b 100644 --- a/src/SonsOfPHP/Contract/Money/MoneyQueryInterface.php +++ b/src/SonsOfPHP/Contract/Money/MoneyQueryInterface.php @@ -5,7 +5,6 @@ namespace SonsOfPHP\Contract\Money; use SonsOfPHP\Contract\Money\Exception\MoneyExceptionInterface; -use SonsOfPHP\Contract\Money\MoneyInterface; /** * @author Joshua Estes From 29e7bfd03d5c36399075dd6b8aacf1dca34681e0 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Fri, 17 Nov 2023 13:50:57 -0500 Subject: [PATCH 03/10] more fuckery --- .gitignore | 2 ++ Makefile | 10 ++++++ infection.json5 | 26 ++++++++++++++++ phpunit.xml.dist | 2 +- .../Tests/Message/MessageNormalizerTest.php | 31 ++----------------- .../Cqrs/AbstractCommandMessageHandler.php | 2 ++ .../Cqrs/AbstractQueryMessageHandler.php | 2 ++ .../Repository/AggregateRepositoryTest.php | 8 ++--- .../Tests/Message/AbstractMessageTest.php | 29 +++++++++-------- .../Message/Enricher/MessageEnricherTest.php | 2 +- .../Tests/Adapter/ChainAdapterTest.php | 2 +- .../Tests/Adapter/InMemoryAdapterTest.php | 2 +- .../Tests/Adapter/NativeAdapterTest.php | 2 +- .../Tests/Adapter/NullAdapterTest.php | 2 +- .../Tests/Adapter/ReadOnlyAdapterTest.php | 2 +- .../Tests/Adapter/WormAdapterTest.php | 2 +- .../Component/HttpFactory/HttpFactory.php | 2 +- .../HttpFactory/Tests/ResponseFactoryTest.php | 15 +++++++-- .../Component/Money/Tests/CurrencyTest.php | 10 ++++++ .../CurrencyProvider/GetCurrencyQueryTest.php | 2 +- .../CurrencyProvider/HasCurrencyQueryTest.php | 2 +- tools/infection/composer.json | 10 ++++++ 22 files changed, 106 insertions(+), 61 deletions(-) create mode 100644 infection.json5 create mode 100644 tools/infection/composer.json diff --git a/.gitignore b/.gitignore index b5a07c55..5ced1162 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /docs/coverage/ +/docs/infection/ /site/ vendor/ /.php-cs-fixer.cache @@ -10,3 +11,4 @@ phpunit.xml composer.phar packages.json results.sarif +infection.log diff --git a/Makefile b/Makefile index 57dc7e12..84a42c12 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,9 @@ test-clock: phpunit test-cqrs: PHPUNIT_TESTSUITE=cqrs test-cqrs: phpunit +test-http-factory: PHPUNIT_TESTSUITE=http-factory +test-http-factory: phpunit + test-link: PHPUNIT_TESTSUITE=link test-link: phpunit @@ -165,6 +168,13 @@ php-cs-fixer-upgrade: testdox: ## Run tests and output testdox XDEBUG_MODE=off $(PHP) -dxdebug.mode=off $(PHPUNIT) --testdox +infection: + XDEBUG_MODE=develop \ + $(PHP) \ + -dxdebug.mode=develop \ + -dapc.enable_cli=1 \ + tools/infection/vendor/bin/infection --debug -vvv --show-mutations + tools-install: psalm-install php-cs-fixer-install phpunit-install tools-upgrade: psalm-upgrade php-cs-fixer-upgrade phpunit-upgrade diff --git a/infection.json5 b/infection.json5 new file mode 100644 index 00000000..94714207 --- /dev/null +++ b/infection.json5 @@ -0,0 +1,26 @@ +{ + "$schema": "https://raw.githubusercontent.com/infection/infection/0.27.8/resources/schema.json", + "source": { + "directories": [ + "." + ], + "excludes": [ + "docs", + "tools", + "vendor", + "Tests" + ] + }, + "mutators": { + "@default": true + }, + "logs": { + "html": "docs/infection/index.html" + }, + "phpUnit": { + "configDir": ".", + "customPath": "tools\/phpunit\/vendor\/bin\/phpunit" + }, + "testFrameworkOptions": "--testsuite=all", + "initialTestsPhpOptions": "-dxdebug.mode=coverage -dapc.enable_cli=1" +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5be7804d..ae5f3b3a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -86,7 +86,7 @@ - + diff --git a/src/SonsOfPHP/Bridge/Symfony/EventSourcing/Tests/Message/MessageNormalizerTest.php b/src/SonsOfPHP/Bridge/Symfony/EventSourcing/Tests/Message/MessageNormalizerTest.php index 0b0f11a3..531ab123 100644 --- a/src/SonsOfPHP/Bridge/Symfony/EventSourcing/Tests/Message/MessageNormalizerTest.php +++ b/src/SonsOfPHP/Bridge/Symfony/EventSourcing/Tests/Message/MessageNormalizerTest.php @@ -10,8 +10,6 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class Msg extends AbstractMessage {} - /** * @coversDefaultClass \SonsOfPHP\Bridge\Symfony\EventSourcing\Message\MessageNormalizer * @@ -40,7 +38,8 @@ public function testItWillNormalizeMessage(): void { $normalizer = new MessageNormalizer(); - $message = Msg::new(); + $message = new class extends AbstractMessage { + }; $this->assertTrue($normalizer->supportsNormalization($message)); @@ -49,30 +48,4 @@ public function testItWillNormalizeMessage(): void $this->assertArrayHasKey('payload', $output); $this->assertArrayHasKey('metadata', $output); } - - /** - * @covers ::denormalize - * @covers ::supportsDenormalization - */ - public function testItWillDenormalizeMessage(): void - { - $normalizer = new MessageNormalizer(); - - $data = [ - 'payload' => [ - 'unit' => 'test', - ], - 'metadata' => [ - 'test' => 'unit', - ], - ]; - $type = Msg::class; - - $this->assertTrue($normalizer->supportsDenormalization($data, $type)); - - $output = $normalizer->denormalize($data, $type); - - $this->assertSame('test', $output->getPayload()['unit']); - $this->assertSame('unit', $output->getMetadata()['test']); - } } diff --git a/src/SonsOfPHP/Component/Cqrs/AbstractCommandMessageHandler.php b/src/SonsOfPHP/Component/Cqrs/AbstractCommandMessageHandler.php index 28c73466..7fa52e86 100644 --- a/src/SonsOfPHP/Component/Cqrs/AbstractCommandMessageHandler.php +++ b/src/SonsOfPHP/Component/Cqrs/AbstractCommandMessageHandler.php @@ -4,6 +4,8 @@ namespace SonsOfPHP\Component\Cqrs; +use SonsOfPHP\Contract\Cqrs\CommandMessageHandlerInterface; + /** * @author Joshua Estes */ diff --git a/src/SonsOfPHP/Component/Cqrs/AbstractQueryMessageHandler.php b/src/SonsOfPHP/Component/Cqrs/AbstractQueryMessageHandler.php index e4b76bf6..6b7d99de 100644 --- a/src/SonsOfPHP/Component/Cqrs/AbstractQueryMessageHandler.php +++ b/src/SonsOfPHP/Component/Cqrs/AbstractQueryMessageHandler.php @@ -4,6 +4,8 @@ namespace SonsOfPHP\Component\Cqrs; +use SonsOfPHP\Contract\Cqrs\QueryMessageHandlerInterface; + /** * @author Joshua Estes */ diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php index 328da0c6..325040db 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php @@ -14,8 +14,6 @@ use SonsOfPHP\Component\EventSourcing\Message\Repository\MessageRepositoryInterface; use SonsOfPHP\Component\EventSourcing\Tests\FakeAggregate; -class Msg extends AbstractMessage {} - /** * @coversDefaultClass \SonsOfPHP\Component\EventSourcing\Aggregate\Repository\AggregateRepository * @@ -70,7 +68,7 @@ public function testPersistWillUseEventDispatcher(): void $aggregate = new FakeAggregate('unique-id'); - $message = Msg::new(); + $message = new class extends AbstractMessage {}; $aggregate->raiseThisEvent($message); $repository->persist($aggregate); @@ -90,7 +88,7 @@ public function testPersistAndFind(): void $aggregate = new FakeAggregate('unique-id'); - $message = Msg::new(); + $message = new class extends AbstractMessage {}; $aggregate->raiseThisEvent($message); $repository->persist($aggregate); @@ -113,7 +111,7 @@ public function testPersistAndFindWithoutUsingAggregateId(): void $aggregate = new FakeAggregate('unique-id'); - $message = Msg::new(); + $message = new class extends AbstractMessage {}; $aggregate->raiseThisEvent($message); $repository->persist($aggregate); diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Message/AbstractMessageTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Message/AbstractMessageTest.php index 06d12356..6a5309b7 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Message/AbstractMessageTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Message/AbstractMessageTest.php @@ -12,8 +12,6 @@ use SonsOfPHP\Component\EventSourcing\Message\MessageInterface; use SonsOfPHP\Component\EventSourcing\Metadata; -class Msg extends AbstractMessage {} - /** * @coversDefaultClass \SonsOfPHP\Component\EventSourcing\Message\AbstractMessage * @@ -31,7 +29,7 @@ final class AbstractMessageTest extends TestCase */ public function testItHasTheRightInterface(): void { - $message = Msg::new(); + $message = $this->createMock(AbstractMessage::class); $this->assertInstanceOf(MessageInterface::class, $message); } @@ -41,7 +39,7 @@ public function testItHasTheRightInterface(): void */ public function testGetMetadataHasEmptyArraryAsDefaultValue(): void { - $message = Msg::new(); + $message = $this->createMock(AbstractMessage::class)::new(); $this->assertCount(6, $message->getMetadata()); } @@ -51,7 +49,7 @@ public function testGetMetadataHasEmptyArraryAsDefaultValue(): void */ public function testWithMetadataReturnsNewStatic(): void { - $message = Msg::new(); + $message = $this->createMock(AbstractMessage::class)::new(); $return = $message->withMetadata([ Metadata::EVENT_TYPE => 'test', @@ -64,7 +62,8 @@ public function testWithMetadataReturnsNewStatic(): void */ public function testWithMetadataWorksCorrectly(): void { - $message = Msg::new()->withMetadata([ + $message = $this->createMock(AbstractMessage::class); + $message = $message::new()->withMetadata([ Metadata::EVENT_TYPE => 'test', ]); @@ -81,7 +80,7 @@ public function testWithMetadataWorksCorrectly(): void */ public function testGettersWithEmptyMetadata(): void { - $message = Msg::new(); + $message = $this->createMock(AbstractMessage::class)::new(); $this->expectException(EventSourcingException::class); $this->assertSame('', $message->getEventId()); @@ -103,7 +102,8 @@ public function testGettersWithEmptyMetadata(): void */ public function testGettersWithMetadata(): void { - $message = Msg::new()->withMetadata([ + $message = $this->createMock(AbstractMessage::class); + $message = $message::new()->withMetadata([ Metadata::EVENT_ID => 'event-id', Metadata::EVENT_TYPE => 'event.type', Metadata::TIMESTAMP => '2022-04-20', @@ -126,7 +126,8 @@ public function testGettersWithMetadata(): void */ public function testGetAggregateIdReturnsCorrectInterface(): void { - $message = Msg::new()->withMetadata([ + $message = $this->createMock(AbstractMessage::class); + $message = $message::new()->withMetadata([ Metadata::AGGREGATE_ID => 'aggregate-id', ]); @@ -139,7 +140,8 @@ public function testGetAggregateIdReturnsCorrectInterface(): void */ public function testGetAggregateVersionReturnsCorrectInterface(): void { - $message = Msg::new()->withMetadata([ + $message = $this->createMock(AbstractMessage::class); + $message = $message::new()->withMetadata([ Metadata::AGGREGATE_VERSION => 123, ]); @@ -151,7 +153,7 @@ public function testGetAggregateVersionReturnsCorrectInterface(): void */ public function testGetPayloadHasEmptyArraryAsDefaultValue(): void { - $message = Msg::new(); + $message = $this->createMock(AbstractMessage::class)::new(); $this->assertCount(0, $message->getPayload()); } @@ -161,7 +163,7 @@ public function testGetPayloadHasEmptyArraryAsDefaultValue(): void */ public function testWithPayloadReturnsNewStatic(): void { - $message = Msg::new(); + $message = $this->createMock(AbstractMessage::class)::new(); $return = $message->withPayload([ 'key' => 'val', @@ -174,7 +176,8 @@ public function testWithPayloadReturnsNewStatic(): void */ public function testWithPayloadWorksCorrectly(): void { - $message = Msg::new()->withPayload([ + $message = $this->createMock(AbstractMessage::class); + $message = $message::new()->withPayload([ 'key' => 'val', ]); diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Message/Enricher/MessageEnricherTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Message/Enricher/MessageEnricherTest.php index 8f87ef2d..a0c5d434 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Message/Enricher/MessageEnricherTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Message/Enricher/MessageEnricherTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\EventSourcing\Tests\Message; +namespace SonsOfPHP\Component\EventSourcing\Tests\Message\Enricher; use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\EventSourcing\Message\Enricher\Handler\NullMessageEnricherHandler; diff --git a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/ChainAdapterTest.php b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/ChainAdapterTest.php index 75b8c36c..426550e8 100644 --- a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/ChainAdapterTest.php +++ b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/ChainAdapterTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\Filesystem\Tests; +namespace SonsOfPHP\Component\Filesystem\Tests\Adapter; use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Filesystem\Adapter\AdapterInterface; diff --git a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/InMemoryAdapterTest.php b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/InMemoryAdapterTest.php index ef9fa5b9..135fa225 100644 --- a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/InMemoryAdapterTest.php +++ b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/InMemoryAdapterTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\Filesystem\Tests; +namespace SonsOfPHP\Component\Filesystem\Tests\Adapter; use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Filesystem\Adapter\AdapterInterface; diff --git a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/NativeAdapterTest.php b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/NativeAdapterTest.php index 833833d1..2474974a 100644 --- a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/NativeAdapterTest.php +++ b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/NativeAdapterTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\Filesystem\Tests; +namespace SonsOfPHP\Component\Filesystem\Tests\Adapter; use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Filesystem\Adapter\AdapterInterface; diff --git a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/NullAdapterTest.php b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/NullAdapterTest.php index 654d747a..f95a1084 100644 --- a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/NullAdapterTest.php +++ b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/NullAdapterTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\Filesystem\Tests; +namespace SonsOfPHP\Component\Filesystem\Tests\Adapter; use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Filesystem\Adapter\AdapterInterface; diff --git a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/ReadOnlyAdapterTest.php b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/ReadOnlyAdapterTest.php index 939058de..32f9597b 100644 --- a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/ReadOnlyAdapterTest.php +++ b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/ReadOnlyAdapterTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\Filesystem\Tests; +namespace SonsOfPHP\Component\Filesystem\Tests\Adapter; use PHPUnit\Framework\MockObject; use PHPUnit\Framework\TestCase; diff --git a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/WormAdapterTest.php b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/WormAdapterTest.php index dbaae807..66569e7e 100644 --- a/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/WormAdapterTest.php +++ b/src/SonsOfPHP/Component/Filesystem/Tests/Adapter/WormAdapterTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\Filesystem\Tests; +namespace SonsOfPHP\Component\Filesystem\Tests\Adapter; use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Filesystem\Adapter\AdapterInterface; diff --git a/src/SonsOfPHP/Component/HttpFactory/HttpFactory.php b/src/SonsOfPHP/Component/HttpFactory/HttpFactory.php index e8ad321a..1a63bd7a 100644 --- a/src/SonsOfPHP/Component/HttpFactory/HttpFactory.php +++ b/src/SonsOfPHP/Component/HttpFactory/HttpFactory.php @@ -15,7 +15,7 @@ final class HttpFactory implements RequestFactoryInterface { use RequestFactoryTrait; use ResponseFactoryTrait; - use ServerResponseFactoryTrait; + use ServerRequestFactoryTrait; use StreamFactoryTrait; use UploadedFileFactoryTrait; use UriFactoryTrait; diff --git a/src/SonsOfPHP/Component/HttpFactory/Tests/ResponseFactoryTest.php b/src/SonsOfPHP/Component/HttpFactory/Tests/ResponseFactoryTest.php index 13bb0373..b94da85b 100644 --- a/src/SonsOfPHP/Component/HttpFactory/Tests/ResponseFactoryTest.php +++ b/src/SonsOfPHP/Component/HttpFactory/Tests/ResponseFactoryTest.php @@ -11,6 +11,7 @@ /** * @coversDefaultClass \SonsOfPHP\Component\HttpFactory\ResponseFactory + * @uses \SonsOfPHP\Component\HttpMessage\Response */ final class ResponseFactoryTest extends TestCase { @@ -23,13 +24,21 @@ public function testItImplementsCorrectInterface(): void } /** + * @dataProvider validCreateResponseProvider + * * @covers ::createResponse - * @uses \SonsOfPHP\Component\HttpMessage\Response */ - public function testCreateResponseWorksAsExpected(): void + public function testCreateResponseWorksAsExpected(int $code, string $reasonPhrase): void { $factory = new ResponseFactory(); - $this->assertInstanceOf(ResponseInterface::class, $factory->createResponse()); + $this->assertInstanceOf(ResponseInterface::class, $factory->createResponse($code, $reasonPhrase)); + } + + public static function validCreateResponseProvider(): iterable + { + yield [200, 'OK']; + yield [201, 'Not Content']; + yield [404, 'Not Found']; } } diff --git a/src/SonsOfPHP/Component/Money/Tests/CurrencyTest.php b/src/SonsOfPHP/Component/Money/Tests/CurrencyTest.php index 299e6ccc..764d13a3 100644 --- a/src/SonsOfPHP/Component/Money/Tests/CurrencyTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/CurrencyTest.php @@ -16,6 +16,16 @@ */ final class CurrencyTest extends TestCase { + /** + * @covers ::__construct + */ + public function testContructWillValidateCurrencyCode(): void + { + $currency = new Currency('usd'); + + $this->assertSame('USD', $currency->getCurrencyCode()); + } + /** * @covers ::__callStatic * @covers ::__construct diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php index c4a89a3a..a3fae2cc 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/GetCurrencyQueryTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\Money\Tests\Query\Currency; +namespace SonsOfPHP\Component\Money\Tests\Query\CurrencyProvider; use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Currency; diff --git a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php index 922f0019..ce889b40 100644 --- a/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/Query/CurrencyProvider/HasCurrencyQueryTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Component\Money\Tests\Query\Currency; +namespace SonsOfPHP\Component\Money\Tests\Query\CurrencyProvider; use PHPUnit\Framework\TestCase; use SonsOfPHP\Component\Money\Currency; diff --git a/tools/infection/composer.json b/tools/infection/composer.json new file mode 100644 index 00000000..52c4ca17 --- /dev/null +++ b/tools/infection/composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "infection/infection": "^0.27.8" + }, + "config": { + "allow-plugins": { + "infection/extension-installer": true + } + } +} From c1ef7392422835ff0720621ff09add272a457259 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Fri, 17 Nov 2023 13:59:02 -0500 Subject: [PATCH 04/10] jsonSerailizable --- src/SonsOfPHP/Component/Money/Money.php | 10 +++++++++- src/SonsOfPHP/Component/Money/Tests/MoneyTest.php | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/SonsOfPHP/Component/Money/Money.php b/src/SonsOfPHP/Component/Money/Money.php index 94994bde..6ac58c35 100644 --- a/src/SonsOfPHP/Component/Money/Money.php +++ b/src/SonsOfPHP/Component/Money/Money.php @@ -25,7 +25,7 @@ /** * @author Joshua Estes */ -final class Money implements MoneyInterface +final class Money implements MoneyInterface, \JsonSerializable { private AmountInterface $amount; private CurrencyInterface $currency; @@ -151,4 +151,12 @@ public function divide($divisor): MoneyInterface { return $this->with(new DivideMoneyOperator($divisor)); } + + public function jsonSerialize(): array + { + return [ + 'amount' => $this->getAmount()->toInt(), + 'currency' => $this->getCurrency()->getCurrencyCode(), + ]; + } } diff --git a/src/SonsOfPHP/Component/Money/Tests/MoneyTest.php b/src/SonsOfPHP/Component/Money/Tests/MoneyTest.php index 8f8ab3ad..59b65da7 100644 --- a/src/SonsOfPHP/Component/Money/Tests/MoneyTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/MoneyTest.php @@ -363,4 +363,14 @@ public function testDivide(): void $output = $money1->divide(5); $this->assertSame('20', (string) $output->getAmount()); } + + /** + * @covers ::jsonSerialize + */ + public function testJsonSerialize(): void + { + $money = Money::USD(420); + + $this->assertSame('{"amount":420,"currency":"USD"}', json_encode($money)); + } } From 573c021e08e4381a7fa8c753e7f392e093ae9b3d Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Sun, 19 Nov 2023 14:38:38 -0500 Subject: [PATCH 05/10] updates --- src/SonsOfPHP/Component/Money/Amount.php | 12 +++++----- .../Component/Money/Tests/AmountTest.php | 16 +++++++++++++ .../Component/Money/Tests/MoneyTest.php | 8 +++++++ .../Contract/Money/AmountInterface.php | 24 +++++++++---------- 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/src/SonsOfPHP/Component/Money/Amount.php b/src/SonsOfPHP/Component/Money/Amount.php index edc4e81b..d986f484 100644 --- a/src/SonsOfPHP/Component/Money/Amount.php +++ b/src/SonsOfPHP/Component/Money/Amount.php @@ -60,32 +60,32 @@ public function getAmount(): string return $this->amount; } - public function with(AmountOperatorInterface $operator): AmountInterface + public function with(AmountOperatorInterface $operator): static { return $operator->apply($this); } - public function query(AmountQueryInterface $query) + public function query(AmountQueryInterface $query)/*: mixed*/ { return $query->queryFrom($this); } - public function add(AmountInterface $amount): AmountInterface + public function add(AmountInterface $amount): static { return $this->with(new AddAmountOperator($amount)); } - public function subtract(AmountInterface $amount): AmountInterface + public function subtract(AmountInterface $amount): static { return $this->with(new SubtractAmountOperator($amount)); } - public function multiply($multiplier): AmountInterface + public function multiply($multiplier): static { return $this->with(new MultiplyAmountOperator($multiplier)); } - public function divide($divisor): AmountInterface + public function divide($divisor): static { return $this->with(new DivideAmountOperator($divisor)); } diff --git a/src/SonsOfPHP/Component/Money/Tests/AmountTest.php b/src/SonsOfPHP/Component/Money/Tests/AmountTest.php index 700bf28c..07bb9a43 100644 --- a/src/SonsOfPHP/Component/Money/Tests/AmountTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/AmountTest.php @@ -27,6 +27,22 @@ */ final class AmountTest extends TestCase { + public static function validAmountProvider(): iterable + { + yield [420]; + yield ['420']; + yield [-420]; + yield ['-420']; + } + + public static function invalidAmountProvider(): iterable + { + yield [4.20]; + yield ['4.20']; + yield [-4.20]; + yield ['-4.20']; + } + /** * @covers ::__construct */ diff --git a/src/SonsOfPHP/Component/Money/Tests/MoneyTest.php b/src/SonsOfPHP/Component/Money/Tests/MoneyTest.php index 59b65da7..2ed99691 100644 --- a/src/SonsOfPHP/Component/Money/Tests/MoneyTest.php +++ b/src/SonsOfPHP/Component/Money/Tests/MoneyTest.php @@ -44,6 +44,14 @@ */ final class MoneyTest extends TestCase { + public static function validMoneyConstructorArgumentsProvider(): iterable + { + yield [420, 'usd']; + yield [420, new Currency('usd')]; + yield [-420, 'usd']; + yield [-420, new Currency('usd')]; + } + /** * @covers ::__callStatic * @covers ::__construct diff --git a/src/SonsOfPHP/Contract/Money/AmountInterface.php b/src/SonsOfPHP/Contract/Money/AmountInterface.php index cd1485df..260b0c5b 100644 --- a/src/SonsOfPHP/Contract/Money/AmountInterface.php +++ b/src/SonsOfPHP/Contract/Money/AmountInterface.php @@ -14,12 +14,12 @@ * * @author Joshua Estes */ -interface AmountInterface // extends \Stringable +interface AmountInterface// extends \Stringable { /** * Allows you to run you own operations of the amount. */ - public function with(AmountOperatorInterface $operator): self; + public function with(AmountOperatorInterface $operator): static; /** * Allows you to ask different questions about the amount and get @@ -40,7 +40,7 @@ public function toInt(): int; /** * Returns the value for this amount as a float. */ - public function toFloat(): float; + //public function toFloat(): float; /** * Returns the value that this is for the object. @@ -50,7 +50,7 @@ public function getAmount(): string; /** * Add amounts together. */ - public function add(self $amount): self; + public function add(AmountInterface $amount): static; /** * Subtract amounts from each other. @@ -61,27 +61,27 @@ public function add(self $amount): self; * $amount1->subtract($amount2) == 50 * $amount2->subtract($amount1) == -50 */ - public function subtract(self $amount): self; + public function subtract(AmountInterface $amount): static; /** * Multiply amount by a specific amount. */ - public function multiply($multiplier): self; + public function multiply(/*int */$multiplier): static; /** * Divide the amount by a specific amount. */ - public function divide($divisor): self; + public function divide(/*int */$divisor): static; - public function isEqualTo(self $amount): bool; + public function isEqualTo(AmountInterface $amount): bool; - public function isGreaterThan(self $amount): bool; + public function isGreaterThan(AmountInterface $amount): bool; - public function isGreaterThanOrEqualTo(self $amount): bool; + public function isGreaterThanOrEqualTo(AmountInterface $amount): bool; - public function isLessThan(self $amount): bool; + public function isLessThan(AmountInterface $amount): bool; - public function isLessThanOrEqualTo(self $amount): bool; + public function isLessThanOrEqualTo(AmountInterface $amount): bool; public function isNegative(): bool; From 51e4b8d0b65c4e6e359c5448a042a4d088215f4c Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Mon, 20 Nov 2023 19:40:21 -0500 Subject: [PATCH 06/10] cs fixes --- .../EventSourcing/Tests/Message/MessageNormalizerTest.php | 3 +-- .../Tests/Aggregate/Repository/AggregateRepositoryTest.php | 6 +++--- src/SonsOfPHP/Contract/Money/AmountInterface.php | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/SonsOfPHP/Bridge/Symfony/EventSourcing/Tests/Message/MessageNormalizerTest.php b/src/SonsOfPHP/Bridge/Symfony/EventSourcing/Tests/Message/MessageNormalizerTest.php index 531ab123..5954cf6d 100644 --- a/src/SonsOfPHP/Bridge/Symfony/EventSourcing/Tests/Message/MessageNormalizerTest.php +++ b/src/SonsOfPHP/Bridge/Symfony/EventSourcing/Tests/Message/MessageNormalizerTest.php @@ -38,8 +38,7 @@ public function testItWillNormalizeMessage(): void { $normalizer = new MessageNormalizer(); - $message = new class extends AbstractMessage { - }; + $message = new class () extends AbstractMessage {}; $this->assertTrue($normalizer->supportsNormalization($message)); diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php index 325040db..55c63e7f 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php @@ -68,7 +68,7 @@ public function testPersistWillUseEventDispatcher(): void $aggregate = new FakeAggregate('unique-id'); - $message = new class extends AbstractMessage {}; + $message = new class () extends AbstractMessage {}; $aggregate->raiseThisEvent($message); $repository->persist($aggregate); @@ -88,7 +88,7 @@ public function testPersistAndFind(): void $aggregate = new FakeAggregate('unique-id'); - $message = new class extends AbstractMessage {}; + $message = new class () extends AbstractMessage {}; $aggregate->raiseThisEvent($message); $repository->persist($aggregate); @@ -111,7 +111,7 @@ public function testPersistAndFindWithoutUsingAggregateId(): void $aggregate = new FakeAggregate('unique-id'); - $message = new class extends AbstractMessage {}; + $message = new class () extends AbstractMessage {}; $aggregate->raiseThisEvent($message); $repository->persist($aggregate); diff --git a/src/SonsOfPHP/Contract/Money/AmountInterface.php b/src/SonsOfPHP/Contract/Money/AmountInterface.php index 260b0c5b..a2e2f5f4 100644 --- a/src/SonsOfPHP/Contract/Money/AmountInterface.php +++ b/src/SonsOfPHP/Contract/Money/AmountInterface.php @@ -14,7 +14,7 @@ * * @author Joshua Estes */ -interface AmountInterface// extends \Stringable +interface AmountInterface // extends \Stringable { /** * Allows you to run you own operations of the amount. From 9f290056dd6396e5621a6c68ed90152d466c8300 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Mon, 20 Nov 2023 21:00:15 -0500 Subject: [PATCH 07/10] updates --- bard.json | 12 +++++ docs/components/cqrs/index.md | 2 +- docs/components/pager/index.md | 38 ++++++++++++++ docs/contracts/common/index.md | 10 ++-- docs/contracts/index.md | 2 +- .../Doctrine/Collections/Pager/.gitattributes | 4 ++ .../Doctrine/Collections/Pager/.gitignore | 3 ++ .../Pager/ArrayCollectionAdapter.php | 34 ++++++++++++ .../Bridge/Doctrine/Collections/Pager/LICENSE | 19 +++++++ .../Doctrine/Collections/Pager/README.md | 17 ++++++ .../Doctrine/Collections/Pager/composer.json | 52 +++++++++++++++++++ .../Bridge/Doctrine/DBAL/Pager/.gitattributes | 4 ++ .../Bridge/Doctrine/DBAL/Pager/.gitignore | 3 ++ .../Bridge/Doctrine/DBAL/Pager/LICENSE | 19 +++++++ .../DBAL/Pager/QueryBuilderAdapter.php | 34 ++++++++++++ .../Bridge/Doctrine/DBAL/Pager/README.md | 17 ++++++ .../Bridge/Doctrine/DBAL/Pager/composer.json | 52 +++++++++++++++++++ .../Bridge/Doctrine/ORM/Pager/.gitattributes | 4 ++ .../Bridge/Doctrine/ORM/Pager/.gitignore | 3 ++ .../Bridge/Doctrine/ORM/Pager/LICENSE | 19 +++++++ .../Bridge/Doctrine/ORM/Pager/README.md | 17 ++++++ .../Bridge/Doctrine/ORM/Pager/composer.json | 52 +++++++++++++++++++ .../Component/Cqrs/AbstractMessage.php | 6 +++ src/SonsOfPHP/Component/Pager/Pager.php | 36 +++++++++++++ .../Contract/Common/ArrayableInterface.php | 2 - .../Contract/Common/TryableInterface.php | 24 +++++++++ .../Contract/Pager/PagerInterface.php | 16 ++++++ 27 files changed, 493 insertions(+), 8 deletions(-) create mode 100644 src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/.gitattributes create mode 100644 src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/.gitignore create mode 100644 src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/ArrayCollectionAdapter.php create mode 100644 src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/LICENSE create mode 100644 src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/README.md create mode 100644 src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json create mode 100644 src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/.gitattributes create mode 100644 src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/.gitignore create mode 100644 src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/LICENSE create mode 100644 src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/QueryBuilderAdapter.php create mode 100644 src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/README.md create mode 100644 src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json create mode 100644 src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/.gitattributes create mode 100644 src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/.gitignore create mode 100644 src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/LICENSE create mode 100644 src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/README.md create mode 100644 src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json create mode 100644 src/SonsOfPHP/Contract/Common/TryableInterface.php diff --git a/bard.json b/bard.json index b4815600..8837d7fa 100644 --- a/bard.json +++ b/bard.json @@ -81,6 +81,18 @@ "path": "src/SonsOfPHP/Component/Pager", "repository": "git@github.com:SonsOfPHP/pager.git" }, + { + "path": "src/SonsOfPHP/Bridge/Doctrine/Collections/Pager", + "repository": "git@github.com:SonsOfPHP/pager-doctrine-collections.git" + }, + { + "path": "src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager", + "repository": "git@github.com:SonsOfPHP/pager-doctrine-dbal.git" + }, + { + "path": "src/SonsOfPHP/Bridge/Doctrine/ORM/Pager", + "repository": "git@github.com:SonsOfPHP/pager-doctrine-orm.git" + }, { "path": "src/SonsOfPHP/Component/Version", "repository": "git@github.com:SonsOfPHP/version.git" diff --git a/docs/components/cqrs/index.md b/docs/components/cqrs/index.md index 80a93123..0ef0ca40 100644 --- a/docs/components/cqrs/index.md +++ b/docs/components/cqrs/index.md @@ -48,11 +48,11 @@ $queryBus->addHandler(GetUser::class, $handler); $query = (new GetUser())->with('id', 123); $user = $queryBus->handle($query); +``` !!! success "Symfony CQRS Bridge" Once the CQRS Symfony Bridge is installed, you can use the Query Bus that comes with that to gain addition features and functionality. -``` ## Messages diff --git a/docs/components/pager/index.md b/docs/components/pager/index.md index ab57ea4d..c23393aa 100644 --- a/docs/components/pager/index.md +++ b/docs/components/pager/index.md @@ -45,6 +45,25 @@ $pager = new Pager(new ArrayAdapter($results), [ // You can also set current page and max per page $pager->setCurrentPage(1); $pager->setMaxPerPage(10); + + +$totalPages = $pager->getTotalPages(); +$totalResults = $pager->getTotalResults(); +$currentPage = $pager->getCurrentPage(); + +if ($pager->haveToPaginate()) { + // ... +} + +if ($pager->hasPreviousPage()) { + $prevPage = $pager->getPreviousPage(); + // ... +} + +if ($pager->hasNextPage()) { + $nextPage = $pager->getNextPage(); + // ... +} ``` ## Adapters @@ -77,3 +96,22 @@ $adapter = new CallableAdapter( }, ); ``` + +### ArrayCollectionAdapter + + +!!! warning + ```shell + composer require sonsofphp/pager-doctrine-collections + ``` + +```php + + */ +class ArrayCollectionAdapter implements AdapterInterface +{ + public function __construct( + private ArrayCollection $collection, + ) {} + + /** + * {@inheritdoc} + */ + public function count(): int + { + return count($this->collection); + } + + /** + * {@inheritdoc} + */ + public function getSlice(int $offset, ?int $length): iterable + { + return $this->collection->slice($offset, $length); + } +} diff --git a/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/LICENSE b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/LICENSE new file mode 100644 index 00000000..39238382 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 to Present Joshua Estes + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/README.md b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/README.md new file mode 100644 index 00000000..4b3b2a60 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/README.md @@ -0,0 +1,17 @@ +Sons of PHP - Pager (doctrine/collections) +========================================== + +## Learn More + +* [Documentation][docs] +* [Contributing][contributing] +* [Report Issues][issues] and [Submit Pull Requests][pull-requests] in the + [Mother Repository][mother-repo] +* Get Help & Support using [Discussions][discussions] + +[discussions]: https://github.com/orgs/SonsOfPHP/discussions +[mother-repo]: https://github.com/SonsOfPHP/sonsofphp +[contributing]: https://docs.sonsofphp.com/contributing/ +[docs]: https://docs.sonsofphp.com/components/pager/ +[issues]: https://github.com/SonsOfPHP/sonsofphp/issues?q=is%3Aopen+is%3Aissue+label%3APager +[pull-requests]: https://github.com/SonsOfPHP/sonsofphp/pulls?q=is%3Aopen+is%3Apr+label%3APager diff --git a/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json new file mode 100644 index 00000000..7f802d4d --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json @@ -0,0 +1,52 @@ +{ + "name": "sonsofphp/pager-doctrine-collections", + "type": "library", + "description": "", + "keywords": [ + "pager" + ], + "homepage": "https://github.com/SonsOfPHP/pager-doctrine-collections", + "license": "MIT", + "authors": [ + { + "name": "Joshua Estes", + "email": "joshua@sonsofphp.com" + } + ], + "support": { + "issues": "https://github.com/SonsOfPHP/sonsofphp/issues", + "forum": "https://github.com/orgs/SonsOfPHP/discussions", + "docs": "https://docs.sonsofphp.com/components/pager" + }, + "autoload": { + "psr-4": { + "SonsOfPHP\\Bridge\\Doctrine\\Collections\\Pager\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=8.1", + "doctrine/collections": "^2", + "sonsofphp/pager": "^0.3.x-dev" + }, + "extra": { + "sort-packages": true, + "branch-alias": { + "dev-main": "0.3.x-dev" + } + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/JoshuaEstes" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" + } + ] +} diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/.gitattributes b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/.gitattributes new file mode 100644 index 00000000..84c7add0 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/.gitattributes @@ -0,0 +1,4 @@ +/Tests export-ignore +/phpunit.xml.dist export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/.gitignore b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/.gitignore new file mode 100644 index 00000000..5414c2c6 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/.gitignore @@ -0,0 +1,3 @@ +composer.lock +phpunit.xml +vendor/ diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/LICENSE b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/LICENSE new file mode 100644 index 00000000..39238382 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 to Present Joshua Estes + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/QueryBuilderAdapter.php b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/QueryBuilderAdapter.php new file mode 100644 index 00000000..626fb386 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/QueryBuilderAdapter.php @@ -0,0 +1,34 @@ + + */ +class QueryBuilderAdapter implements AdapterInterface +{ + public function __construct( + private QueryBuilder $builder, + ) {} + + /** + * {@inheritdoc} + */ + public function count(): int + { + throw new \Exception('@todo'); + } + + /** + * {@inheritdoc} + */ + public function getSlice(int $offset, ?int $length): iterable + { + throw new \Exception('@todo'); + } +} diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/README.md b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/README.md new file mode 100644 index 00000000..1e8c9a14 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/README.md @@ -0,0 +1,17 @@ +Sons of PHP - Pager (doctrine/dbal) +=================================== + +## Learn More + +* [Documentation][docs] +* [Contributing][contributing] +* [Report Issues][issues] and [Submit Pull Requests][pull-requests] in the + [Mother Repository][mother-repo] +* Get Help & Support using [Discussions][discussions] + +[discussions]: https://github.com/orgs/SonsOfPHP/discussions +[mother-repo]: https://github.com/SonsOfPHP/sonsofphp +[contributing]: https://docs.sonsofphp.com/contributing/ +[docs]: https://docs.sonsofphp.com/components/pager/ +[issues]: https://github.com/SonsOfPHP/sonsofphp/issues?q=is%3Aopen+is%3Aissue+label%3APager +[pull-requests]: https://github.com/SonsOfPHP/sonsofphp/pulls?q=is%3Aopen+is%3Apr+label%3APager diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json new file mode 100644 index 00000000..faff540e --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json @@ -0,0 +1,52 @@ +{ + "name": "sonsofphp/pager-doctrine-dbal", + "type": "library", + "description": "", + "keywords": [ + "pager" + ], + "homepage": "https://github.com/SonsOfPHP/pager-doctrine-dbal", + "license": "MIT", + "authors": [ + { + "name": "Joshua Estes", + "email": "joshua@sonsofphp.com" + } + ], + "support": { + "issues": "https://github.com/SonsOfPHP/sonsofphp/issues", + "forum": "https://github.com/orgs/SonsOfPHP/discussions", + "docs": "https://docs.sonsofphp.com/components/pager" + }, + "autoload": { + "psr-4": { + "SonsOfPHP\\Bridge\\Doctrine\\DBAL\\Pager\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=8.1", + "doctrine/dbal": "^3", + "sonsofphp/pager": "^0.3.x-dev" + }, + "extra": { + "sort-packages": true, + "branch-alias": { + "dev-main": "0.3.x-dev" + } + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/JoshuaEstes" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" + } + ] +} diff --git a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/.gitattributes b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/.gitattributes new file mode 100644 index 00000000..84c7add0 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/.gitattributes @@ -0,0 +1,4 @@ +/Tests export-ignore +/phpunit.xml.dist export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore diff --git a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/.gitignore b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/.gitignore new file mode 100644 index 00000000..5414c2c6 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/.gitignore @@ -0,0 +1,3 @@ +composer.lock +phpunit.xml +vendor/ diff --git a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/LICENSE b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/LICENSE new file mode 100644 index 00000000..39238382 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 to Present Joshua Estes + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/README.md b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/README.md new file mode 100644 index 00000000..871e0150 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/README.md @@ -0,0 +1,17 @@ +Sons of PHP - Pager (doctrine/orm) +========================================== + +## Learn More + +* [Documentation][docs] +* [Contributing][contributing] +* [Report Issues][issues] and [Submit Pull Requests][pull-requests] in the + [Mother Repository][mother-repo] +* Get Help & Support using [Discussions][discussions] + +[discussions]: https://github.com/orgs/SonsOfPHP/discussions +[mother-repo]: https://github.com/SonsOfPHP/sonsofphp +[contributing]: https://docs.sonsofphp.com/contributing/ +[docs]: https://docs.sonsofphp.com/components/pager/ +[issues]: https://github.com/SonsOfPHP/sonsofphp/issues?q=is%3Aopen+is%3Aissue+label%3APager +[pull-requests]: https://github.com/SonsOfPHP/sonsofphp/pulls?q=is%3Aopen+is%3Apr+label%3APager diff --git a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json new file mode 100644 index 00000000..17c56013 --- /dev/null +++ b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json @@ -0,0 +1,52 @@ +{ + "name": "sonsofphp/pager-doctrine-orm", + "type": "library", + "description": "", + "keywords": [ + "pager" + ], + "homepage": "https://github.com/SonsOfPHP/pager-doctrine-orm", + "license": "MIT", + "authors": [ + { + "name": "Joshua Estes", + "email": "joshua@sonsofphp.com" + } + ], + "support": { + "issues": "https://github.com/SonsOfPHP/sonsofphp/issues", + "forum": "https://github.com/orgs/SonsOfPHP/discussions", + "docs": "https://docs.sonsofphp.com/components/pager" + }, + "autoload": { + "psr-4": { + "SonsOfPHP\\Bridge\\Doctrine\\ORM\\Pager\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=8.1", + "doctrine/orm": "^2", + "sonsofphp/pager": "^0.3.x-dev" + }, + "extra": { + "sort-packages": true, + "branch-alias": { + "dev-main": "0.3.x-dev" + } + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/JoshuaEstes" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" + } + ] +} diff --git a/src/SonsOfPHP/Component/Cqrs/AbstractMessage.php b/src/SonsOfPHP/Component/Cqrs/AbstractMessage.php index 06de1337..ed3ad4fe 100644 --- a/src/SonsOfPHP/Component/Cqrs/AbstractMessage.php +++ b/src/SonsOfPHP/Component/Cqrs/AbstractMessage.php @@ -13,6 +13,9 @@ abstract class AbstractMessage implements MessageInterface, \JsonSerializable, \ { private array $payload = []; + /** + * {@inheritdoc} + */ public function with(string|array $key, mixed $value = null): static { if (is_object($value) && !$value instanceof \Stringable) { @@ -54,6 +57,9 @@ public function with(string|array $key, mixed $value = null): static return $that; } + /** + * {@inheritdoc} + */ public function get(?string $key = null): mixed { if (null === $key) { diff --git a/src/SonsOfPHP/Component/Pager/Pager.php b/src/SonsOfPHP/Component/Pager/Pager.php index 1c40f569..5612fa16 100644 --- a/src/SonsOfPHP/Component/Pager/Pager.php +++ b/src/SonsOfPHP/Component/Pager/Pager.php @@ -35,6 +35,9 @@ public function __construct( } } + /** + * {@inheritdoc} + */ public function getCurrentPageResults(): iterable { if (null === $this->results) { @@ -49,6 +52,9 @@ public function getCurrentPageResults(): iterable return $this->results; } + /** + * {@inheritdoc} + */ public function getTotalResults(): int { if (null === $this->count) { @@ -58,6 +64,9 @@ public function getTotalResults(): int return $this->count; } + /** + * {@inheritdoc} + */ public function getTotalPages(): int { if (null === $this->getMaxPerPage() || 0 === $this->getTotalResults()) { @@ -67,6 +76,9 @@ public function getTotalPages(): int return (int) ceil($this->getTotalResults() / $this->getMaxPerPage()); } + /** + * {@inheritdoc} + */ public function haveToPaginate(): bool { if (null === $this->getMaxPerPage()) { @@ -76,11 +88,17 @@ public function haveToPaginate(): bool return $this->getTotalResults() > $this->getMaxPerPage(); } + /** + * {@inheritdoc} + */ public function hasPreviousPage(): bool { return $this->getCurrentPage() > 1; } + /** + * {@inheritdoc} + */ public function getPreviousPage(): ?int { if ($this->hasPreviousPage()) { @@ -90,11 +108,17 @@ public function getPreviousPage(): ?int return null; } + /** + * {@inheritdoc} + */ public function hasNextPage(): bool { return $this->getCurrentPage() < $this->getTotalPages(); } + /** + * {@inheritdoc} + */ public function getNextPage(): ?int { if ($this->hasNextPage()) { @@ -104,11 +128,17 @@ public function getNextPage(): ?int return null; } + /** + * {@inheritdoc} + */ public function getCurrentPage(): int { return $this->currentPage; } + /** + * {@inheritdoc} + */ public function setCurrentPage(int $page): void { if (1 > $page) { @@ -119,11 +149,17 @@ public function setCurrentPage(int $page): void $this->results = null; } + /** + * {@inheritdoc} + */ public function getMaxPerPage(): ?int { return $this->maxPerPage; } + /** + * {@inheritdoc} + */ public function setMaxPerPage(?int $maxPerPage): void { if (is_int($maxPerPage) && 1 > $maxPerPage) { diff --git a/src/SonsOfPHP/Contract/Common/ArrayableInterface.php b/src/SonsOfPHP/Contract/Common/ArrayableInterface.php index 1771476a..823452a3 100644 --- a/src/SonsOfPHP/Contract/Common/ArrayableInterface.php +++ b/src/SonsOfPHP/Contract/Common/ArrayableInterface.php @@ -9,7 +9,5 @@ */ interface ArrayableInterface { - /** - */ public function toArray(): array; } diff --git a/src/SonsOfPHP/Contract/Common/TryableInterface.php b/src/SonsOfPHP/Contract/Common/TryableInterface.php new file mode 100644 index 00000000..e74e2f14 --- /dev/null +++ b/src/SonsOfPHP/Contract/Common/TryableInterface.php @@ -0,0 +1,24 @@ + + */ +interface TryableInterface +{ + /** + * Pass in $data and the object is built. + * + * @throws \InvalidArgumentException + * If $data is invalid + */ + public static function from(mixed $data): static; + + /** + * Pass in data and if the data is invalid it will return null + */ + public function tryFrom(mixed $data): ?static; +} diff --git a/src/SonsOfPHP/Contract/Pager/PagerInterface.php b/src/SonsOfPHP/Contract/Pager/PagerInterface.php index 3272a565..38e2f8df 100644 --- a/src/SonsOfPHP/Contract/Pager/PagerInterface.php +++ b/src/SonsOfPHP/Contract/Pager/PagerInterface.php @@ -20,12 +20,25 @@ interface PagerInterface extends \Countable, \IteratorAggregate, \JsonSerializab */ public function getCurrentPageResults(): iterable; + /** + * Returns the total number of results that the adapter can return + */ public function getTotalResults(): int; + /** + * Returns the total number of pages that exist based on the total results + * and the max results per page + */ public function getTotalPages(): int; + /** + * Returns true if there are 2 or more total pages + */ public function haveToPaginate(): bool; + /** + * If there is a previous page available, this will return true + */ public function hasPreviousPage(): bool; /** @@ -33,6 +46,9 @@ public function hasPreviousPage(): bool; */ public function getPreviousPage(): ?int; + /** + * If there is a next page available, this will return true + */ public function hasNextPage(): bool; /** From d11458725ec262c7e8d8aea2bf316c3a17817f81 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Mon, 20 Nov 2023 21:03:55 -0500 Subject: [PATCH 08/10] phpunit update --- phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ae5f3b3a..b3261ee3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -78,6 +78,7 @@ + src/SonsOfPHP/Bridge/*/*/Pager/Tests src/SonsOfPHP/Component/Pager/Tests From 667b948822c7d37abd2911d072c45cf69efc247e Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Mon, 20 Nov 2023 21:06:15 -0500 Subject: [PATCH 09/10] ignore more --- phpunit.xml.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b3261ee3..5ab54b33 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -97,6 +97,8 @@ src/SonsOfPHP/Bard/vendor + src/SonsOfPHP/Bridge/*/*/*/Tests + src/SonsOfPHP/Bridge/*/*/*/vendor src/SonsOfPHP/Bridge/*/*/Tests src/SonsOfPHP/Bridge/*/*/vendor src/SonsOfPHP/Bundle/*/Tests From 364dd75c143db2b1e97d76e1258d903e8cb7cad1 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Mon, 20 Nov 2023 21:20:41 -0500 Subject: [PATCH 10/10] updates --- composer.json | 15 +++++++++++++-- .../Doctrine/Collections/Pager/composer.json | 4 ++-- .../Doctrine/DBAL/Pager/QueryBuilderAdapter.php | 2 +- .../Bridge/Doctrine/DBAL/Pager/composer.json | 4 ++-- .../Bridge/Doctrine/ORM/Pager/composer.json | 4 ++-- .../Component/Cache/Tests/CacheItemTest.php | 6 +++--- 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index ac53097c..d42f8f7f 100644 --- a/composer.json +++ b/composer.json @@ -72,7 +72,9 @@ "psr/log": "^1.0 || ^2.0 || ^3.0", "psr/link": "^1.0 || ^2.0", "twig/twig": "^3.0", - "ext-intl": "*" + "ext-intl": "*", + "doctrine/collections": "^2", + "doctrine/orm": "^2" }, "replace": { "sonsofphp/bard": "self.version", @@ -105,7 +107,10 @@ "sonsofphp/pager-contract": "self.version", "sonsofphp/pager": "self.version", "sonsofphp/link": "self.version", - "sonsofphp/money-twig": "self.version" + "sonsofphp/money-twig": "self.version", + "sonsofphp/pager-doctrine-collections": "self.version", + "sonsofphp/pager-doctrine-dbal": "self.version", + "sonsofphp/pager-doctrine-orm": "self.version" }, "autoload": { "psr-4": { @@ -129,6 +134,9 @@ "SonsOfPHP\\Component\\Logger\\": "src/SonsOfPHP/Component/Logger", "SonsOfPHP\\Component\\Money\\": "src/SonsOfPHP/Component/Money", "SonsOfPHP\\Component\\Pager\\": "src/SonsOfPHP/Component/Pager", + "SonsOfPHP\\Bridge\\Doctrine\\Collections\\Pager\\": "src/SonsOfPHP/Bridge/Doctrine/Collections/Pager", + "SonsOfPHP\\Bridge\\Doctrine\\DBAL\\Pager\\": "src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager", + "SonsOfPHP\\Bridge\\Doctrine\\ORM\\Pager\\": "src/SonsOfPHP/Bridge/Doctrine/ORM/Pager", "SonsOfPHP\\Component\\Version\\": "src/SonsOfPHP/Component/Version", "SonsOfPHP\\Contract\\Common\\": "src/SonsOfPHP/Contract/Common", "SonsOfPHP\\Contract\\Cqrs\\": "src/SonsOfPHP/Contract/Cqrs", @@ -161,6 +169,9 @@ "src/SonsOfPHP/Component/Logger/Tests", "src/SonsOfPHP/Component/Money/Tests", "src/SonsOfPHP/Component/Pager/Tests", + "src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/Tests", + "src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/Tests", + "src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/Tests", "src/SonsOfPHP/Component/Version/Tests" ] }, diff --git a/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json index 7f802d4d..9ff71f0f 100644 --- a/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json +++ b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json @@ -16,7 +16,7 @@ "support": { "issues": "https://github.com/SonsOfPHP/sonsofphp/issues", "forum": "https://github.com/orgs/SonsOfPHP/discussions", - "docs": "https://docs.sonsofphp.com/components/pager" + "docs": "https://docs.sonsofphp.com" }, "autoload": { "psr-4": { @@ -49,4 +49,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} +} \ No newline at end of file diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/QueryBuilderAdapter.php b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/QueryBuilderAdapter.php index 626fb386..66ecfd23 100644 --- a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/QueryBuilderAdapter.php +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/QueryBuilderAdapter.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SonsOfPHP\Bridge\Doctrine\Collections\Pager; +namespace SonsOfPHP\Bridge\Doctrine\DBAL\Pager; use Doctrine\DBAL\Query\QueryBuilder; use SonsOfPHP\Contract\Pager\AdapterInterface; diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json index faff540e..4da91f2e 100644 --- a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json @@ -16,7 +16,7 @@ "support": { "issues": "https://github.com/SonsOfPHP/sonsofphp/issues", "forum": "https://github.com/orgs/SonsOfPHP/discussions", - "docs": "https://docs.sonsofphp.com/components/pager" + "docs": "https://docs.sonsofphp.com" }, "autoload": { "psr-4": { @@ -49,4 +49,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} +} \ No newline at end of file diff --git a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json index 17c56013..7b1197a9 100644 --- a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json +++ b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json @@ -16,7 +16,7 @@ "support": { "issues": "https://github.com/SonsOfPHP/sonsofphp/issues", "forum": "https://github.com/orgs/SonsOfPHP/discussions", - "docs": "https://docs.sonsofphp.com/components/pager" + "docs": "https://docs.sonsofphp.com" }, "autoload": { "psr-4": { @@ -49,4 +49,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} +} \ No newline at end of file diff --git a/src/SonsOfPHP/Component/Cache/Tests/CacheItemTest.php b/src/SonsOfPHP/Component/Cache/Tests/CacheItemTest.php index 7f719e67..cd8dc9c0 100644 --- a/src/SonsOfPHP/Component/Cache/Tests/CacheItemTest.php +++ b/src/SonsOfPHP/Component/Cache/Tests/CacheItemTest.php @@ -151,10 +151,10 @@ public function testValidateKeyWithInvalidValues(string $key): void public static function invalidKeysProvider(): iterable { - yield ['']; + yield 'empty' => ['']; - yield ['not allowed']; + yield 'space' => ['not allowed']; - yield ['contains@reserved}characters']; + yield 'reserved' => ['contains@reserved}characters']; } }