Skip to content

Commit 5833b0f

Browse files
committed
Use __DIR__ instead of dirname(__FILE__)
1 parent d9ff13b commit 5833b0f

File tree

7 files changed

+7
-14
lines changed

7 files changed

+7
-14
lines changed

examples/aggregate.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
use MongoDB\Client;
77

88
use function assert;
9-
use function dirname;
109
use function getenv;
1110
use function is_object;
1211
use function MongoDB\BSON\fromPHP;
1312
use function MongoDB\BSON\toRelaxedExtendedJSON;
1413
use function printf;
1514
use function rand;
1615

17-
require dirname(__FILE__) . '/../vendor/autoload.php';
16+
require __DIR__ . '/../vendor/autoload.php';
1817

1918
function toJSON(object $document): string
2019
{

examples/bulk.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
use MongoDB\Client;
77

88
use function assert;
9-
use function dirname;
109
use function getenv;
1110
use function is_object;
1211
use function MongoDB\BSON\fromPHP;
1312
use function MongoDB\BSON\toRelaxedExtendedJSON;
1413
use function printf;
1514

16-
require dirname(__FILE__) . '/../vendor/autoload.php';
15+
require __DIR__ . '/../vendor/autoload.php';
1716

1817
function toJSON(object $document): string
1918
{

examples/changestream.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use MongoDB\Client;
77

88
use function assert;
9-
use function dirname;
109
use function fprintf;
1110
use function getenv;
1211
use function is_object;
@@ -17,7 +16,7 @@
1716

1817
use const STDERR;
1918

20-
require dirname(__FILE__) . '/../vendor/autoload.php';
19+
require __DIR__ . '/../vendor/autoload.php';
2120

2221
function toJSON(object $document): string
2322
{

examples/command_logger.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use MongoDB\Driver\Monitoring\CommandSucceededEvent;
1111

1212
use function assert;
13-
use function dirname;
1413
use function fprintf;
1514
use function get_class;
1615
use function getenv;
@@ -21,7 +20,7 @@
2120

2221
use const STDERR;
2322

24-
require dirname(__FILE__) . '/../vendor/autoload.php';
23+
require __DIR__ . '/../vendor/autoload.php';
2524

2625
function toJSON(object $document): string
2726
{

examples/persistable.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
use UnexpectedValueException;
1111

1212
use function array_search;
13-
use function dirname;
1413
use function getenv;
1514
use function var_dump;
1615

17-
require dirname(__FILE__) . '/../vendor/autoload.php';
16+
require __DIR__ . '/../vendor/autoload.php';
1817

1918
class PersistableEntry implements Persistable
2019
{

examples/typemap.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
use MongoDB\Client;
99
use UnexpectedValueException;
1010

11-
use function dirname;
1211
use function getenv;
1312
use function is_array;
1413
use function var_dump;
1514

16-
require dirname(__FILE__) . '/../vendor/autoload.php';
15+
require __DIR__ . '/../vendor/autoload.php';
1716

1817
class TypemapEntry implements Unserializable
1918
{

examples/with_transaction.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
use MongoDB\Driver\Session;
88

99
use function assert;
10-
use function dirname;
1110
use function getenv;
1211
use function is_object;
1312
use function MongoDB\BSON\fromPHP;
1413
use function MongoDB\BSON\toRelaxedExtendedJSON;
1514
use function MongoDB\with_transaction;
1615
use function printf;
1716

18-
require dirname(__FILE__) . '/../vendor/autoload.php';
17+
require __DIR__ . '/../vendor/autoload.php';
1918

2019
function toJSON(object $document): string
2120
{

0 commit comments

Comments
 (0)