Skip to content

Commit

Permalink
Refactor variable naming in thread safety test
Browse files Browse the repository at this point in the history
Renamed the variable $result to $res in test loop for clarity and consistency with the rest of the code. This change ensures uniformity in variable names and improves readability without altering the test's logic or output. The redundant PHP closing tag was also removed to align with PSR-2 coding standards.
  • Loading branch information
koriym committed Dec 7, 2024
1 parent e9e3c72 commit 42ae90b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/008-rayaop-thread-safety.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class TestClass {
method_intercept_init();

for ($i = 0; $i < 3; $i++) {
$result = method_intercept(
$res = method_intercept(
TestClass::class,
'method',
new SafetyTestInterceptor($i)
);
echo "<Interceptor {$i} registered: " . ($result ? 'true' : 'false') . ">" . PHP_EOL;
echo "<Interceptor {$i} registered: " . ($res ? 'true' : 'false') . ">" . PHP_EOL;
}

$test = new TestClass();
Expand All @@ -45,6 +45,7 @@ $paramsArray = [null, 'test', 'error', 'another test'];
foreach ($paramsArray as $i => $param) {
$paramString = isset($param) ? $param : '';
echo "<Execution #{$i} with param: {$paramString}>" . PHP_EOL;

try {
$result = $test->method($param);
echo "<Result: " . ($result ? 'true' : 'false') . ">" . PHP_EOL;
Expand All @@ -54,7 +55,6 @@ foreach ($paramsArray as $i => $param) {
}

echo "<END TEST>" . PHP_EOL;
?>
--EXPECT--
<TEST>
<Interceptor 0 registered: true>
Expand Down

0 comments on commit 42ae90b

Please sign in to comment.