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

pmvc-plugin / controller / 4220e5ab-8da0-46ab-ac63-9d340cd1c04f

09 Sep 2023 06:57AM UTC coverage: 63.089% (+0.1%) from 62.987%
4220e5ab-8da0-46ab-ac63-9d340cd1c04f

push

circleci

web-flow
Merge pull request #39 from pmvc-plugin/analysis-22M3Gl

Apply fixes from StyleCI

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

388 of 615 relevant lines covered (63.09%)

3.78 hits per line

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

44.83
/src/_app_not_found.php
1
<?php
2
/**
3
 * PMVC.
4
 *
5
 * PHP version 5
6
 *
7
 * @category CategoryName
8
 *
9
 * @package PMVC
10
 *
11
 * @author  Hill <hill@kimo.com>
12
 * @license http://opensource.org/licenses/MIT MIT
13
 *
14
 * @version GIT: <git_id>
15
 *
16
 * @link https://packagist.org/packages/pmvc/pmvc
17
 */
18

19
namespace PMVC;
20

21
use DomainException;
22

23
/*
24
 * App Not Found Notice.
25
 *
26
 * @category CategoryName
27
 *
28
 * @package PMVC
29
 *
30
 * @author  Hill <hill@kimo.com>
31
 * @license http://opensource.org/licenses/MIT MIT
32
 *
33
 * @link https://packagist.org/packages/pmvc/pmvc
34
 */
35
// @codingStandardsIgnoreStart
36
${_INIT_CONFIG}[_CLASS] = __NAMESPACE__.'\app_not_found';
1✔
37
class app_not_found // @codingStandardsIgnoreEnd
38
{
39
    public $caller;
40

41
    /**
42
     * App not found invoke.
43
     *
44
     * @param array  $parents   Parents folders.
45
     * @param string $indexFile Index file name
46
     * @param array  $folders   For pass alias information.
47
     *
48
     * @return void
49
     */
50
    public function __invoke($parents, $indexFile, $folders)
51
    {
52
        if (\PMVC\isDev('help')) {
2✔
53
            return;
×
54
        }
55
        $alias = $folders['alias'];
2✔
56
        option('set', 'httpResponseCode', 404);
2✔
57
        $caller = $this->caller;
2✔
58
        $caller[_REAL_APP] = $caller[_DEFAULT_APP];
2✔
59
        $path = $caller->getAppFile($parents, $indexFile);
2✔
60
        if (!$path) {
2✔
61
            throw new DomainException(
2✔
62
                'Default app setting is not correct. ['.
2✔
63
                    $caller[_DEFAULT_APP].
2✔
64
                    ']'
2✔
65
            );
2✔
66
        } else {
67
            trigger_error(
×
68
                json_encode([
×
69
                    'Error' => 'No app found with routers, '.
×
70
                        'Please check following debug message.',
×
71
                    'Debug' => [
×
72
                        'Parent' => $parents,
×
73
                        'App'    => $caller[_REAL_APP],
×
74
                        'Index'  => $indexFile,
×
75
                        'Alias'  => $alias ?: '',
×
76
                    ],
×
77
                ]),
×
78
                E_USER_WARNING
×
79
            );
×
80
        }
81
        $caller->setApp($caller[_REAL_APP]);
×
82

83
        return $path;
×
84
    }
85
}
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

© 2026 Coveralls, Inc