Passed
Pull Request — master (#242)
by Théo
02:40
created

RequiresPharReadonlyOff   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A markAsSkippedIfPharReadonlyIsOn() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the box project.
7
 *
8
 * (c) Kevin Herrera <[email protected]>
9
 *     Théo Fidry <[email protected]>
10
 *
11
 * This source file is subject to the MIT license that is bundled
12
 * with this source code in the file LICENSE.
13
 */
14
15
namespace KevinGH\Box\Test;
16
17
/**
18
 * @private
19
 */
20
trait RequiresPharReadonlyOff
21
{
22
    private function markAsSkippedIfPharReadonlyIsOn(): void
23
    {
24
        if (true === (bool) ini_get('phar.readonly')) {
25
            $this->markTestSkipped(
1 ignored issue
show
Bug introduced by
It seems like markTestSkipped() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
            $this->/** @scrutinizer ignore-call */ 
26
                   markTestSkipped(
Loading history...
26
                'Requires phar.readonly to be set to 0. Either update your php.ini file or run this test with '
27
                .'php -d phar.readonly=0.'
28
            );
29
        }
30
    }
31
}
32