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

miaoxing / admin / 5657139961

pending completion
5657139961

push

github

twinh
refactor(admin): `BaseController` > `BasePage`

22 of 85 branches covered (25.88%)

4 of 4 new or added lines in 4 files covered. (100.0%)

6 existing lines in 1 file now uncovered.

164 of 596 relevant lines covered (27.52%)

2.01 hits per line

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

0.0
/pages/api/admin/consts/[id].php
1
<?php
2

3
use Miaoxing\Plugin\BasePage;
4
use Miaoxing\Plugin\ConstTrait;
5

6
return new class () extends BasePage {
7
    /**
8
     * @experimental
9
     * @param mixed $req
10
     */
11
    public function get($req)
12
    {
UNCOV
13
        [$name, $prefix] = explode('-', $req['id']);
×
14

UNCOV
15
        if (!$this->wei->has($name)) {
×
16
            return err('服务不存在');
×
17
        }
18

UNCOV
19
        $service = $this->wei->get($name);
×
20
        if (!in_array(ConstTrait::class, class_uses($service), true)) {
×
21
            return err('服务没有配置常量');
×
22
        }
23

24
        /** @var ConstTrait $service */
UNCOV
25
        $data = $service->getConsts($prefix);
×
26
        if (!$data) {
×
27
            return err('常量前缀不存在');
×
28
        }
29

UNCOV
30
        return suc([
×
31
            'data' => [
×
32
                'items' => $data,
×
33
            ],
×
34
        ]);
×
35
    }
UNCOV
36
};
×
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