-
Notifications
You must be signed in to change notification settings - Fork 12
HP-2116: Run pipelines on php-billing repo #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c4ae34e
65767c9
cbf7ce4
11a8e59
754558a
4ac68f0
c03f134
aa7ae10
cea59ee
b032170
c4a1bd1
855c542
a8d68b6
2a4b521
66e981a
b964efa
dfb3961
190be29
31899db
17eb0ba
3f7342e
39a3ec6
d584450
8087a36
b065614
b43736d
2e713a1
92de32f
e0fa4e9
1bc51c4
0270de6
df10864
970a4d0
e1cc8f9
fff1f37
4439a57
ba283ef
a7a7e2c
0fc4e65
5aa527f
d89ddf0
2e5a115
92aa162
2b055fe
e0836b5
b3116a2
f29071b
44ba82e
fdeda2c
dff9001
f4e55ee
589a094
d4a4228
775d91a
05dc273
87ef792
35f7742
830571b
37c4e46
9933e9e
e10f3d8
dcbddc4
633210c
5c26c5c
ec4d5a8
d746d59
0b79794
ef04c3d
29faef7
b828397
3d38bf7
94bacfe
cf2b922
4bbedfa
6632a24
108caa2
e3a63cd
7371905
bf06b47
dd4553d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Psalm Static Analysis | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| schedule: | ||
| - cron: "0 9 * * 1" | ||
|
|
||
| jobs: | ||
| psalm: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| php: [ '8.3' ] | ||
| coverage-driver: [ pcov ] | ||
| name: PHP ${{ matrix.php }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Install PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| extensions: gmp | ||
| coverage: pcov | ||
| tools: composer:v2, infection | ||
|
|
||
| - name: Cache Composer packages | ||
| id: composer-cache | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: vendor | ||
| key: ${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} | ||
|
|
||
| - name: Update composer | ||
| run: composer self-update | ||
|
|
||
| - name: Composer install | ||
| if: steps.composer-cache.outputs.cache-hit != 'true' | ||
| run: composer install -n | ||
|
|
||
| - name: Run Psalm | ||
| run: vendor/bin/psalm |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
|
|
||
| use DateTimeImmutable; | ||
| use hiqdev\php\billing\customer\CustomerInterface; | ||
| use hiqdev\php\billing\EntityInterface; | ||
| use hiqdev\php\billing\price\PriceInterface; | ||
| use hiqdev\php\billing\sale\SaleInterface; | ||
| use hiqdev\php\billing\target\TargetInterface; | ||
|
|
@@ -30,7 +31,7 @@ | |
| * | ||
| * @author Andrii Vasyliev <sol@hiqdev.com> | ||
| */ | ||
| interface ActionInterface extends \JsonSerializable | ||
| interface ActionInterface extends EntityInterface | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Update ActionInterface implementations and usages The change to
These changes will ensure consistency and prevent potential runtime issues due to the altered interface contract. Analysis chainVerify the impact of the interface signature change. The interface signature has been updated to extend Please ensure that:
Run the following script to verify the usage of Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify all implementations of `ActionInterface` adhere to the new contract.
# Test 1: Search for implementations of `ActionInterface`. Expect: Only occurrences of the new signature.
rg --type php -A 5 $'implements ActionInterface'
# Test 2: Search for usages of `JsonSerializable` methods in `ActionInterface` implementations. Expect: No occurrences.
rg --type php -A 5 $'jsonSerialize\('
Length of output: 5572 Script: #!/bin/bash
# Description: Further investigate the ActionInterface change and its impact
# Test 1: Search for class declarations that might implement ActionInterface
rg --type php -A 5 'class .+ implements .*ActionInterface'
# Test 2: Check if EntityInterface exists and what it declares
rg --type php -A 10 'interface EntityInterface'
# Test 3: Check for uses of ActionInterface
rg --type php 'use .*ActionInterface'
# Test 4: Look for abstract classes that might implement ActionInterface
rg --type php -A 5 'abstract class .+ implements .*ActionInterface'
Length of output: 4017 |
||
| { | ||
| /** | ||
| * Returns if the given price applicable to this action. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure proper handling of the integer part in
calculateMultiplierToInteger.The change in the
calculateMultiplierToIntegermethod discards the integer part of theamountstring by only extracting the fraction part usingexplode. This may lead to unexpected behavior if the method is called with anamountthat has a non-zero integer part.To handle the integer part appropriately, consider updating the method to use the integer part in the calculation of the multiplier. For example:
This change ensures that the integer part is considered in the calculation of the multiplier, aligning with the method's purpose of converting the entire
amountstring to an integer representation.