Skip to content

Commit 18e49a1

Browse files
committed
PHPLIB-330: Apply manual fixes
1 parent f48740b commit 18e49a1

12 files changed

+156
-104
lines changed

src/Exception/BadMethodCallException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
namespace MongoDB\Exception;
1919

20-
class BadMethodCallException extends \BadMethodCallException implements Exception
20+
use BadMethodCallException as BaseBadMethodCallException;
21+
22+
class BadMethodCallException extends BaseBadMethodCallException implements Exception
2123
{
2224
/**
2325
* Thrown when a mutable method is invoked on an immutable object.

src/Exception/Exception.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
namespace MongoDB\Exception;
1919

20-
interface Exception extends \MongoDB\Driver\Exception\Exception
20+
use MongoDB\Driver\Exception\Exception as DriverException;
21+
22+
interface Exception extends DriverException
2123
{
2224
}

src/Exception/InvalidArgumentException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
namespace MongoDB\Exception;
1919

20-
class InvalidArgumentException extends \MongoDB\Driver\Exception\InvalidArgumentException implements Exception
20+
use MongoDB\Driver\Exception\InvalidArgumentException as DriverInvalidArgumentException;
21+
22+
class InvalidArgumentException extends DriverInvalidArgumentException implements Exception
2123
{
2224
/**
2325
* Thrown when an argument or option has an invalid type.

src/Exception/RuntimeException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
namespace MongoDB\Exception;
1919

20-
class RuntimeException extends \MongoDB\Driver\Exception\RuntimeException implements Exception
20+
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
21+
22+
class RuntimeException extends DriverRuntimeException implements Exception
2123
{
2224
}

src/Exception/UnexpectedValueException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
namespace MongoDB\Exception;
1919

20-
class UnexpectedValueException extends \MongoDB\Driver\Exception\UnexpectedValueException implements Exception
20+
use MongoDB\Driver\Exception\UnexpectedValueException as DriverUnexpectedValueException;
21+
22+
class UnexpectedValueException extends DriverUnexpectedValueException implements Exception
2123
{
2224
}

src/GridFS/StreamWrapper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ public function stream_write($data)
242242
private function getStatTemplate()
243243
{
244244
return [
245+
// phpcs:disable Squiz.Arrays.ArrayDeclaration.IndexNoNewline
245246
0 => 0, 'dev' => 0,
246247
1 => 0, 'ino' => 0,
247248
2 => 0, 'mode' => 0,
@@ -255,6 +256,7 @@ private function getStatTemplate()
255256
10 => 0, 'ctime' => 0,
256257
11 => -1, 'blksize' => -1,
257258
12 => -1, 'blocks' => -1,
259+
// phpcs:enable
258260
];
259261
}
260262

src/Operation/Explainable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
*/
2828
interface Explainable extends Executable
2929
{
30-
function getCommandDocument(Server $server);
30+
public function getCommandDocument(Server $server);
3131
}

src/Operation/MapReduce.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function __construct($databaseName, $collectionName, JavascriptInterface
156156
}
157157

158158
if (isset($options['finalize']) && ! $options['finalize'] instanceof JavascriptInterface) {
159-
throw InvalidArgumentException::invalidType('"finalize" option', $options['finalize'], Javascript::class);
159+
throw InvalidArgumentException::invalidType('"finalize" option', $options['finalize'], JavascriptInterface::class);
160160
}
161161

162162
if (isset($options['jsMode']) && ! is_bool($options['jsMode'])) {

0 commit comments

Comments
 (0)