Customer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 19
dl 0
loc 43
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCustomerData() 0 6 1
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 PyzTest\Yves\Customer\PageObject;
11
12
use Generated\Shared\Transfer\CustomerTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\CustomerTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
14
class Customer
15
{
16
    /**
17
     * @var string
18
     */
19
    public const NEW_CUSTOMER_EMAIL = '[email protected]';
20
21
    /**
22
     * @var string
23
     */
24
    public const REGISTERED_CUSTOMER_EMAIL = '[email protected]';
25
26
    /**
27
     * @var array
28
     */
29
    protected static $customer = [
30
        self::NEW_CUSTOMER_EMAIL => [
31
            'salutation' => 'Mr',
32
            'firstName' => 'New',
33
            'lastName' => 'Customer',
34
            'email' => self::NEW_CUSTOMER_EMAIL,
35
            'password' => 'sP3yK3r%23!23',
36
        ],
37
        self::REGISTERED_CUSTOMER_EMAIL => [
38
            'salutation' => 'Mrs',
39
            'firstName' => 'Registered',
40
            'lastName' => 'Customer',
41
            'email' => self::REGISTERED_CUSTOMER_EMAIL,
42
            'password' => 'sP3yK3r%23!23',
43
        ],
44
    ];
45
46
    /**
47
     * @param string $email
48
     *
49
     * @return \Generated\Shared\Transfer\CustomerTransfer
50
     */
51
    public static function getCustomerData(string $email): CustomerTransfer
52
    {
53
        $customerTransfer = new CustomerTransfer();
54
        $customerTransfer->fromArray(self::$customer[$email]);
55
56
        return $customerTransfer;
57
    }
58
}
59