Skip to content

Update GatewayResolver.php#258

Open
itashia wants to merge 1 commit intolarabook:devfrom
itashia:patch-1
Open

Update GatewayResolver.php#258
itashia wants to merge 1 commit intolarabook:devfrom
itashia:patch-1

Conversation

@itashia
Copy link

@itashia itashia commented May 26, 2025

###Use Class Constants:
Replace long conditionals with a simple and readable mapping

###Better type hints:
Add type hints for methods (especially getSupportedPorts)

Improved readability:

Use null instead of !is_null()
Use !== operator for strict comparison
Use $request->get() with default value

Separate logic:

Extract port detection logic into separate resolvePortName method
Improved security:
Added third parameter true to in_array for strict data type checking

Cleaner code:

Remove duplicate comments
Sort out use statements
Improved performance:
Reduce number of duplicate checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant