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

miaoxing / plugin / 13066017523

26 Jan 2025 04:40AM UTC coverage: 41.349% (-1.1%) from 42.441%
13066017523

push

github

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

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

147 existing lines in 4 files now uncovered.

1238 of 2994 relevant lines covered (41.35%)

36.64 hits per line

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

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

3
namespace Miaoxing\Plugin\Service;
4

5
use Miaoxing\Plugin\BaseModel;
6
use Miaoxing\Plugin\ConstTrait;
7
use Miaoxing\Plugin\Model\ModelTrait;
8
use Miaoxing\Plugin\Model\ReqQueryTrait;
9
use Wei\Model\SoftDeleteTrait;
10

11
/**
12
 * @property int|null $id
13
 * @property string $name
14
 * @property string $type 值的类型,s:字符串
15
 * @property string $value
16
 * @property bool $preload 是否生成到配置文件中
17
 * @property string $comment
18
 * @property string|null $createdAt
19
 * @property string|null $updatedAt
20
 * @property string $createdBy
21
 * @property string $updatedBy
22
 * @property string|null $deletedAt
23
 * @property string $deletedBy
24
 */
25
class GlobalConfigModel extends BaseModel
26
{
27
    use ConstTrait;
28
    use ModelTrait;
29
    use ReqQueryTrait;
30
    use SoftDeleteTrait;
31

32
    public const TYPE_STRING = 's';
33

34
    public const TYPE_BOOL = 'b';
35

36
    public const TYPE_INT = 'i';
37

38
    public const TYPE_FLOAT = 'f';
39

40
    public const TYPE_NULL = 'n';
41

42
    public const TYPE_ARRAY = 'a';
43

44
    public const TYPE_OBJECT = 'o';
45

46
    public const TYPE_JSON = 'j';
47

48
    public const TYPE_EXPRESS = 'e';
49

50
    protected $virtual = [
51
        'typeName',
52
    ];
53

54
    /**
55
     * @var array
56
     */
57
    protected $typeNames = [
58
        self::TYPE_STRING => '字符串',
59
        self::TYPE_BOOL => '布尔值',
60
        self::TYPE_INT => '整数',
61
        self::TYPE_FLOAT => '小数',
62
        self::TYPE_NULL => 'NULL',
63
        self::TYPE_ARRAY => '数组',
64
        self::TYPE_JSON => 'JSON',
65
        self::TYPE_OBJECT => '对象',
66
        self::TYPE_EXPRESS => '表达式',
67
    ];
68

69
    /**
70
     * 类型名称
71
     *
72
     * @return string|null
73
     */
74
    protected function getTypeNameAttribute(): ?string
75
    {
UNCOV
76
        return $this->typeNames[$this->type] ?? null;
×
77
    }
78
}
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