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

daycry / class-finder / 16724626674

04 Aug 2025 01:32PM UTC coverage: 82.262% (-12.2%) from 94.493%
16724626674

push

github

web-flow
Update php.yml

320 of 389 relevant lines covered (82.26%)

3.29 hits per line

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

64.71
/src/Libraries/Files/FilesFinder.php
1
<?php
2

3
namespace Daycry\ClassFinder\Libraries\Files;
4

5
use Daycry\ClassFinder\Exceptions\ClassFinderException;
6
use Daycry\ClassFinder\Interfaces\FinderInterface;
7

8
class FilesFinder implements FinderInterface
9
{
10
    private FilesFactory $factory;
11

12
    /**
13
     * @throws ClassFinderException
14
     */
15
    public function __construct()
16
    {
17
        $this->factory = new FilesFactory();
3✔
18

19
        if (! function_exists('exec')) {
3✔
20
            throw new ClassFinderException(sprintf(
×
21
                'FilesFinder requires that exec() is available. Check your php.ini to see if it is disabled. See "%s" for details.',
×
22
                'https://gitlab.com/hpierce1102/ClassFinder/blob/master/docs/exceptions/filesExecNotAvailable.md',
×
23
            ));
×
24
        }
25
    }
26

27
    public function getPriority(): int
28
    {
29
        return 3; // Low priority for Files
×
30
    }
31

32
    public function isNamespaceKnown(string $namespace): bool
33
    {
34
        $filesEntries = $this->factory->getFilesEntries();
3✔
35

36
        foreach ($filesEntries as $filesEntry) {
3✔
37
            if ($filesEntry->knowsNamespace($namespace)) {
3✔
38
                return true;
3✔
39
            }
40
        }
41

42
        return false;
×
43
    }
44

45
    /**
46
     * @return list<string>
47
     */
48
    public function findClasses(string $namespace, int $options): array
49
    {
50
        $filesEntries = $this->factory->getFilesEntries();
3✔
51

52
        $classes = [];
3✔
53

54
        foreach ($filesEntries as $entry) {
3✔
55
            $classes = array_merge($classes, $entry->getClasses($namespace, $options));
3✔
56
        }
57

58
        return $classes;
3✔
59
    }
60
}
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