public function calculateRatingAction()
    {
        $applications = $this->fetchApplications();
        $count = count($applications);
        $i=0;
        echo "Calculate rating for " . $count . " applications ...\n";
        
        $progress = new ProgressBar($count);
        /** @var  \Applications\Entity\Application $application */
        foreach ($applications as $application) {
            $progress->update($i++, 'Application ' . $i . ' / ' . $count);
            $application->getRating(/* recalculate */ true);
        }
        $progress->update($i, 'Write to database...');
        $this->repositories->flush();
        $progress->finish();
        
        return PHP_EOL;
    }
public function calculateRatingAction()
    {
        $applications = $this->fetchApplications();
        $count = count($applications);
        $i=0;
        echo "Calculate rating for " . $count . " applications ...\n";
        
        $progress = new ProgressBar($count);
        /** @var  \Applications\Entity\Application $application */
        foreach ($applications as $application) {
            $progress->update($i++, 'Application ' . $i . ' / ' . $count);
            $application->getRating(/* recalculate */ true);
        }
        $progress->update($i, 'Write to database...');
        $this->repositories->flush();
        $progress->finish();
        
        return PHP_EOL;
    }
public function calculateRatingAction ( ) { $ applications = $ this -> fetchApplications ( ) ; $ count = count ( $ applications ) ; $ i = 0 ; echo "Calculate rating for " . $ count . " applications ...\n" ; $ progress = new ProgressBar ( $ count ) ; /** @var  \Applications\Entity\Application $application */ foreach ( $ applications as $ application ) { $ progress -> update ( $ i ++ , 'Application ' . $ i . ' / ' . $ count ) ; $ application -> getRating ( /* recalculate */ true ) ; } $ progress -> update ( $ i , 'Write to database...' ) ; $ this -> repositories -> flush ( ) ; $ progress -> finish ( ) ; return PHP_EOL ; }
Recalculates ratings for applications

@return string
Recalculates ratings for applications