Passed
Push — main ( 8d4d49...a3997f )
by Michiel
23:55
created

MonologListenerTest::setUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
/**
4
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
 *
16
 * This software consists of voluntary contributions made by many individuals
17
 * and is licensed under the LGPL. For more information please see
18
 * <http://phing.info>.
19
 */
20
21
namespace Phing\Test\Listener;
22
23
use Phing\Listener\BuildEvent;
24
use Phing\Listener\MonologListener;
25
use Phing\Project;
26
use PHPUnit\Framework\TestCase;
27
28
/**
29
 * @internal
30
 */
31
class MonologListenerTest extends TestCase
32
{
33
    public function setUp(): void
34
    {
35
        if (! class_exists('\Monolog\Logger')) {
36
            $this->markTestSkipped('The Monolog tasks depend on the monolog/monolog package being installed.');
37
        }
38
    }
39
40
    /**
41
     * @test
42
     */
43
    public function buildStarted(): void
44
    {
45
        $listener = new MonologListener();
46
        $this->assertNull($listener->buildStarted(new BuildEvent(new Project())));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $listener->buildStarted(...t(new Phing\Project())) targeting Phing\Listener\MonologListener::buildStarted() seems to always return null.

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.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
47
    }
48
}
49