diff --git a/stubs/core.stub b/stubs/core.stub index 9a4d8a711c..beee073b9d 100644 --- a/stubs/core.stub +++ b/stubs/core.stub @@ -461,3 +461,8 @@ function proc_open($command, array $descriptor_spec, &$pipes, ?string $cwd = nul * @param-out list $weights */ function getmxrr(string $hostname, &$hosts, &$weights = null): bool {} + +/** + * @return ($path is non-empty-string ? non-empty-string : string) + */ +function dirname(string $path, int $levels = 1): string {} diff --git a/tests/PHPStan/Rules/Constants/data/value-assigned-to-define.php b/tests/PHPStan/Rules/Constants/data/value-assigned-to-define.php index 1bd09e86c6..2503a62748 100644 --- a/tests/PHPStan/Rules/Constants/data/value-assigned-to-define.php +++ b/tests/PHPStan/Rules/Constants/data/value-assigned-to-define.php @@ -12,5 +12,6 @@ define('A_NON_EMPTY_STRING', ''); define('A_NON_EMPTY_STRING', '0'); define('A_NON_EMPTY_STRING', getString()); +define('A_NON_EMPTY_STRING', dirname(__DIR__, 2)); function getString(): string {}