You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Possible Bug:
The removal of the extra parameter in event constructors across various files might lead to issues if the extra data was being used elsewhere in the application. It's important to ensure that this data was indeed unused.
Refactoring Concern:
The refactoring in src/GraphQL/Mutations/DispatchMutation.php and other mutation files to use a new method getFuelTankCall for building encoded calls needs thorough testing to ensure that the new method handles all cases correctly.
Versioning Logic:
The logic to append 'V1010' to method names based on the isRunningLatest() condition could lead to errors if not handled correctly across all environments or if the function's behavior changes unexpectedly.
Why: This suggestion enhances code readability and maintainability by isolating the logic for extracting 'paysRemainingFee' into a separate method. This makes the code more modular and easier to manage.
8
Simplify the method name determination by using a dedicated method
Replace the ternary operation with a direct method call to improve readability and reduce complexity.
Why: The suggestion improves readability and maintainability by encapsulating the logic for determining the method name into a dedicated method. This reduces complexity and makes the code easier to understand and modify in the future.
7
Encapsulate the conditional logic for rule set extras into a method
Consolidate the conditional logic for 'rules' and 'requireAccount' into a method to enhance code reusability and readability.
Why: The suggestion improves code reusability and readability by consolidating the conditional logic into a dedicated method. This makes the code cleaner and easier to maintain.
7
Refactor the match statement into a method to handle different query types
Use a method to handle the switch logic for loading different fuel tank data based on the query type, improving modularity and readability.
Why: This suggestion enhances modularity and readability by moving the switch logic into a dedicated method. This makes the code more organized and easier to extend or modify in the future.
7
Improve code readability and maintainability by using descriptive variable names
Use a more descriptive variable name for the raw call data to enhance code readability and maintainability.
Why: Using assertSame ensures both type and value are checked, which is crucial for avoiding subtle bugs in tests due to type coercion.
8
Improve clarity and prevent potential bugs by using explicit conditional checks
Consider using a more explicit conditional check instead of the shorthand ?: operator for clarity and to avoid potential bugs with unexpected null values.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Tests, Configuration changes
Description
getFuelTankCall
method and null coalescing operator.rector/rector
dependency and updated scripts.Changes walkthrough 📝
4 files
rector.php
Add Rector configuration for code quality and standards
rector.php
run_tests.yml
Rename workflow to Unit & Functional Tests
.github/workflows/run_tests.yml
sast.yml
Add Static Application Security Testing workflow
.github/workflows/sast.yml
security_checker.yml
Rename workflow to Dependencies Security Checker
.github/workflows/security_checker.yml
19 files
AccountAdded.php
Remove unused parameter from AccountAdded constructor
src/Events/Substrate/FuelTanks/AccountAdded.php
$extra
parameter from constructor.AccountRemoved.php
Remove unused parameter from AccountRemoved constructor
src/Events/Substrate/FuelTanks/AccountRemoved.php
$extra
parameter from constructor.CallDispatched.php
Remove unused parameter from CallDispatched constructor
src/Events/Substrate/FuelTanks/CallDispatched.php
$extra
parameter from constructor.FreezeStateMutated.php
Remove unused parameter from FreezeStateMutated constructor
src/Events/Substrate/FuelTanks/FreezeStateMutated.php
$extra
parameter from constructor.FuelTankDestroyed.php
Remove unused parameter from FuelTankDestroyed constructor
src/Events/Substrate/FuelTanks/FuelTankDestroyed.php
$extra
parameter from constructor.FuelTankMutated.php
Remove unused parameter from FuelTankMutated constructor
src/Events/Substrate/FuelTanks/FuelTankMutated.php
$extra
parameter from constructor.RuleSetInserted.php
Remove unused parameter from RuleSetInserted constructor
src/Events/Substrate/FuelTanks/RuleSetInserted.php
$extra
parameter from constructor.RuleSetRemoved.php
Remove unused parameter from RuleSetRemoved constructor
src/Events/Substrate/FuelTanks/RuleSetRemoved.php
$extra
parameter from constructor.CreateFuelTankMutation.php
Add versioning and update encoding parameters for
CreateFuelTankMutation
src/GraphQL/Mutations/CreateFuelTankMutation.php
DispatchMutation.php
Refactor DispatchMutation to use getFuelTankCall method
src/GraphQL/Mutations/DispatchMutation.php
getFuelTankCall
method.paysRemainingFee
.InsertRuleSetMutation.php
Add versioning and update encoding parameters for
InsertRuleSetMutation
src/GraphQL/Mutations/InsertRuleSetMutation.php
MutateFuelTankMutation.php
Add versioning and update encoding parameters for
MutateFuelTankMutation
src/GraphQL/Mutations/MutateFuelTankMutation.php
RemoveAccountRuleDataMutation.php
Add versioning to RemoveAccountRuleDataMutation method names
src/GraphQL/Mutations/RemoveAccountRuleDataMutation.php
HasFuelTankValidationRules.php
Refactor validation rules to use arrow functions
src/GraphQL/Traits/HasFuelTankValidationRules.php
EagerLoadSelectFields.php
Refactor selectFields method and add type hints
src/Models/Laravel/Traits/EagerLoadSelectFields.php
selectFields
method to use match expression.PermittedExtrinsicsParams.php
Add type casting to explode function calls
src/Models/Substrate/PermittedExtrinsicsParams.php
explode
function calls.Encoder.php
Add versioned method names to call index keys
src/Services/Processor/Substrate/Codec/Encoder.php
FuelTankSubstrateEvent.php
Replace __CLASS__ with self::class in exception message
src/Services/Processor/Substrate/Events/FuelTankSubstrateEvent.php
__CLASS__
withself::class
in exception message.Parser.php
Refactor constructor to use property promotion
src/Services/Processor/Substrate/Parser.php
1 files
RequireSignatureParams.php
Fix formatting issue in validate method
src/Models/Substrate/RequireSignatureParams.php
validate
method.7 files
CreateFuelTankTest.php
Update test to use null coalescing operator
tests/Feature/GraphQL/Mutations/CreateFuelTankTest.php
DispatchAndTouchTest.php
Update tests to use getFuelTankCall method
tests/Feature/GraphQL/Mutations/DispatchAndTouchTest.php
getFuelTankCall
method.DispatchTest.php
Update tests to use getFuelTankCall method
tests/Feature/GraphQL/Mutations/DispatchTest.php
getFuelTankCall
method.TestCaseGraphQL.php
Add return type hints to anonymous functions
tests/Feature/GraphQL/TestCaseGraphQL.php
GenerateFuelTankData.php
Update test data generation to use null coalescing operator
tests/Feature/GraphQL/Traits/GenerateFuelTankData.php
EncodingTest.php
Update encoding tests to use getFuelTankCall method
tests/Unit/EncodingTest.php
getFuelTankCall
method.StorageTest.php
Update storage tests to reflect transition state
tests/Unit/StorageTest.php
1 files
composer.json
Add rector/rector dependency and update scripts
composer.json
rector/rector
dependency.