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

miaoxing / plugin / 6336161407

24 Sep 2023 08:27AM UTC coverage: 39.208% (+0.04%) from 39.166%
6336161407

push

github

twinh
feat(plugin): `plugin:use` 命令允许留空参数来输出当前使用的插件

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

1 existing line in 1 file now uncovered.

921 of 2349 relevant lines covered (39.21%)

18.0 hits per line

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

0.0
/src/Command/PluginUse.php
1
<?php
2

3
namespace Miaoxing\Plugin\Command;
4

5
use Symfony\Component\Console\Input\InputArgument;
6

7
/**
8
 * @mixin \CacheMixin
9
 * @mixin \PluginMixin
10
 */
11
class PluginUse extends BaseCommand
12
{
13
    /**
14
     * Execute the console command.
15
     *
16
     * @return void
17
     */
18
    protected function handle()
19
    {
20
        $id = $this->input->getArgument('plugin-id');
×
NEW
21
        if (!$id) {
×
NEW
22
            $use = $this->cache->get('plugin:use');
×
NEW
23
            if (!$use) {
×
NEW
24
                $this->suc('Default Plugin not set');
×
NEW
25
                return;
×
26
            }
NEW
27
            $this->suc(sprintf('The default plugin is: %s', $use));
×
NEW
28
            return;
×
29
        }
30

31
        $this->plugin->getOneById($id);
×
32

33
        $this->cache->set('plugin:use', $id);
×
34

UNCOV
35
        $this->suc(sprintf('Set default plugin to "%s"', $id));
×
36
    }
37

38
    protected function configure()
39
    {
NEW
40
        $this->addArgument('plugin-id', InputArgument::OPTIONAL, 'The id of plugin');
×
41
    }
42
}
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