33namespace FOS \MessageBundle \Command ;
44
55use Doctrine \Common \Persistence \ManagerRegistry ;
6+ use FOS \MessageBundle \Document \Message ;
7+ use FOS \MessageBundle \Document \Thread ;
68use Symfony \Bundle \FrameworkBundle \Command \ContainerAwareCommand ;
79use Symfony \Component \Console \Input \InputArgument ;
810use Symfony \Component \Console \Input \InputInterface ;
@@ -37,7 +39,7 @@ class MongoDBMigrateMetadataCommand extends ContainerAwareCommand
3739 private $ printStatusCallback ;
3840
3941 /**
40- * @see Symfony\Component\Console\Command\Command::isEnabled()
42+ * {@inheritdoc}
4143 */
4244 public function isEnabled ()
4345 {
@@ -49,7 +51,7 @@ public function isEnabled()
4951 }
5052
5153 /**
52- * @see Symfony\Component\Console\Command\Command::configure()
54+ * {@inheritdoc}
5355 */
5456 protected function configure ()
5557 {
@@ -92,7 +94,7 @@ protected function configure()
9294 }
9395
9496 /**
95- * @see Symfony\Bundle\FrameworkBundle\Command\Command::initialize()
97+ * {@inheritdoc}
9698 */
9799 protected function initialize (InputInterface $ input , OutputInterface $ output )
98100 {
@@ -113,7 +115,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
113115 }
114116
115117 /**
116- * @see Symfony\Component\Console\Command\Command::execute()
118+ * {@inheritdoc}
117119 */
118120 protected function execute (InputInterface $ input , OutputInterface $ output )
119121 {
@@ -122,13 +124,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
122124
123125 $ size = memory_get_peak_usage (true );
124126 $ unit = array ('b ' , 'k ' , 'm ' , 'g ' , 't ' , 'p ' );
125- $ output ->writeln (sprintf (" Peak Memory Usage: <comment>%s</comment> " , round ($ size / pow (1024 , ( $ i = floor (log ($ size , 1024 ) ))), 2 ).$ unit [$ i ]));
127+ $ output ->writeln (sprintf (' Peak Memory Usage: <comment>%s</comment> ' , round ($ size / pow (1024 , $ i = floor (log ($ size , 1024 ))), 2 ).$ unit [$ i ]));
126128 }
127129
128130 /**
129131 * Migrate message documents
130- *
131- * @param OutputInterface $output
132132 */
133133 private function migrateMessages (OutputInterface $ output )
134134 {
@@ -175,8 +175,6 @@ private function migrateMessages(OutputInterface $output)
175175
176176 /**
177177 * Migrate thread documents
178- *
179- * @param OutputInterface $output
180178 */
181179 private function migrateThreads (OutputInterface $ output )
182180 {
@@ -233,8 +231,6 @@ private function migrateThreads(OutputInterface $output)
233231 *
234232 * By default, Mongo will not include "$db" when creating the participant
235233 * reference. We'll add that manually to be consistent with Doctrine.
236- *
237- * @param array &$message
238234 */
239235 private function createMessageMetadata (array &$ message )
240236 {
@@ -253,7 +249,7 @@ private function createMessageMetadata(array &$message)
253249 /**
254250 * Sets the unreadForParticipants array on the message.
255251 *
256- * @see FOS\MessageBundle\Document\ Message::doEnsureUnreadForParticipantsArray()
252+ * @see Message::doEnsureUnreadForParticipantsArray()
257253 * @param array &$message
258254 */
259255 private function createMessageUnreadForParticipants (array &$ message )
@@ -331,7 +327,7 @@ private function createThreadLastMessageDate(array &$thread)
331327 /**
332328 * Sets the active participant arrays on the thread.
333329 *
334- * @see FOS\MessageBundle\Document\ Thread::doEnsureActiveParticipantArrays()
330+ * @see Thread::doEnsureActiveParticipantArrays()
335331 * @param array $thread
336332 */
337333 private function createThreadActiveParticipantArrays (array &$ thread )
@@ -342,7 +338,7 @@ private function createThreadActiveParticipantArrays(array &$thread)
342338
343339 foreach ($ thread ['participants ' ] as $ participantRef ) {
344340 foreach ($ thread ['metadata ' ] as $ metadata ) {
345- if ($ participantRef ['$id ' ] == $ metadata ['participant ' ]['$id ' ] && $ metadata [ ' isDeleted ' ]) {
341+ if ($ metadata [ ' isDeleted ' ] && $ participantRef ['$id ' ] === $ metadata ['participant ' ]['$id ' ]) {
346342 continue 2 ;
347343 }
348344 }
0 commit comments