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

miaoxing / plugin / 12097882420

30 Nov 2024 04:26PM UTC coverage: 42.44% (-0.5%) from 42.957%
12097882420

push

github

semantic-release-bot
chore(release): publish

See CHANGELOG.md for more details.

1235 of 2910 relevant lines covered (42.44%)

37.65 hits per line

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

0.0
/src/Service/ConsoleApp.php
1
<?php
2

3
namespace Miaoxing\Plugin\Service;
4

5
use Miaoxing\Plugin\BaseService;
6
use Symfony\Component\Console\Application;
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Dotenv\Dotenv;
9
use Wei\Wei;
10

11
/**
12
 * @mixin \ClassMapPropMixin
13
 * @mixin \ConfigPropMixin
14
 * @experimental
15
 */
16
class ConsoleApp extends BaseService
17
{
18
    /**
19
     * @var string[]
20
     */
21
    protected array $commandDirs = [
22
        'src',
23
        'plugins/*/src',
24
    ];
25

26
    public function __invoke(): int
27
    {
28
        if (is_file('.env')) {
×
29
            $dotenv = new Dotenv();
×
30
            $dotenv->loadEnv('.env');
×
31
        }
32

33
        $this->config->preloadGlobal();
×
34

35
        $app = new Application('Wei', Wei::VERSION);
×
36

37
        $classes = $this->classMap->generate($this->commandDirs, '/Command/*.php', 'Command');
×
38
        foreach ($classes as $class) {
×
39
            if (is_subclass_of($class, Command::class)) {
×
40
                $app->add(new $class());
×
41
            }
42
        }
43

44
        return $app->run();
×
45
    }
46
}
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