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

php-bug-catcher / bug-catcher / 11101040430

30 Sep 2024 06:59AM UTC coverage: 86.701% (+0.06%) from 86.646%
11101040430

push

github

tito10047
Fix #15 clear multiple same errors

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

841 of 970 relevant lines covered (86.7%)

13.51 hits per line

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

66.67
/src/Controller/AbstractController.php
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Jozef Môstka
5
 * Date: 31. 8. 2023
6
 * Time: 20:33
7
 */
8
namespace BugCatcher\Controller;
9

10
use LogicException;
11
use BugCatcher\Entity\Client\Client;
12
use BugCatcher\Entity\User;
13
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController as SymfonyAbstractController;
14
use Symfony\Component\HttpFoundation\RequestStack;
15

16
class AbstractController extends SymfonyAbstractController {
17

18
        protected function getUser(): ?User {
19
                $user = parent::getUser();
4✔
20
                if ($user === null) {
4✔
21
                        return null;
×
22
                }
23
                if (!$user instanceof User) {
4✔
24
                        return throw new LogicException('The user is somehow not the expected UserInterface instance.');
×
25
                }
26

27
                return $user;
4✔
28
        }
29

30

31
}
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