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

miaoxing / plugin / 12066810754

28 Nov 2024 09:54AM UTC coverage: 42.469% (-0.1%) from 42.591%
12066810754

push

github

twinh
feat(plugin): 从 .env 文件读取 APP_URL 并用于 dev server 配置

0 of 5 new or added lines in 1 file covered. (0.0%)

8 existing lines in 2 files now uncovered.

1235 of 2908 relevant lines covered (42.47%)

37.68 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
    {
UNCOV
28
        if (is_file('.env')) {
×
29
            $dotenv = new Dotenv();
×
UNCOV
30
            $dotenv->loadEnv('.env');
×
31
        }
32

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

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

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

UNCOV
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

© 2026 Coveralls, Inc