for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the jquery-datatables-bundle package.
*
* (c) 2022 WEBEWEB
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace WBW\Bundle\JQuery\DataTablesBundle\Tests\Renderer;
use WBW\Bundle\JQuery\DataTablesBundle\Tests\AbstractTestCase;
use WBW\Bundle\JQuery\DataTablesBundle\Tests\Fixtures\Renderer\TestRightAlignedRendererTrait;
/**
* Right-aligned renderer trait test.
* @author webeweb <https://github.com/webeweb>
* @package WBW\Bundle\JQuery\DataTablesBundle\Tests\Renderer
class RightAlignedRendererTraitTest extends AbstractTestCase {
* Test renderRightAligned()
* @return void
public function testRenderRightAligned(): void {
$obj = new TestRightAlignedRendererTrait();
$this->assertNull($obj->renderRightAligned(null));
$obj->renderRightAligned(null)
WBW\Bundle\JQuery\DataTa...t::renderRightAligned()
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.
$this->assertNull($obj->renderRightAligned(""));
$obj->renderRightAligned('')
$this->assertEquals('<span class="pull-right">content</span>', $obj->renderRightAligned("content"));
}
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.