PHPLIB-330: Apply manual fixes

parent 339492ff
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
namespace MongoDB\Exception; 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. * Thrown when a mutable method is invoked on an immutable object.
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
namespace MongoDB\Exception; 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 @@ ...@@ -17,7 +17,9 @@
namespace MongoDB\Exception; 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. * Thrown when an argument or option has an invalid type.
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
namespace MongoDB\Exception; 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 @@ ...@@ -17,6 +17,8 @@
namespace MongoDB\Exception; 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 ...@@ -242,6 +242,7 @@ class StreamWrapper
private function getStatTemplate() private function getStatTemplate()
{ {
return [ return [
// phpcs:disable Squiz.Arrays.ArrayDeclaration.IndexNoNewline
0 => 0, 'dev' => 0, 0 => 0, 'dev' => 0,
1 => 0, 'ino' => 0, 1 => 0, 'ino' => 0,
2 => 0, 'mode' => 0, 2 => 0, 'mode' => 0,
...@@ -255,6 +256,7 @@ class StreamWrapper ...@@ -255,6 +256,7 @@ class StreamWrapper
10 => 0, 'ctime' => 0, 10 => 0, 'ctime' => 0,
11 => -1, 'blksize' => -1, 11 => -1, 'blksize' => -1,
12 => -1, 'blocks' => -1, 12 => -1, 'blocks' => -1,
// phpcs:enable
]; ];
} }
......
...@@ -27,5 +27,5 @@ use MongoDB\Driver\Server; ...@@ -27,5 +27,5 @@ use MongoDB\Driver\Server;
*/ */
interface Explainable extends Executable interface Explainable extends Executable
{ {
function getCommandDocument(Server $server); public function getCommandDocument(Server $server);
} }
...@@ -156,7 +156,7 @@ class MapReduce implements Executable ...@@ -156,7 +156,7 @@ class MapReduce implements Executable
} }
if (isset($options['finalize']) && ! $options['finalize'] instanceof JavascriptInterface) { 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'])) { if (isset($options['jsMode']) && ! is_bool($options['jsMode'])) {
......
This diff is collapsed.
...@@ -85,7 +85,7 @@ final class Context ...@@ -85,7 +85,7 @@ final class Context
// TODO: Remove this once retryWrites=true by default (see: PHPC-1324) // TODO: Remove this once retryWrites=true by default (see: PHPC-1324)
$clientOptions['retryWrites'] = true; $clientOptions['retryWrites'] = true;
if (isset($test->outcome->collection->name)) { if (isset($test->outcome->collection->name)) {
$o->outcomeCollectionName = $test->outcome->collection->name; $o->outcomeCollectionName = $test->outcome->collection->name;
} }
...@@ -175,7 +175,7 @@ final class Context ...@@ -175,7 +175,7 @@ final class Context
$options['readPreference'] = new ReadPreference($readPreference['mode']); $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']; $writeConcern = (array) $options['writeConcern'];
$diff = array_diff_key($writeConcern, ['w' => 1, 'wtimeout' => 1, 'j' => 1]); $diff = array_diff_key($writeConcern, ['w' => 1, 'wtimeout' => 1, 'j' => 1]);
......
...@@ -139,7 +139,7 @@ final class ErrorExpectation ...@@ -139,7 +139,7 @@ final class ErrorExpectation
$this->assertCodeName($test, $actual); $this->assertCodeName($test, $actual);
} }
if (!empty($this->excludedLabels) or !empty($this->includedLabels)) { if (! empty($this->excludedLabels) || ! empty($this->includedLabels)) {
$test->assertInstanceOf(RuntimeException::class, $actual); $test->assertInstanceOf(RuntimeException::class, $actual);
foreach ($this->excludedLabels as $label) { foreach ($this->excludedLabels as $label) {
......
...@@ -179,8 +179,7 @@ final class Operation ...@@ -179,8 +179,7 @@ final class Operation
/** /**
* Executes the operation with a given context. * Executes the operation with a given context.
* *
* @param FunctionalTestCase $test Test instance * @param Context $context Execution context
* @param Context $context Execution context
* @return mixed * @return mixed
* @throws LogicException if the operation is unsupported * @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