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

webeweb / core-bundle / 7087587915

04 Dec 2023 01:53PM UTC coverage: 98.807% (-0.06%) from 98.87%
7087587915

push

github

webeweb
Update dependencies

1574 of 1593 relevant lines covered (98.81%)

71.72 hits per line

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

66.67
/Helper/UserHelper.php
1
<?php
2

3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2023 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
namespace WBW\Bundle\CoreBundle\Helper;
13

14
use Symfony\Component\HttpKernel\Kernel;
15
use Symfony\Component\Security\Core\User\UserInterface;
16

17
/**
18
 * User helper.
19
 *
20
 * @author webeweb <https://github.com/webeweb>
21
 * @package WBW\Bundle\CoreBundle\Tests\Helper
22
 */
23
class UserHelper {
24

25
    /**
26
     * Get the identifier.
27
     *
28
     * @param UserInterface $user The user.
29
     * @return string|null Returns the identifier.
30
     */
31
    public static function getIdentifier(UserInterface $user): ?string {
32

33
        // TODO: Remove when dropping support for Symfony 5
34
        if (Kernel::MAJOR_VERSION < 6) {
60✔
35
            return $user->getUsername();
60✔
36
        }
37

38
        return $user->getUserIdentifier();
×
39
    }
40
}
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