Skip to content

Commit 67ac857

Browse files
authored
PHPStan: cleanup setup (#4222)
1 parent dd028d6 commit 67ac857

4 files changed

Lines changed: 20 additions & 6 deletions

File tree

phpstan.neon

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ parameters:
99
- recipe
1010
- contrib
1111

12+
bootstrapFiles:
13+
- tests/constants.php
14+
15+
dynamicConstantNames:
16+
DEPLOYER_VERSION: string
17+
DEPLOYER_BIN: string
18+
MASTER_ENDPOINT: string
19+
MASTER_TOKEN: string
20+
1221
ignoreErrors:
13-
- "#^Constant DEPLOYER_VERSION not found\\.$#"
14-
- "#^Constant DEPLOYER_BIN not found\\.$#"
1522
- "#^Constant MASTER_ENDPOINT not found\\.$#"
1623
- "#^Constant MASTER_TOKEN not found\\.$#"
1724
- "#CpanelPhp#"

src/Configuration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use function Deployer\Support\is_closure;
1818
use function Deployer\Support\normalize_line_endings;
1919

20+
/**
21+
* @implements \ArrayAccess<string, mixed>
22+
*/
2023
class Configuration implements \ArrayAccess
2124
{
2225
private ?Configuration $parent;

tests/bootstrap.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
set_include_path(__DIR__ . '/..' . PATH_SEPARATOR . get_include_path());
2222

2323
putenv('DEPLOYER_LOCAL_WORKER=true');
24-
define('DEPLOYER_BIN', __DIR__ . '/../bin/dep');
25-
define('__FIXTURES__', __DIR__ . '/fixtures');
26-
define('__REPOSITORY__', __DIR__ . '/fixtures/repository');
27-
define('__TEMP_DIR__', sys_get_temp_dir() . '/deployer');
24+
require_once __DIR__ . '/constants.php';
2825

2926
require_once __DIR__ . '/spec/SpecTest.php';
3027

tests/constants.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
define('DEPLOYER_BIN', __DIR__ . '/../bin/dep');
4+
define('DEPLOYER_VERSION', 'dev-master');
5+
define('__FIXTURES__', __DIR__ . '/fixtures');
6+
define('__REPOSITORY__', __DIR__ . '/fixtures/repository');
7+
define('__TEMP_DIR__', sys_get_temp_dir() . '/deployer');

0 commit comments

Comments
 (0)