Skip to content

Commit 8f66431

Browse files
committed
Require single-quote use where possible
1 parent d81114a commit 8f66431

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

phpcs.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
<!-- Exclude sniffs that cause a huge diff - enable separately -->
6464
<!-- ********************************************************* -->
6565
<exclude name="SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectAnnotationsGroup" />
66-
<exclude name="Squiz.Strings.DoubleQuoteUsage" />
6766

6867

6968
<!-- ********************* -->

src/GridFS/Bucket.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public function delete($id)
232232
*/
233233
public function downloadToStream($id, $destination)
234234
{
235-
if (! is_resource($destination) || get_resource_type($destination) != "stream") {
235+
if (! is_resource($destination) || get_resource_type($destination) != 'stream') {
236236
throw InvalidArgumentException::invalidType('$destination', $destination, 'resource');
237237
}
238238

@@ -272,7 +272,7 @@ public function downloadToStream($id, $destination)
272272
*/
273273
public function downloadToStreamByName(string $filename, $destination, array $options = [])
274274
{
275-
if (! is_resource($destination) || get_resource_type($destination) != "stream") {
275+
if (! is_resource($destination) || get_resource_type($destination) != 'stream') {
276276
throw InvalidArgumentException::invalidType('$destination', $destination, 'resource');
277277
}
278278

@@ -616,7 +616,7 @@ public function rename($id, string $newFilename)
616616
*/
617617
public function uploadFromStream(string $filename, $source, array $options = [])
618618
{
619-
if (! is_resource($source) || get_resource_type($source) != "stream") {
619+
if (! is_resource($source) || get_resource_type($source) != 'stream') {
620620
throw InvalidArgumentException::invalidType('$source', $source, 'resource');
621621
}
622622

@@ -685,7 +685,7 @@ private function getFilesNamespace(): string
685685
*/
686686
private function getRawFileDocumentForStream($stream): object
687687
{
688-
if (! is_resource($stream) || get_resource_type($stream) != "stream") {
688+
if (! is_resource($stream) || get_resource_type($stream) != 'stream') {
689689
throw InvalidArgumentException::invalidType('$stream', $stream, 'resource');
690690
}
691691

tests/DocumentationExamplesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ private function commitWithRetry3(\MongoDB\Driver\Session $session): void
14031403
private function updateEmployeeInfo3(\MongoDB\Client $client, \MongoDB\Driver\Session $session): void
14041404
{
14051405
$session->startTransaction([
1406-
'readConcern' => new \MongoDB\Driver\ReadConcern("snapshot"),
1406+
'readConcern' => new \MongoDB\Driver\ReadConcern('snapshot'),
14071407
'readPrefernece' => new \MongoDB\Driver\ReadPreference(\MongoDB\Driver\ReadPreference::PRIMARY),
14081408
'writeConcern' => new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY),
14091409
]);

tests/FunctionalTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public static function isCryptSharedLibAvailable(): bool
534534
/** @see https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/mongocryptd/ */
535535
public static function isMongocryptdAvailable(): bool
536536
{
537-
$paths = explode(PATH_SEPARATOR, getenv("PATH"));
537+
$paths = explode(PATH_SEPARATOR, getenv('PATH'));
538538

539539
foreach ($paths as $path) {
540540
if (is_executable($path . DIRECTORY_SEPARATOR . 'mongocryptd')) {

tests/GridFS/BucketFunctionalTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function testDeleteStillRemovesChunksIfFileDoesNotExist($input, $expected
140140

141141
public function testDownloadingFileWithMissingChunk(): void
142142
{
143-
$id = $this->bucket->uploadFromStream("filename", $this->createStream("foobar"));
143+
$id = $this->bucket->uploadFromStream('filename', $this->createStream('foobar'));
144144

145145
$this->chunksCollection->deleteOne(['files_id' => $id, 'n' => 0]);
146146

@@ -151,7 +151,7 @@ public function testDownloadingFileWithMissingChunk(): void
151151

152152
public function testDownloadingFileWithUnexpectedChunkIndex(): void
153153
{
154-
$id = $this->bucket->uploadFromStream("filename", $this->createStream("foobar"));
154+
$id = $this->bucket->uploadFromStream('filename', $this->createStream('foobar'));
155155

156156
$this->chunksCollection->updateOne(
157157
['files_id' => $id, 'n' => 0],
@@ -165,7 +165,7 @@ public function testDownloadingFileWithUnexpectedChunkIndex(): void
165165

166166
public function testDownloadingFileWithUnexpectedChunkSize(): void
167167
{
168-
$id = $this->bucket->uploadFromStream("filename", $this->createStream("foobar"));
168+
$id = $this->bucket->uploadFromStream('filename', $this->createStream('foobar'));
169169

170170
$this->chunksCollection->updateOne(
171171
['files_id' => $id, 'n' => 0],

tools/detect-extension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function grepIniFile(string $filename, string $extension): int
8585
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
8686
$zts = PHP_ZTS ? 'Thread Safe (TS)' : 'Non Thread Safe (NTS)';
8787
$arch = PHP_INT_SIZE === 8 ? 'x64' : 'x86';
88-
$dll = sprintf("%d.%d %s %s", PHP_MAJOR_VERSION, PHP_MINOR_VERSION, $zts, $arch);
88+
$dll = sprintf('%d.%d %s %s', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, $zts, $arch);
8989

9090
printf("You likely need to download a Windows DLL for: %s\n", $dll);
9191
printf("Windows DLLs should be available from: https://pecl.php.net/package/%s\n", $extension);

0 commit comments

Comments
 (0)