1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-05 12:13:23 +02:00

[ticket/17540] Fix some small warnings

PHPBB-17540
This commit is contained in:
Marc Alexander
2025-09-14 15:29:12 +02:00
parent 5b4afdfedc
commit cd40a0594e
2 changed files with 19 additions and 9 deletions

View File

@@ -97,11 +97,21 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case
{ {
parent::tearDown(); parent::tearDown();
unlink($this->phpbb_root_path . 'files/test_png_1'); $delete_files = [
unlink($this->phpbb_root_path . 'files/test_png_2'); $this->phpbb_root_path . 'files/test_png_1',
unlink($this->phpbb_root_path . 'files/test_txt'); $this->phpbb_root_path . 'files/test_png_2',
unlink($this->phpbb_root_path . 'files/thumb_test_png_1'); $this->phpbb_root_path . 'files/test_txt',
unlink($this->phpbb_root_path . 'files/thumb_test_png_2'); $this->phpbb_root_path . 'files/thumb_test_png_1',
$this->phpbb_root_path . 'files/thumb_test_png_2'
];
foreach ($delete_files as $file)
{
if (file_exists($file))
{
unlink($file);
}
}
} }
public function test_thumbnails() public function test_thumbnails()

View File

@@ -52,12 +52,12 @@ class lint_test extends phpbb_test_case
$this->assertEquals(0, $status, "PHP lint failed for $path:\n$output"); $this->assertEquals(0, $status, "PHP lint failed for $path:\n$output");
} }
public function lint_data() public static function lint_data(): array
{ {
return $this->check(__DIR__ . '/..'); return self::check(__DIR__ . '/..');
} }
protected function check($root) protected static function check($root): array
{ {
$files = array(); $files = array();
$dh = opendir($root); $dh = opendir($root);
@@ -92,7 +92,7 @@ class lint_test extends phpbb_test_case
__DIR__ . '/../node_modules', __DIR__ . '/../node_modules',
))) )))
{ {
$files = array_merge($files, $this->check($path)); $files = array_merge($files, self::check($path));
} }
else if (substr($filename, strlen($filename)-4) == '.php') else if (substr($filename, strlen($filename)-4) == '.php')
{ {