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

daycry / auth / 16343465380

17 Jul 2025 11:07AM UTC coverage: 59.224% (-0.6%) from 59.854%
16343465380

push

github

web-flow
Merge pull request #23 from daycry/development

Improvements

57 of 292 new or added lines in 16 files covered. (19.52%)

6 existing lines in 4 files now uncovered.

1939 of 3274 relevant lines covered (59.22%)

22.81 hits per line

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

0.0
/src/Controllers/ActionController.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of Daycry Auth.
7
 *
8
 * (c) Daycry <daycry9@proton.me>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Daycry\Auth\Controllers;
15

16
use CodeIgniter\Exceptions\PageNotFoundException;
17
use CodeIgniter\HTTP\Response;
18
use Daycry\Auth\Interfaces\ActionInterface;
19

20
/**
21
 * Class ActionController
22
 *
23
 * A generic controller to handle Authentication Actions.
24
 */
25
class ActionController extends BaseAuthController
26
{
27
    protected ?ActionInterface $action = null;
28

29
    /**
30
     * Perform an initial check if we have a valid action or not.
31
     *
32
     * @param list<string> $params
33
     *
34
     * @return Response|string
35
     */
36
    public function _remap(string $method, ...$params)
37
    {
NEW
38
        $authenticator = $this->getSessionAuthenticator();
×
39

40
        // Grab our action instance if one has been set.
41
        $this->action = $authenticator->getAction();
×
42

43
        if (empty($this->action) || ! $this->action instanceof ActionInterface) {
×
44
            throw new PageNotFoundException();
×
45
        }
46

47
        return $this->{$method}(...$params);
×
48
    }
49

50
    /**
51
     * Shows the initial screen to the user to start the flow.
52
     * This might be asking for the user's email to reset a password,
53
     * or asking for a cell-number for a 2FA.
54
     *
55
     * @return Response|string
56
     */
57
    public function show()
58
    {
59
        return $this->action->show();
×
60
    }
61

62
    /**
63
     * Processes the form that was displayed in the previous form.
64
     *
65
     * @return Response|string
66
     */
67
    public function handle()
68
    {
69
        return $this->action->handle($this->request);
×
70
    }
71

72
    /**
73
     * This handles the response after the user takes action
74
     * in response to the show/handle flow. This might be
75
     * from clicking the 'confirm my email' action or
76
     * following entering a code sent in an SMS.
77
     *
78
     * @return Response|string
79
     */
80
    public function verify()
81
    {
82
        return $this->action->verify($this->request);
×
83
    }
84

85
    /**
86
     * ActionController doesn't use validation rules directly
87
     * as it delegates to action objects
88
     */
89
    protected function getValidationRules(): array
90
    {
NEW
91
        return [];
×
92
    }
93
}
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