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

miaoxing / plugin / 13068069565

31 Jan 2025 07:05AM UTC coverage: 41.294% (-0.06%) from 41.349%
13068069565

push

github

twinh
feat(plugin, experimental): 增加 `PresetColumns` 服务,用于生成常用的字段

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

83 existing lines in 1 file now uncovered.

1238 of 2998 relevant lines covered (41.29%)

36.6 hits per line

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

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

3
namespace Miaoxing\Plugin\Service;
4

5
use Miaoxing\Plugin\BaseService;
6
use Wei\Schema;
7

8
/**
9
 * @experimental may be rename, return Column object instead of Schema
10
 */
11
class PresetColumns extends BaseService
12
{
13
    /**
14
     * @var Schema
15
     */
16
    protected $schema;
17

18
    public function __construct(array $options = [])
19
    {
NEW
20
        parent::__construct($options);
×
21
        // @phpstan-ignore-next-line Xxx::$schema (Wei\Schema) does not accept Wei\Base.
NEW
22
        $this->schema = $this->wei->newInstance('schema');
×
23
    }
24

25
    /**
26
     * @svc
27
     */
28
    protected function appId(): Schema
29
    {
NEW
30
        return $this->schema->uBigInt('app_id')->comment('应用编号');
×
31
    }
32

33
    /**
34
     * @svc
35
     */
36
    protected function userId(): Schema
37
    {
NEW
38
        return $this->schema->uBigInt('user_id')->comment('用户编号');
×
39
    }
40

41
    /**
42
     * @svc
43
     */
44
    protected function sort(): Schema
45
    {
NEW
46
        return $this->schema->smallInt('sort')->defaults(50)->comment('顺序,从大到小排列');
×
47
    }
48

49
    /**
50
     * @svc
51
     */
52
    protected function isEnabled(): Schema
53
    {
NEW
54
        return $this->schema->bool('is_enabled')->defaults(1)->comment('是否启用');
×
55
    }
56
}
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