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

bitExpert / magento2-force-login / 8567322315

05 Apr 2024 08:58AM UTC coverage: 58.745% (-0.1%) from 58.857%
8567322315

Pull #231

github

web-flow
Merge 9b451aab5 into 760bbd333
Pull Request #231: Remove useless wrong error

6 of 7 new or added lines in 1 file covered. (85.71%)

309 of 526 relevant lines covered (58.75%)

3.87 hits per line

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

90.0
/Model/WhitelistDefaultInstaller.php
1
<?php
2

3
/*
4
 * This file is part of the Force Login module for Magento2.
5
 *
6
 * (c) bitExpert AG
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 BitExpert\ForceCustomerLogin\Model;
13

14
use BitExpert\ForceCustomerLogin\Api\Repository\WhitelistRepositoryInterface;
15
use BitExpert\ForceCustomerLogin\Model\WhitelistDefaultPool;
16

17
/**
18
 * Class WhitelistEntryDefaultInstaller
19
 *
20
 * @package BitExpert\ForceCustomerLogin\Model
21
 * @codingStandardsIgnoreFile
22
 */
23
class WhitelistDefaultInstaller
24
{
25
    private WhitelistDefaultPool $whitelistDefaultPool;
26
    private WhitelistRepositoryInterface $whitelistRepository;
27

28
    /**
29
     * Installer constructor
30
     */
31
    public function __construct(
32
        WhitelistDefaultPool $whitelistDefaultPool,
33
        WhitelistRepositoryInterface $whitelistRepository,
34
    ) {
35
        $this->whitelistDefaultPool = $whitelistDefaultPool;
2✔
36
        $this->whitelistRepository = $whitelistRepository;
2✔
37
    }
38

39
    public function install(): void
40
    {
41
        foreach ($this->whitelistDefaultPool->getEntries() as $route => $data) {
2✔
42
            try {
43
                $this->whitelistRepository->createEntry(
2✔
44
                    null,
2✔
45
                    $data['label'],
2✔
46
                    $route,
2✔
47
                    $data['strategy'] ?: 'default',
2✔
48
                );
2✔
NEW
49
            } catch (\Exception $e) {
×
50
                // log here
51
            }
52
        }
53
    }
54
}
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