Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Galli committed Jan 3, 2018
1 parent 3df5a73 commit f1aa5d4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Capsule/Client.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);
<?php declare(strict_types = 1);

namespace Facile\MongoDbBundle\Capsule;

Expand Down
4 changes: 2 additions & 2 deletions src/Capsule/Collection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);
<?php declare(strict_types = 1);

namespace Facile\MongoDbBundle\Capsule;

Expand Down Expand Up @@ -226,7 +226,7 @@ private function prepareQuery(string $method, $filters = null, $data = null, arr
*/
private function translateReadPreference(ReadPreference $readPreference): string
{
switch($readPreference->getMode()){
switch ($readPreference->getMode()) {
case ReadPreference::RP_PRIMARY:
return 'primary';
case ReadPreference::RP_PRIMARY_PREFERRED:
Expand Down
2 changes: 1 addition & 1 deletion src/Capsule/Database.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);
<?php declare(strict_types = 1);

namespace Facile\MongoDbBundle\Capsule;

Expand Down
8 changes: 4 additions & 4 deletions src/Controller/ProfilerController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);
<?php declare(strict_types = 1);

namespace Facile\MongoDbBundle\Controller;

Expand Down Expand Up @@ -47,9 +47,9 @@ public function explainAction($token, $queryNumber)

$service = $this->container->get('mongo.explain_query_service');

try{
try {
$result = $service->execute($query);
} catch (\InvalidArgumentException $e) {
}catch (\InvalidArgumentException $e) {
return new JsonResponse([
"err" => $e->getMessage()
]);
Expand All @@ -72,7 +72,7 @@ private function walkAndConvertToUTCDatetime($data)
foreach ($data as $key => $item) {

if (is_string($item) && preg_match('/^ISODate/', $item)) {
$time = str_replace(['ISODate("','")'], '', $item);
$time = str_replace(['ISODate("', '")'], '', $item);
$dateTime = new \DateTime($time);
$item = new UTCDatetime($dateTime->getTimestamp() * 1000);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Models/Query.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);
<?php declare(strict_types = 1);

namespace Facile\MongoDbBundle\Models;

Expand Down Expand Up @@ -99,7 +99,7 @@ public function getFilters(): array
*/
public function setFilters($filters)
{
$this->filters = (array)$filters ?? [];
$this->filters = (array) $filters ?? [];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Services/Explain/ExplainCommandBuilder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);
<?php declare(strict_types = 1);

namespace Facile\MongoDbBundle\Services\Explain;

Expand Down Expand Up @@ -114,7 +114,7 @@ private static function manageDelete(Query $query, array $args): array
return [
'delete' => $query->getCollection(),
'deletes' => [
['q' => $query->getFilters(), 'limit' => $query->getOptions()['limit'] ?? 0,]
['q' => $query->getFilters(), 'limit' => $query->getOptions()['limit'] ?? 0]
]
];
}
Expand Down
6 changes: 3 additions & 3 deletions src/Services/Explain/ExplainQueryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ExplainQueryService
const VERBOSITY_EXECUTION_STATS = 'executionStats';
const VERBOSITY_ALL_PLAN_EXECUTION = 'allPlansExecution';

public static $acceptedMethods= [
public static $acceptedMethods = [
'count',
'distinct',
'find',
Expand Down Expand Up @@ -55,11 +55,11 @@ public function execute(Query $query, string $verbosity = self::VERBOSITY_ALL_PL
{
if (!in_array($query->getMethod(), self::$acceptedMethods)) {
throw new \InvalidArgumentException(
'Cannot explain the method \''.$query->getMethod().'\'. Allowed methods: '. implode(', ',self::$acceptedMethods)
'Cannot explain the method \''.$query->getMethod().'\'. Allowed methods: '.implode(', ', self::$acceptedMethods)
);
};

$manager = $this->clientRegistry->getClient($query->getClient(),$query->getDatabase())->__debugInfo()['manager'];
$manager = $this->clientRegistry->getClient($query->getClient(), $query->getDatabase())->__debugInfo()['manager'];

return $manager
->executeCommand(
Expand Down
4 changes: 2 additions & 2 deletions src/Twig/FacileMongoDbBundleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class FacileMongoDbBundleExtension extends \Twig_Extension
{
private $methodDataTranslationMap = [
private $methodDataTranslationMap = [
'aggregate' => 'Pipeline',
'insertOne' => 'Document',
'updateOne' => 'Update',
Expand All @@ -15,7 +15,7 @@ class FacileMongoDbBundleExtension extends \Twig_Extension
];

/**
* @return array
* @return \Twig_SimpleFunction[]
*/
public function getFunctions()
{
Expand Down

0 comments on commit f1aa5d4

Please sign in to comment.