Completed
Push — master ( ec5411...629401 )
by Kamil
31:49 queued 16:57
created

TopBarElement   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A hasAvatarInMainBar() 0 10 2
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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
declare(strict_types=1);
13
14
namespace Sylius\Behat\Element\Admin;
15
16
use FriendsOfBehat\PageObjectExtension\Element\Element;
17
18
final class TopBarElement extends Element implements TopBarElementInterface
19
{
20
    public function hasAvatarInMainBar(string $avatarPath): bool
21
    {
22
        $image = $this->getDocument()->find('css', 'img.ui.avatar.image');
23
24
        if (null === $image) {
25
            return false;
26
        }
27
28
        return strpos($image->getAttribute('src'), $avatarPath) !== false;
29
    }
30
}
31