for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Aerophant\RamdaTest;
use function Aerophant\Ramda\any;
use PHPUnit\Framework\TestCase;
class AnyTest extends TestCase
{
public function testAnyAndExpectTrue()
$lessThan2 = function ($it) {
return $it < 2;
};
$this->assertTrue(any($lessThan2)([1, 2, 3, 4]));
}
public function testAnyAndExpectFalse()
$this->assertFalse(any($lessThan2)([3, 4, 5, 6]));
public function testAnyWithEmptyArray()
$predicate = function ($it) {
$it
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$predicate = function (/** @scrutinizer ignore-unused */ $it) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return true;
$this->assertFalse(any($predicate)([]));
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.