Skip to content

Commit 96cefae

Browse files
committedSep 4, 2016
Normalize coding style to the whole project
1 parent 4e6c19e commit 96cefae

File tree

83 files changed

+501
-452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+501
-452
lines changed
 

‎.php_cs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
$finder = Symfony\CS\Finder::create()
4+
->exclude('Resources')
5+
->in(__DIR__)
6+
;
7+
8+
return Symfony\CS\Config::create()
9+
->finder($finder)
10+
;

‎Command/MongoDBMigrateMetadataCommand.php

+16-9
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ protected function initialize(InputInterface $input, OutputInterface $output)
110110
'fsync' => $input->getOption('fsync'),
111111
);
112112

113-
$this->printStatusCallback = function() {};
113+
$this->printStatusCallback = function () {
114+
};
114115
register_tick_function(array($this, 'printStatus'));
115116
}
116117

@@ -128,7 +129,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
128129
}
129130

130131
/**
131-
* Migrate message documents
132+
* Migrate message documents.
132133
*/
133134
private function migrateMessages(OutputInterface $output)
134135
{
@@ -145,10 +146,11 @@ private function migrateMessages(OutputInterface $output)
145146

146147
if (!$numTotal = $cursor->count()) {
147148
$output->writeln('There are no message documents to migrate.');
149+
148150
return;
149151
}
150152

151-
$this->printStatusCallback = function() use ($output, &$numProcessed, $numTotal) {
153+
$this->printStatusCallback = function () use ($output, &$numProcessed, $numTotal) {
152154
$output->write(sprintf("Processed: <info>%d</info> / Complete: <info>%d%%</info>\r", $numProcessed, round(100 * ($numProcessed / $numTotal))));
153155
};
154156

@@ -169,12 +171,12 @@ private function migrateMessages(OutputInterface $output)
169171
}
170172
}
171173

172-
$output->write(str_repeat(' ', 28 + ceil(log10($numProcessed))) . "\r");
174+
$output->write(str_repeat(' ', 28 + ceil(log10($numProcessed)))."\r");
173175
$output->writeln(sprintf('Migrated <info>%d</info> message documents.', $numProcessed));
174176
}
175177

176178
/**
177-
* Migrate thread documents
179+
* Migrate thread documents.
178180
*/
179181
private function migrateThreads(OutputInterface $output)
180182
{
@@ -194,10 +196,11 @@ private function migrateThreads(OutputInterface $output)
194196

195197
if (!$numTotal = $cursor->count()) {
196198
$output->writeln('There are no thread documents to migrate.');
199+
197200
return;
198201
}
199202

200-
$this->printStatusCallback = function() use ($output, &$numProcessed, $numTotal) {
203+
$this->printStatusCallback = function () use ($output, &$numProcessed, $numTotal) {
201204
$output->write(sprintf("Processed: <info>%d</info> / Complete: <info>%d%%</info>\r", $numProcessed, round(100 * ($numProcessed / $numTotal))));
202205
};
203206

@@ -222,7 +225,7 @@ private function migrateThreads(OutputInterface $output)
222225
}
223226
}
224227

225-
$output->write(str_repeat(' ', 28 + ceil(log10($numProcessed))) . "\r");
228+
$output->write(str_repeat(' ', 28 + ceil(log10($numProcessed)))."\r");
226229
$output->writeln(sprintf('Migrated <info>%d</info> thread documents.', $numProcessed));
227230
}
228231

@@ -250,6 +253,7 @@ private function createMessageMetadata(array &$message)
250253
* Sets the unreadForParticipants array on the message.
251254
*
252255
* @see Message::doEnsureUnreadForParticipantsArray()
256+
*
253257
* @param array &$message
254258
*/
255259
private function createMessageUnreadForParticipants(array &$message)
@@ -328,6 +332,7 @@ private function createThreadLastMessageDate(array &$thread)
328332
* Sets the active participant arrays on the thread.
329333
*
330334
* @see Thread::doEnsureActiveParticipantArrays()
335+
*
331336
* @param array $thread
332337
*/
333338
private function createThreadActiveParticipantArrays(array &$thread)
@@ -386,11 +391,13 @@ private function createThreadActiveParticipantArrays(array &$thread)
386391
}
387392

388393
/**
389-
* Get the MongoCollection for the given class
394+
* Get the MongoCollection for the given class.
390395
*
391396
* @param ManagerRegistry $registry
392397
* @param string $class
398+
*
393399
* @return \MongoCollection
400+
*
394401
* @throws \RuntimeException if the class has no DocumentManager
395402
*/
396403
private function getMongoCollectionForClass(ManagerRegistry $registry, $class)
@@ -403,7 +410,7 @@ private function getMongoCollectionForClass(ManagerRegistry $registry, $class)
403410
}
404411

405412
/**
406-
* Invokes the print status callback
413+
* Invokes the print status callback.
407414
*
408415
* Since unregister_tick_function() does not support anonymous functions, it
409416
* is easier to register one method (this) and invoke a dynamic callback.

0 commit comments

Comments
 (0)