Skip to content

Commit ed30b4e

Browse files
authored
Merge pull request #62 from VSEphpbb/fixes
Some EPV fixes
2 parents f926914 + 8ef1fde commit ed30b4e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Tests/Tests/epv_test_validate_event_names.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111

1212
use Phpbb\Epv\Events\php_exporter;
1313
use Phpbb\Epv\Output\Output;
14+
use Phpbb\Epv\Output\OutputInterface;
1415
use Phpbb\Epv\Tests\BaseTest;
1516

1617
class epv_test_validate_event_names extends BaseTest
1718
{
18-
public function __construct($debug, \Phpbb\Epv\Output\OutputInterface $output, $basedir, $namespace, $titania, $opendir)
19+
public function __construct($debug, OutputInterface $output, $basedir, $namespace, $titania, $opendir)
1920
{
2021
parent::__construct($debug, $output, $basedir, $namespace, $titania, $opendir);
2122

@@ -50,11 +51,11 @@ public function validateDirectory(array $dirList)
5051
foreach ($events as $event)
5152
{
5253
$event['file'] = str_replace($this->basedir, '', $event['file']);
53-
if (strtolower(substr($event['event'], 0, 6)) == 'phpbb.')
54+
if (0 === stripos($event['event'], 'phpbb.'))
5455
{
5556
$this->output->addMessage(Output::ERROR, sprintf('The phpbb vendorname should only be used for official extensions in event names in %s. Current event name: %s', $event['file'], $event['event']));
5657
}
57-
else if (strtolower(substr($event['event'], 0, 5)) == 'core.')
58+
else if (0 === stripos($event['event'], 'core.'))
5859
{
5960
$this->output->addMessage(Output::FATAL, sprintf('The core vendorname should not be used in event names in %s. Current event name: %s', $event['file'], $event['event']));
6061
}
@@ -69,6 +70,6 @@ public function validateDirectory(array $dirList)
6970

7071
public function testName()
7172
{
72-
return "Test event names";
73+
return 'Test event names';
7374
}
7475
}

0 commit comments

Comments
 (0)