Add rector [batch] #251
Annotations
10 warnings
src/MutexFactory.php#L16
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*/
abstract class MutexFactory implements MutexFactoryInterface
{
- public final function createAndAcquire(string $name, int $timeout = 0) : MutexInterface
+ public final function createAndAcquire(string $name, int $timeout = -1) : MutexInterface
{
$mutex = $this->create($name);
if (!$mutex->acquire($timeout)) {
|
src/MutexFactory.php#L16
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*/
abstract class MutexFactory implements MutexFactoryInterface
{
- public final function createAndAcquire(string $name, int $timeout = 0) : MutexInterface
+ public final function createAndAcquire(string $name, int $timeout = 1) : MutexInterface
{
$mutex = $this->create($name);
if (!$mutex->acquire($timeout)) {
|
src/RetryAcquireTrait.php#L32
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
*/
public function withRetryDelay(int $retryDelay) : self
{
- if ($retryDelay < 1) {
+ if ($retryDelay <= 1) {
throw new InvalidArgumentException("Retry delay value must be a positive number greater than zero, \"{$retryDelay}\" is received.");
}
$new = clone $this;
|
src/RetryAcquireTrait.php#L51
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
if ($callback()) {
return true;
}
- usleep($this->retryDelay * 1000);
+ usleep($this->retryDelay * 1001);
} while (microtime(true) - $start < $timeout);
return false;
}
}
|
src/RetryAcquireTrait.php#L52
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
return true;
}
usleep($this->retryDelay * 1000);
- } while (microtime(true) - $start < $timeout);
+ } while (microtime(true) - $start <= $timeout);
return false;
}
}
|
src/SimpleMutex.php#L47
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*
* @return bool Whether a lock is acquired.
*/
- public function acquire(string $name, int $timeout = 0) : bool
+ public function acquire(string $name, int $timeout = -1) : bool
{
$mutex = $this->mutexFactory->create($name);
if ($mutex->acquire($timeout)) {
|
src/SimpleMutex.php#L47
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*
* @return bool Whether a lock is acquired.
*/
- public function acquire(string $name, int $timeout = 0) : bool
+ public function acquire(string $name, int $timeout = 1) : bool
{
$mutex = $this->mutexFactory->create($name);
if ($mutex->acquire($timeout)) {
|
src/Synchronizer.php#L48
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*
* @return mixed The result of the PHP callable execution.
*/
- public function execute(string $name, callable $callback, int $timeout = 0)
+ public function execute(string $name, callable $callback, int $timeout = -1)
{
$mutex = $this->mutexFactory->createAndAcquire($name, $timeout);
set_error_handler(static function (int $severity, string $message, string $file, int $line) : bool {
|
src/Synchronizer.php#L48
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*
* @return mixed The result of the PHP callable execution.
*/
- public function execute(string $name, callable $callback, int $timeout = 0)
+ public function execute(string $name, callable $callback, int $timeout = 1)
{
$mutex = $this->mutexFactory->createAndAcquire($name, $timeout);
set_error_handler(static function (int $severity, string $message, string $file, int $line) : bool {
|
src/Synchronizer.php#L52
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
public function execute(string $name, callable $callback, int $timeout = 0)
{
$mutex = $this->mutexFactory->createAndAcquire($name, $timeout);
- set_error_handler(static function (int $severity, string $message, string $file, int $line) : bool {
- if (!(error_reporting() & $severity)) {
- // This error code is not included in error_reporting.
- return true;
- }
- throw new ErrorException($message, $severity, $severity, $file, $line);
- });
+
try {
/** @var mixed $result */
return $callback();
|
The logs for this run have expired and are no longer available.
Loading