Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit 041c397

Browse files
committed
Test that rule cannot read class properties
1 parent da64c63 commit 041c397

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/ClassThatContainsProperties.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Tests;
6+
7+
class ClassThatContainsProperties
8+
{
9+
public string $fileDoesNotExist = 'a_file_that_does_not_exist.php';
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Tests\ClassThatContainsProperties;
6+
7+
$class = new ClassThatContainsProperties();
8+
9+
include $class->fileDoesNotExist;
10+
include_once $class->fileDoesNotExist;
11+
require $class->fileDoesNotExist;
12+
require_once $class->fileDoesNotExist;

0 commit comments

Comments
 (0)