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

miaoxing / file / 10654301120

01 Sep 2024 01:03PM UTC coverage: 84.932% (-1.2%) from 86.111%
10654301120

push

github

semantic-release-bot
chore(release): publish

See CHANGELOG.md for more details.

62 of 73 relevant lines covered (84.93%)

4.14 hits per line

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

66.67
/pages/api/admin/files/index.php
1
<?php
2

3
use Miaoxing\File\Service\File;
4
use Miaoxing\Plugin\BasePage;
5
use Miaoxing\Plugin\Service\Upload;
6
use Wei\Req;
7

8
return new class extends BasePage {
1✔
9
    public function post(Req $req)
10
    {
11
        $ret = Upload::save([
1✔
12
            'exts' => 'image' === $req['type'] ? Upload::getAllowedImageExts() : Upload::getAllowedExts(),
1✔
13
            'path' => File::generatePath(),
1✔
14
        ]);
1✔
15
        if ($ret->isErr()) {
1✔
16
            return $ret;
1✔
17
        }
18

19
        return File::saveLocal($ret['file'], [
×
20
            'origName' => $ret['name'],
×
21
            'size' => $ret['size'],
×
22
        ]);
×
23
    }
24
};
1✔
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