1 | <?php |
||
10 | trait AbstractCommonLogTest |
||
11 | { |
||
12 | private static $directoryV; |
||
13 | |||
14 | /** |
||
15 | * [$logger description]. |
||
16 | * |
||
17 | * @var Psr\Log\LoggerInterface |
||
18 | */ |
||
19 | private $logger; |
||
20 | |||
21 | public static function setUpBeforeClass() |
||
22 | { |
||
23 | self::$directoryV = vfsStream::setup(); |
||
24 | } |
||
25 | |||
26 | public function setUp() |
||
27 | { |
||
28 | $this->logger = new Logger('phpunit-logger'); |
||
|
|||
29 | $directoryLogOutput = self::$directoryV->url().'/log'; |
||
30 | if (!file_exists($directoryLogOutput)) { |
||
31 | mkdir($directoryLogOutput, 0700, true); |
||
32 | } |
||
33 | $output = "%level_name% > %message% %context% %extra%\n"; |
||
34 | $formatter = new LineFormatter($output); |
||
35 | $handler = new StreamHandler($directoryLogOutput.'/phpunit.log', Logger::DEBUG, true, null, false); |
||
36 | touch($directoryLogOutput.'/phpunit.log'); |
||
37 | $handler->setFormatter($formatter); |
||
38 | $this->logger->pushHandler($handler); |
||
39 | $this->logger->info('Avviato test -> '.$this->getName()); |
||
40 | } |
||
41 | |||
42 | protected function readLog() |
||
48 | |||
49 | public function tearDown() |
||
50 | { |
||
64 | } |
||
65 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..