Skip to content

Commit

Permalink
use __DIR__ instead of dirname(__FILE__)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Oct 26, 2020
1 parent b576689 commit 893835b
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Tests/DeviceDetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testAddDeviceParserInvalid(): void

public function testDevicesYmlFiles(): void
{
$fixtureFiles = \glob(\realpath(\dirname(__FILE__)) . '/../regexes/device/*.yml');
$fixtureFiles = \glob(\realpath(__DIR__) . '/../regexes/device/*.yml');

foreach ($fixtureFiles as $file) {
$ymlData = \Spyc::YAMLLoad($file);
Expand Down Expand Up @@ -176,7 +176,7 @@ public function testParse(array $fixtureData): void
public function getFixtures(): array
{
$fixtures = [];
$fixtureFiles = \glob(\realpath(\dirname(__FILE__)) . '/fixtures/*.yml');
$fixtureFiles = \glob(\realpath(__DIR__) . '/fixtures/*.yml');

foreach ($fixtureFiles as $fixturesPath) {
$typeFixtures = \Spyc::YAMLLoad($fixturesPath);
Expand Down Expand Up @@ -269,7 +269,7 @@ public function testParseBots(array $fixtureData): void

public function getBotFixtures(): array
{
$fixturesPath = \realpath(\dirname(__FILE__) . '/fixtures/bots.yml');
$fixturesPath = \realpath(__DIR__ . '/fixtures/bots.yml');
$fixtures = \Spyc::YAMLLoad($fixturesPath);

return \array_map(static function ($elem) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Client/BrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testParse(string $useragent, array $client): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/browser.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/browser.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Client/FeedReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testParse(string $useragent, array $client): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/feed_reader.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/feed_reader.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Client/LibraryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testParse(string $useragent, array $client): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/library.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/library.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Client/MediaPlayerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testParse(string $useragent, array $client): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/mediaplayer.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/mediaplayer.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Client/MobileAppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testParse(string $useragent, array $client): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/mobile_app.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/mobile_app.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Client/PIMTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testParse(string $useragent, array $client): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/pim.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/pim.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Device/CarBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testParse(string $useragent, array $device): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/car_browser.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/car_browser.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Device/ConsoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testParse(string $useragent, array $device): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/console.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/console.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Devices/NotebookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testParse(string $useragent, array $device): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/notebook.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/notebook.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/OperatingSystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testParse(string $useragent, array $os): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/oss.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/oss.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/VendorFragmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testParse(string $useragent, string $vendor): void

public function getFixtures(): array
{
$fixtureData = Spyc::YAMLLoad(\realpath(\dirname(__FILE__)) . '/fixtures/vendorfragments.yml');
$fixtureData = Spyc::YAMLLoad(\realpath(__DIR__) . '/fixtures/vendorfragments.yml');

return $fixtureData;
}
Expand Down
2 changes: 1 addition & 1 deletion misc/updateReadme.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
' . implode(', ', $bots);

$file = dirname(__FILE__) . '/../README.md';
$file = __DIR__ . '/../README.md';

$readme = file_get_contents($file);

Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<!-- use MO4 coding standard as base -->
<rule ref="MO4">
<exclude name="SlevomatCodingStandard.Commenting.UselessInheritDocComment"></exclude>
<exclude name="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
</rule>

<rule ref="Symfony.Commenting">
Expand Down

0 comments on commit 893835b

Please sign in to comment.