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

miaoxing / plugin / 11491320862

24 Oct 2024 01:54AM UTC coverage: 42.957%. Remained the same
11491320862

push

github

twinh
docs(plugin): 缩短 `plugin:use` 说明,控制不超过 120 字符

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

1235 of 2875 relevant lines covered (42.96%)

38.11 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');
×
21
        if (!$id) {
×
22
            $use = $this->cache->get('plugin:use');
×
23
            if (!$use) {
×
24
                $this->suc('Default Plugin not set');
×
25
                return;
×
26
            }
27
            $this->suc(sprintf('The default plugin is: %s', $use));
×
28
            return;
×
29
        }
30

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

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

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

38
    protected function configure()
39
    {
NEW
40
        $this->setDescription('Set the default plugin, which will be used when run the commands without plugin id')
×
41
            ->addArgument('plugin-id', InputArgument::OPTIONAL, 'The id of plugin');
×
42
    }
43
}
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