• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JBZoo / Codestyle / 29770057002

20 Jul 2026 06:01AM UTC coverage: 81.195% (+0.2%) from 80.952%
29770057002

push

github

SmetDenis
docs: refresh PHP floor and dependency versions for the 8.0 line

557 of 686 relevant lines covered (81.2%)

10.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/PHPUnit/AbstractPhpStormProxyTest.php
1
<?php
2

3
/**
4
 * JBZoo Toolbox - Codestyle.
5
 *
6
 * This file is part of the JBZoo Toolbox project.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT
11
 * @copyright  Copyright (C) JBZoo.com, All rights reserved.
12
 * @see        https://github.com/JBZoo/Codestyle
13
 */
14

15
declare(strict_types=1);
16

17
namespace JBZoo\Codestyle\PHPUnit;
18

19
use JBZoo\PHPUnit\PHPUnit;
20
use JBZoo\Utils\Cli;
21
use JBZoo\Utils\Env;
22
use PHPUnit\Framework\Attributes\Depends;
23

24
use function JBZoo\PHPUnit\isPhpStorm;
25
use function JBZoo\PHPUnit\skip;
26
use function JBZoo\PHPUnit\success;
27

28
/**
29
 * @psalm-suppress UnusedClass
30
 */
31
abstract class AbstractPhpStormProxyTest extends PHPUnit
32
{
33
    public function testPhpCsFixerFix(): void
34
    {
35
        $this->runToolViaMakefile('test-phpcsfixer-fix');
×
36
    }
37

38
    #[Depends('testPhpCsFixerFix')]
39
    public function testPhpCsFixerCheck(): void
40
    {
41
        $this->runToolViaMakefile('test-phpcsfixer-teamcity');
×
42
    }
43

44
    #[Depends('testPhpCsFixerCheck')]
45
    public function testPhpCodeSniffer(): void
46
    {
47
        $this->runToolViaMakefile('test-phpcs-teamcity');
×
48
    }
49

50
    public function testPhpMessDetector(): void
51
    {
52
        $this->runToolViaMakefile('test-phpmd-teamcity');
×
53
    }
54

55
    public function testPhpMagicNumbers(): void
56
    {
57
        $this->runToolViaMakefile('test-phpmnd-teamcity');
×
58
    }
59

60
    #[Depends('testPhpCodeSniffer')]
61
    public function testPhpStan(): void
62
    {
63
        $this->runToolViaMakefile('test-phpstan-teamcity');
×
64
    }
65

66
    #[Depends('testPhpStan')]
67
    public function testPsalm(): void
68
    {
69
        $this->runToolViaMakefile('test-psalm-teamcity');
×
70
    }
71

72
    #[Depends('testPsalm')]
73
    public function testPhan(): void
74
    {
75
        $this->runToolViaMakefile('test-phan-teamcity');
×
76
    }
77

78
    /**
79
     * Test works only in PhpStorm or TeamCity if variable PHPSTORM_PROXY=1
80
     * Please, use `make codestyle` for any other environments.
81
     */
82
    protected function runToolViaMakefile(string $makeTargetName): void
83
    {
84
        $testCaseEnvVariable = $this->getEnvVariableForTestCase($makeTargetName);
×
85

86
        if (
87
            isPhpStorm()
×
88
            && (Env::bool('PHPSTORM_PROXY') || Env::bool($testCaseEnvVariable))
×
89
        ) {
90
            $phpBin = Env::string('PHP_BIN', 'php');
×
91

92
            $cliCommand = \implode(' ', [
×
93
                'TC_REPORT="tc-tests"',
×
94
                'TC_REPORT_MND="tc-tests"',
×
95
                'TEAMCITY_VERSION="2020.1.2"',
×
96
                "PHP_BIN=\"{$phpBin}\"",
×
97
                "make {$makeTargetName}",
×
98
            ]);
×
99

100
            // Redirect error to std output
101
            try {
102
                Cli::out(\trim(Cli::exec($cliCommand, [], PROJECT_ROOT)));
×
103
            } catch (\Exception $exception) {
×
104
                Cli::out(\trim($exception->getMessage()));
×
105
            }
106
        } else {
107
            skip("Define env.PHPSTORM_PROXY=1 or env.{$testCaseEnvVariable}=1");
×
108
        }
109

110
        success();
×
111
    }
112

113
    /**
114
     * @suppress PhanPluginPossiblyStaticPrivateMethod
115
     */
116
    private function getEnvVariableForTestCase(string $makeTargetName): string
117
    {
118
        $makeTargetName = \str_replace(['test-', '-teamcity', '-'], ['', '', '_'], $makeTargetName);
×
119
        $makeTargetName = \strtoupper($makeTargetName);
×
120

121
        return "PHPSTORM_PROXY_{$makeTargetName}";
×
122
    }
123
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc