Completed
Push — test-EZP-26707-issearchable-fu... ( 774d65...d743e2 )
by
unknown
24:59
created

DeprecationNoticeSupressor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A suppressDepreciationNotices() 0 4 1
A restoreErrorReporting() 0 4 1
1
<?php
2
/**
3
 * @license For full copyright and license information view LICENSE file distributed with this source code.
4
 */
5
namespace EzSystems\PlatformBehatBundle\Context\SubContext;
6
7
trait DeprecationNoticeSupressor
8
{
9
    /**
10
     * Stores the original php error reporting value.
11
     */
12
    private $originalErrorReporting;
13
14
    /**
15
     * @BeforeScenario
16
     */
17
    public function suppressDepreciationNotices()
18
    {
19
        $this->originalErrorReporting = error_reporting(E_ALL & ~E_USER_DEPRECATED);
20
    }
21
22
    /**
23
     * @AfterScenario
24
     */
25
    public function restoreErrorReporting()
26
    {
27
        error_reporting($this->originalErrorReporting);
28
    }
29
}
30