Skip to content

Commit

Permalink
Test files must have a namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 17, 2022
1 parent 4daa27c commit 535a03e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Expand Up @@ -21,11 +21,11 @@ public function testMethods(): void
$this->analyse([__DIR__ . '/data/illegal-constructor-call-rule-test.php'], [
[
'Call to __construct() on an existing object is not allowed.',
16,
18,
],
[
'Call to __construct() on an existing object is not allowed.',
58,
60,
],
]);
}
Expand Down
Expand Up @@ -21,15 +21,15 @@ public function testMethods(): void
$this->analyse([__DIR__ . '/data/illegal-constructor-call-rule-test.php'], [
[
'Static call to __construct() is only allowed on a parent class in the constructor.',
29,
31,
],
[
'Static call to __construct() is only allowed on a parent class in the constructor.',
47,
49,
],
[
'Static call to __construct() is only allowed on a parent class in the constructor.',
48,
50,
],
]);
}
Expand Down
@@ -1,5 +1,7 @@
<?php

namespace IllegalConstructorMethodCall;

class ExtendedDateTimeWithMethodCall extends DateTimeImmutable
{
public function __construct(string $datetime = "now", ?DateTimeZone $timezone = null)
Expand Down

0 comments on commit 535a03e

Please sign in to comment.