• 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

0.0
/src/Config/ClassFinder.php
1
<?php
2

3
namespace Daycry\ClassFinder\Config;
4

5
use CodeIgniter\Config\BaseConfig;
6
use Daycry\ClassFinder\Libraries\ClassMap\ClassMapFinder;
7
use Daycry\ClassFinder\Libraries\Files\FilesFinder;
8
use Daycry\ClassFinder\Libraries\PSR4\PSR4Finder;
9

10
class ClassFinder extends BaseConfig
11
{
12
    public array $finder = [
13
        'PSR4'     => true,
14
        'classMap' => true,
15
        'files'    => true,
16
    ];
17
    public array $finderClass = [
18
        'PSR4'     => PSR4Finder::class,
19
        'classMap' => ClassMapFinder::class,
20
        'files'    => FilesFinder::class,
21
    ];
22

23
    /**
24
     * Enable/disable specific finders
25
     */
26
    public function enableFinder(string $finder): void
27
    {
28
        if (isset($this->finder[$finder])) {
×
29
            $this->finder[$finder] = true;
×
30
        }
31
    }
32

33
    public function disableFinder(string $finder): void
34
    {
35
        if (isset($this->finder[$finder])) {
×
36
            $this->finder[$finder] = false;
×
37
        }
38
    }
39

40
    /**
41
     * Get enabled finders
42
     */
43
    public function getEnabledFinders(): array
44
    {
45
        return array_filter($this->finder, static fn ($enabled) => $enabled === true);
×
46
    }
47

48
    /**
49
     * Validate configuration
50
     */
51
    public function isValid(): bool
52
    {
53
        foreach ($this->finderClass as $finder => $class) {
×
54
            if (! class_exists($class)) {
×
55
                return false;
×
56
            }
57
        }
58

59
        return true;
×
60
    }
61
}
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