@@ -101,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101
102102 $ output ->write ($ indexer ->getTitle () . ' index ' );
103103
104- $ startTime = microtime ( true );
104+ $ startTime = new \ DateTimeImmutable ( );
105105 $ indexerConfig = $ this ->getConfig ()->getIndexer ($ indexer ->getId ());
106106 $ sharedIndex = $ indexerConfig ['shared_index ' ] ?? null ;
107107
@@ -112,10 +112,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
112112 $ this ->sharedIndexesComplete [] = $ sharedIndex ;
113113 }
114114 }
115- $ resultTime = microtime (true ) - $ startTime ;
115+ $ endTime = new \DateTimeImmutable ();
116+ $ interval = $ startTime ->diff ($ endTime );
117+ $ days = $ interval ->format ('%d ' );
118+ $ hours = $ days > 0 ? $ days * 24 + $ interval ->format ('%H ' ) : $ interval ->format ('%H ' );
119+ $ minutes = $ interval ->format ('%I ' );
120+ $ seconds = $ interval ->format ('%S ' );
116121
117122 $ output ->writeln (
118- __ ('has been rebuilt successfully in %time ' , [ ' time ' => gmdate ( ' H:i:s ' , ( int ) $ resultTime )] )
123+ __ ('has been rebuilt successfully in %1:%2:%3 ' , $ hours , $ minutes , $ seconds )
119124 );
120125 } catch (\Throwable $ e ) {
121126 $ output ->writeln ('process error during indexation process: ' );
@@ -238,7 +243,9 @@ private function validateIndexerStatus(IndexerInterface $indexer)
238243 * Get config
239244 *
240245 * @return ConfigInterface
241- * @deprecated 100.1.0
246+ * @deprecated 100.1.0 We don't recommend this approach anymore
247+ * @see Add a new optional parameter to the constructor at the end of the arguments list instead
248+ * and fetch the dependency using Magento\Framework\App\ObjectManager::getInstance() in the constructor body
242249 */
243250 private function getConfig ()
244251 {
@@ -252,7 +259,9 @@ private function getConfig()
252259 * Get dependency info provider
253260 *
254261 * @return DependencyInfoProvider
255- * @deprecated 100.2.0
262+ * @deprecated 100.2.0 We don't recommend this approach anymore
263+ * @see Add a new optional parameter to the constructor at the end of the arguments list instead
264+ * and fetch the dependency using Magento\Framework\App\ObjectManager::getInstance() in the constructor body
256265 */
257266 private function getDependencyInfoProvider ()
258267 {
0 commit comments