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

move-elevator / composer-translation-validator / 16285705700

15 Jul 2025 06:21AM UTC coverage: 95.945% (-0.2%) from 96.161%
16285705700

push

github

web-flow
Merge pull request #35 from move-elevator/phpstan-7

build: update phpstan level to 7

33 of 41 new or added lines in 10 files covered. (80.49%)

1680 of 1751 relevant lines covered (95.95%)

7.57 hits per line

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

88.89
/src/Utility/PathUtility.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace MoveElevator\ComposerTranslationValidator\Utility;
6

7
class PathUtility
8
{
9
    public static function normalizeFolderPath(string $path): string
37✔
10
    {
11
        $realPath = realpath($path);
37✔
12
        if (false === $realPath) {
37✔
13
            $normalizedPath = rtrim($path, DIRECTORY_SEPARATOR);
26✔
14
            if (str_starts_with($normalizedPath, './')) {
26✔
15
                $normalizedPath = substr($normalizedPath, 2);
4✔
16
            }
17

18
            return $normalizedPath;
26✔
19
        }
20

21
        $normalizedPath = rtrim($realPath, DIRECTORY_SEPARATOR);
11✔
22

23
        $cwd = getcwd();
11✔
24
        if (false === $cwd) {
11✔
NEW
25
            return $normalizedPath;
×
26
        }
27
        $realCwd = realpath($cwd);
11✔
28
        if (false === $realCwd) {
11✔
NEW
29
            return $normalizedPath;
×
30
        }
31
        $cwd = $realCwd.DIRECTORY_SEPARATOR;
11✔
32

33
        if (str_starts_with($normalizedPath.DIRECTORY_SEPARATOR, $cwd)) {
11✔
34
            return substr($normalizedPath, strlen($cwd));
9✔
35
        }
36

37
        return $normalizedPath;
2✔
38
    }
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc