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

miaoxing / plugin / 6057194056

02 Sep 2023 07:53AM UTC coverage: 39.283% (+0.2%) from 39.08%
6057194056

push

github

semantic-release-bot
chore(release): publish

See CHANGELOG.md for more details.

920 of 2342 relevant lines covered (39.28%)

18.04 hits per line

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

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

3
namespace Miaoxing\Plugin\Command;
4

5
use ReflectionClass;
6
use Symfony\Component\Console\Input\InputArgument;
7
use Wei\Migration;
8

9
/**
10
 * @mixin \PluginMixin
11
 */
12
class GMigration extends BaseCommand
13
{
14
    use PluginIdTrait;
15

16
    protected function configure()
17
    {
18
        $this->setAliases(['migration:g'])
×
19
            ->setDescription('Generate a plugin migration class')
×
20
            ->addArgument('name', InputArgument::REQUIRED, 'The name of the migration')
×
21
            ->addArgument('plugin-id', InputArgument::OPTIONAL, 'The id of plugin');
×
22
    }
23

24
    /**
25
     * @return int|void
26
     * @throws \ReflectionException
27
     * @throws \Exception
28
     */
29
    protected function handle()
30
    {
31
        $plugin = $this->plugin->getOneById($this->getPluginId());
×
32
        $path = $plugin->getBasePath() . '/src/Migration';
×
33
        $reflection = new ReflectionClass($plugin);
×
34
        $namespace = $reflection->getNamespaceName() . '\\Migration';
×
35

36
        Migration::setOutput($this->output)->create([
×
37
            'name' => $this->getArgument('name'),
×
38
            'path' => $path,
×
39
            'namespace' => $namespace,
×
40
        ]);
×
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