Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8678cca

Browse files
authored
More precise dirname() return type (#5708)
1 parent 03763ec commit 8678cca

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

stubs/core.stub

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,3 +461,8 @@ function proc_open($command, array $descriptor_spec, &$pipes, ?string $cwd = nul
461461
* @param-out list<int> $weights
462462
*/
463463
function getmxrr(string $hostname, &$hosts, &$weights = null): bool {}
464+
465+
/**
466+
* @return ($path is non-empty-string ? non-empty-string : string)
467+
*/
468+
function dirname(string $path, int $levels = 1): string {}

tests/PHPStan/Rules/Constants/data/value-assigned-to-define.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
define('A_NON_EMPTY_STRING', '');
1313
define('A_NON_EMPTY_STRING', '0');
1414
define('A_NON_EMPTY_STRING', getString());
15+
define('A_NON_EMPTY_STRING', dirname(__DIR__, 2));
1516

1617
function getString(): string {}

0 commit comments

Comments
 (0)