PHPLIB-330: Apply manual fixes

parent 339492ff
......@@ -17,7 +17,9 @@
namespace MongoDB\Exception;
class BadMethodCallException extends \BadMethodCallException implements Exception
use BadMethodCallException as BaseBadMethodCallException;
class BadMethodCallException extends BaseBadMethodCallException implements Exception
{
/**
* Thrown when a mutable method is invoked on an immutable object.
......
......@@ -17,6 +17,8 @@
namespace MongoDB\Exception;
interface Exception extends \MongoDB\Driver\Exception\Exception
use MongoDB\Driver\Exception\Exception as DriverException;
interface Exception extends DriverException
{
}
......@@ -17,7 +17,9 @@
namespace MongoDB\Exception;
class InvalidArgumentException extends \MongoDB\Driver\Exception\InvalidArgumentException implements Exception
use MongoDB\Driver\Exception\InvalidArgumentException as DriverInvalidArgumentException;
class InvalidArgumentException extends DriverInvalidArgumentException implements Exception
{
/**
* Thrown when an argument or option has an invalid type.
......
......@@ -17,6 +17,8 @@
namespace MongoDB\Exception;
class RuntimeException extends \MongoDB\Driver\Exception\RuntimeException implements Exception
use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
class RuntimeException extends DriverRuntimeException implements Exception
{
}
......@@ -17,6 +17,8 @@
namespace MongoDB\Exception;
class UnexpectedValueException extends \MongoDB\Driver\Exception\UnexpectedValueException implements Exception
use MongoDB\Driver\Exception\UnexpectedValueException as DriverUnexpectedValueException;
class UnexpectedValueException extends DriverUnexpectedValueException implements Exception
{
}
......@@ -242,6 +242,7 @@ class StreamWrapper
private function getStatTemplate()
{
return [
// phpcs:disable Squiz.Arrays.ArrayDeclaration.IndexNoNewline
0 => 0, 'dev' => 0,
1 => 0, 'ino' => 0,
2 => 0, 'mode' => 0,
......@@ -255,6 +256,7 @@ class StreamWrapper
10 => 0, 'ctime' => 0,
11 => -1, 'blksize' => -1,
12 => -1, 'blocks' => -1,
// phpcs:enable
];
}
......
......@@ -27,5 +27,5 @@ use MongoDB\Driver\Server;
*/
interface Explainable extends Executable
{
function getCommandDocument(Server $server);
public function getCommandDocument(Server $server);
}
......@@ -156,7 +156,7 @@ class MapReduce implements Executable
}
if (isset($options['finalize']) && ! $options['finalize'] instanceof JavascriptInterface) {
throw InvalidArgumentException::invalidType('"finalize" option', $options['finalize'], Javascript::class);
throw InvalidArgumentException::invalidType('"finalize" option', $options['finalize'], JavascriptInterface::class);
}
if (isset($options['jsMode']) && ! is_bool($options['jsMode'])) {
......
This diff is collapsed.
......@@ -175,7 +175,7 @@ final class Context
$options['readPreference'] = new ReadPreference($readPreference['mode']);
}
if (isset($options['writeConcern']) && !($options['writeConcern'] instanceof writeConcern)) {
if (isset($options['writeConcern']) && ! ($options['writeConcern'] instanceof WriteConcern)) {
$writeConcern = (array) $options['writeConcern'];
$diff = array_diff_key($writeConcern, ['w' => 1, 'wtimeout' => 1, 'j' => 1]);
......
......@@ -139,7 +139,7 @@ final class ErrorExpectation
$this->assertCodeName($test, $actual);
}
if (!empty($this->excludedLabels) or !empty($this->includedLabels)) {
if (! empty($this->excludedLabels) || ! empty($this->includedLabels)) {
$test->assertInstanceOf(RuntimeException::class, $actual);
foreach ($this->excludedLabels as $label) {
......
......@@ -179,7 +179,6 @@ final class Operation
/**
* Executes the operation with a given context.
*
* @param FunctionalTestCase $test Test instance
* @param Context $context Execution context
* @return mixed
* @throws LogicException if the operation is unsupported
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment