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

move-elevator / composer-translation-validator / 15944771023

28 Jun 2025 01:45PM UTC coverage: 89.647%. First build
15944771023

Pull #10

github

jackd248
build: rename coverage artifact to code-coverage-report for clarity
Pull Request #10: test: add unit tests

27 of 40 new or added lines in 5 files covered. (67.5%)

381 of 425 relevant lines covered (89.65%)

2.4 hits per line

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

92.31
/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
7✔
10
    {
11
        $realPath = realpath($path);
7✔
12
        if (false === $realPath) {
7✔
13
            // If realpath fails, it might be a non-existent path, return as is but normalized
14
            $normalizedPath = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
4✔
15
            if (str_starts_with($normalizedPath, './')) {
4✔
16
                $normalizedPath = substr($normalizedPath, 2);
1✔
17
            }
18

19
            return $normalizedPath;
4✔
20
        }
21

22
        $cwd = realpath(getcwd()).DIRECTORY_SEPARATOR;
3✔
23
        $normalizedPath = rtrim($realPath, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
3✔
24

25
        if (str_starts_with($normalizedPath, $cwd)) {
3✔
26
            $relativePath = substr($normalizedPath, strlen($cwd));
3✔
27

28
            return $relativePath;
3✔
29
        }
30

NEW
31
        return $normalizedPath;
×
32
    }
33
}
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

© 2026 Coveralls, Inc