for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Initx\Querabilis\Driver;
use Initx\Querabilis\Envelope;
use Initx\Querabilis\Exception\NoSuchElementException;
trait HasDefaultRemoveAndElement
{
public function remove(): Envelope
return $this->returnOrThrowNoSuchElement($this->poll());
poll()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return $this->returnOrThrowNoSuchElement($this->/** @scrutinizer ignore-call */ poll());
}
public function element(): Envelope
return $this->returnOrThrowNoSuchElement($this->peek());
peek()
return $this->returnOrThrowNoSuchElement($this->/** @scrutinizer ignore-call */ peek());
private function returnOrThrowNoSuchElement(?Envelope $envelope = null): Envelope
if (!$envelope) {
throw new NoSuchElementException();
return $envelope;