/
ExpectDeprecationTrait.php
52 lines (46 loc) · 1.57 KB
/
ExpectDeprecationTrait.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\PhpUnit\Legacy;
/**
* @internal use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait instead.
*/
trait ExpectDeprecationTrait
{
/**
* @param string $message
*/
public function expectDeprecation(): void
{
if (1 > func_num_args() || !\is_string($message = func_get_arg(0))) {
throw new \InvalidArgumentException(sprintf('The "%s()" method requires the string $message argument.', __FUNCTION__));
}
\Closure::bind(function (string $message): void {
$this->expectDeprecation($message);
}, $o = new class() {
use ExpectDeprecationTraitBeforeV8_4 {
expectDeprecation as public;
}
})($message);
}
/**
* @internal use expectDeprecation() instead.
*/
public function expectDeprecationMessage(string $message): void
{
throw new \BadMethodCallException(sprintf("The "%s()" method is not supported by Symfony's PHPUnit Bridge ExpectDeprecationTrait.", __FUNCTION__));
}
/**
* @internal use expectDeprecation() instead.
*/
public function expectDeprecationMessageMatches(string $regularExpression): void
{
throw new \BadMethodCallException(sprintf("The "%s()" method is not supported by Symfony's PHPUnit Bridge ExpectDeprecationTrait.", __FUNCTION__));
}
}