Skip to content

ServerWorker uses boolval() instead of (bool) cast — inconsistent style #159

@s2x

Description

@s2x

Problem

ServerWorker uses boolval() function call instead of the (bool) cast operator. The rest of the codebase consistently uses type casts ((int), (string), (bool)), making this an inconsistency.

While functionally identical, (bool) is:

  • More consistent with the codebase style
  • Slightly more performant (no function call overhead)
  • The conventional PHP style for type casting

Location

  • src/Worker/ServerWorker.php, line 53

Current Code

$this->reusePort = boolval($serverConfig['reuse_port'] ?? false);

Proposed Fix

$this->reusePort = (bool) ($serverConfig['reuse_port'] ?? false);

Priority

🟢 MINOR — style inconsistency; trivial fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityCode quality improvementsminorMinor priority - code quality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions