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 CreateListingV1010 call index key is duplicated with the same value as CreateListing. This might be an oversight or could cause unexpected behavior if different behaviors are expected for these versions.
Refactoring Concern:
The switch to arrow functions in GraphQL resolvers and other parts of the codebase should be thoroughly tested to ensure that the context ($this) and variable scoping behave as expected, especially in closures.
Data Handling:
The changes in how auction data is handled based on version checks (isRunningLatest()) need careful review to ensure that data integrity and application logic are maintained across different versions.
Type Casting:
The explicit casting of $value to string in MinimumPrice.php during the bccomp comparison should be checked to ensure it handles all expected input formats correctly without data loss or type issues.
Add null checks to lambda functions in resolve to prevent potential errors
Ensure that the lambda functions used in the resolve fields do not lead to unexpected behavior or performance issues, especially considering the use of $listing which might be null.
Why: Adding null checks in lambda functions is crucial to prevent potential runtime errors, ensuring the code handles edge cases gracefully.
9
Maintainability
Refactor the conditional assignment of extra to a separate method for clarity
Refactor the conditional structure for setting extra to improve readability and maintainability. Consider using a separate method to handle the conditional logic.
Why: Refactoring the conditional assignment to a separate method enhances readability and maintainability, making the code cleaner and easier to manage.
8
Remove or address the TODO comment in the code
Replace the commented TODO with an actionable implementation or remove it if not needed. Leaving TODO comments can lead to confusion and untracked technical debt.
-// TODO: We should remove `auctionData` and replace it with `listingData`+// Removed the TODO after implementation
Suggestion importance[1-10]: 7
Why: Removing or addressing TODO comments is important for maintainability, but it is not a critical issue. It helps in reducing technical debt and avoiding confusion.
7
Best practice
Clarify and encapsulate the version checking logic in a method
Ensure that the method isRunningLatest() is well-defined and its impact on the mutation logic is clear, especially in how it affects the encoding of auctionData.
Why: Encapsulating the version checking logic in a method improves code readability and maintainability, making the codebase easier to understand and modify in the future.
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, Bug fix, Tests
Description
listingData
support in GraphQL mutations and adjusted method naming based on version checks.MarketplaceListingType
to use arrow functions.EagerLoadSelectFields
trait and added type hints.CreateListingV1010
in call index keys.self::class
instead of__CLASS__
in exception messages.marketplaceService
inParser
.composer.json
to support PHP 8.3 and added Rector as a development dependency.Changes walkthrough 📝
7 files
rector.php
Add Rector configuration for code quality
rector.php
CreateListingMutation.php
Add listingData support and version-based method naming
src/GraphQL/Mutations/CreateListingMutation.php
listingData
in mutation arguments.listingData
.MarketplaceListingType.php
Refactor resolve functions to use arrow functions
src/GraphQL/Types/MarketplaceListingType.php
EagerLoadSelectFields.php
Refactor switch-case to match expression and add type hints
src/Models/Laravel/Traits/EagerLoadSelectFields.php
Encoder.php
Add support for CreateListingV1010 in call index keys
src/Services/Processor/Substrate/Codec/Encoder.php
CreateListingV1010
in call index keys.MarketplaceSubstrateEvent.php
Use self::class in exception message
src/Services/Processor/Substrate/Events/Implementations/MarketplaceSubstrateEvent.php
__CLASS__
withself::class
in exception message.Parser.php
Use property promotion for marketplaceService
src/Services/Processor/Substrate/Parser.php
marketplaceService
.1 files
MinimumPrice.php
Fix type casting issue in minimum price validation
src/Rules/MinimumPrice.php
1 files
TestCaseGraphQL.php
Add return type hints to anonymous functions in tests
tests/Feature/GraphQL/TestCaseGraphQL.php
1 files
composer.json
Add PHP 8.3 support and Rector dependency
composer.json