Component::preAssertions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 0
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace Zenstruck\Browser;
4
5
use Zenstruck\Browser;
6
7
/**
8
 * @author Kevin Bond <[email protected]>
9
 */
10
abstract class Component
11
{
12
    private Browser $browser;
13
14
    final public function __construct(Browser $browser)
15
    {
16
        $this->browser = $browser;
17
18
        $this->preActions();
19
        $this->preAssertions();
20
    }
21
22
    final public function browser(): Browser
23
    {
24
        return $this->browser;
25
    }
26
27
    /**
28
     * Runs when component is created. Override to add your own
29
     * component pre-actions (ie navigate to page).
30
     */
31
    protected function preActions(): void
32
    {
33
    }
34
35
    /**
36
     * Runs when component is created. Override to add your own
37
     * component pre-assertions (runs after preActions()).
38
     */
39
    protected function preAssertions(): void
40
    {
41
    }
42
}
43