for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Nexendrie\Translation\Resolvers;
use Tester\Assert;
require __DIR__ . "/../../../bootstrap.php";
/**
* @author Jakub Konečný
* @testCase
*/
final class ManualLocaleResolverTest extends \Tester\TestCase {
protected ManualLocaleResolver $resolver;
protected function setUp(): void {
$this->resolver = new ManualLocaleResolver();
}
public function testResolve(): void {
Assert::null($this->resolver->resolve());
$this->resolver->lang = "cs";
Assert::same("cs", $this->resolver->resolve());
$this->resolver->lang = null;
$this->resolver->resolve()
Nexendrie\Translation\Re...caleResolver::resolve()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
$test = new ManualLocaleResolverTest();
$test->run();
?>
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.