mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 07:55:31 +00:00
Replace disallowed operators in tests/
This commit is contained in:
parent
4d55935bd8
commit
6846f1e78a
@ -47,7 +47,7 @@ class DisallowEnumComparisonRule implements Rule{
|
||||
}
|
||||
|
||||
public function processNode(Node $node, Scope $scope) : array{
|
||||
if(!($node instanceof Identical) and !($node instanceof NotIdentical)){
|
||||
if(!($node instanceof Identical) && !($node instanceof NotIdentical)){
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ class DisallowEnumComparisonRule implements Rule{
|
||||
continue;
|
||||
}
|
||||
$class = $containedType->getClassReflection();
|
||||
if($class !== null and $class->hasTraitUse(EnumTrait::class)){
|
||||
if($class !== null && $class->hasTraitUse(EnumTrait::class)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ class ItemTest extends TestCase{
|
||||
}
|
||||
foreach($this->item->getEnchantments() as $enchantment){
|
||||
foreach($enchantments as $k => $applied){
|
||||
if($enchantment->getType() === $applied->getType() and $enchantment->getLevel() === $applied->getLevel()){
|
||||
if($enchantment->getType() === $applied->getType() && $enchantment->getLevel() === $applied->getLevel()){
|
||||
unset($enchantments[$k]);
|
||||
continue 2;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class AsyncPoolTest extends TestCase{
|
||||
public function testTaskLeak() : void{
|
||||
$start = microtime(true);
|
||||
$this->pool->submitTask(new LeakTestAsyncTask());
|
||||
while(!LeakTestAsyncTask::$destroyed and microtime(true) < $start + 30){
|
||||
while(!LeakTestAsyncTask::$destroyed && microtime(true) < $start + 30){
|
||||
usleep(50 * 1000);
|
||||
$this->pool->collectTasks();
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ abstract class Test{
|
||||
}
|
||||
|
||||
public function isTimedOut() : bool{
|
||||
return !$this->isFinished() and time() - $this->timeout > $this->startTime;
|
||||
return !$this->isFinished() && time() - $this->timeout > $this->startTime;
|
||||
}
|
||||
|
||||
protected function setTimeout(int $timeout) : void{
|
||||
|
Loading…
x
Reference in New Issue
Block a user