Passed
Push — master ( 56b2d4...f6236f )
by Denys
06:16 queued 17s
created

getSessionRedisLockingExcludedBotUserAgents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 26
c 1
b 0
f 0
dl 0
loc 28
rs 9.504
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
declare(strict_types = 1);
9
10
namespace Pyz\Yves\SessionRedis;
11
12
use Spryker\Yves\SessionRedis\SessionRedisConfig as SprykerSessionRedisConfig;
13
14
class SessionRedisConfig extends SprykerSessionRedisConfig
15
{
16
    /**
17
     * Specification:
18
     * - Returns URL patterns that are excluded from Redis locking.
19
     * - These patterns are used to identify requests that don't require session locking.
20
     *
21
     * @api
22
     *
23
     * @return list<string>
24
     */
25
    public function getSessionRedisLockingExcludedUrlPatterns(): array
26
    {
27
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array('/^.*\/erro...'/^.*\/health-check$/') returns the type array<integer,string> which is incompatible with the documented return type Pyz\Yves\SessionRedis\list.
Loading history...
28
            '/^.*\/error-page\/*.*$/',
29
            '/^.*\/health-check$/',
30
        ];
31
    }
32
33
    /**
34
     * Specification:
35
     * - Returns user agent strings used to identify bot traffic.
36
     * - Bot traffic is excluded from Redis session locking for better performance.
37
     *
38
     * @api
39
     *
40
     * @return list<string>
41
     */
42
    public function getSessionRedisLockingExcludedBotUserAgents(): array
43
    {
44
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array('Googlebot'...ider', 'robot', 'bot/') returns the type array<integer,string> which is incompatible with the documented return type Pyz\Yves\SessionRedis\list.
Loading history...
45
            'Googlebot',
46
            'bingbot',
47
            'Baiduspider',
48
            'YandexBot',
49
            'DuckDuckBot',
50
            'Sogou',
51
            'ia_archiver',
52
            'facebookexternalhit',
53
            'Twitterbot',
54
            'LinkedInBot',
55
            'Slackbot',
56
            'WhatsApp',
57
            'Discordbot',
58
            'AhrefsBot',
59
            'Applebot',
60
            'msnbot',
61
            'MJ12bot',
62
            'SEMrushBot',
63
            'PetalBot',
64
            'SeznamBot',
65
            'AdsBot-Google',
66
            'crawler',
67
            'spider',
68
            'robot',
69
            'bot/',
70
        ];
71
    }
72
}
73