Completed
Push — master ( 02198f...70daad )
by Stanislav
02:23
created
src/Command/TorrentClean.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             return 1;
38 38
         }
39 39
 
40
-        $blackTorrentList = array_filter($torrentList, function ($torrent) use ($blacklist) {
40
+        $blackTorrentList = array_filter($torrentList, function($torrent) use ($blacklist) {
41 41
             return in_array($torrent[Torrent\Get::NAME], $blacklist);
42 42
         });
43 43
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $client->printTorrentsTable($blackTorrentList, $output);
49 49
         $output->writeln('Total size: ' . $sizeInGb . ' Gb');
50 50
 
51
-        $this->dryRun($input, $output, function () use ($logger) {
51
+        $this->dryRun($input, $output, function() use ($logger) {
52 52
             $logger->critical('actual delete not implemented!');
53 53
             //$client->removeTorrents($blackTorrentList, true);
54 54
         }, 'dry-run, don\'t really remove');
Please login to merge, or discard this patch.
src/Command/WeburgDownload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
                 $torrentsUrls = $this->getPopularTorrentsUrls($output, $weburgClient, $downloadDir);
43 43
             }
44 44
 
45
-            $this->dryRun($input, $output, function () use ($weburgClient, $torrentsDir, $torrentsUrls) {
45
+            $this->dryRun($input, $output, function() use ($weburgClient, $torrentsDir, $torrentsUrls) {
46 46
                 foreach ($torrentsUrls as $torrentUrl) {
47 47
                     $weburgClient->downloadTorrent($torrentUrl, $torrentsDir);
48 48
                 }
Please login to merge, or discard this patch.
src/Command/TorrentRemoveDuplicates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
             return 0;
33 33
         }
34 34
 
35
-        $this->dryRun($input, $output, function () use ($logger, $client, $obsoleteList) {
35
+        $this->dryRun($input, $output, function() use ($logger, $client, $obsoleteList) {
36 36
             $client->removeTorrents($obsoleteList);
37 37
             $names = $client->getTorrentsField($obsoleteList, Torrent\Get::NAME);
38 38
             $logger->info('Removed torrents:' . implode(', ', $names));
Please login to merge, or discard this patch.
src/Command/StatsSend.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
             $logger->debug('Send point: {point}', ['point' => $point]);
77 77
         }
78 78
 
79
-        $this->dryRun($input, $output, function () use ($database, $points, $logger) {
79
+        $this->dryRun($input, $output, function() use ($database, $points, $logger) {
80 80
             $isSuccess = $database->writePoints($points, InfluxDB\Database::PRECISION_SECONDS);
81 81
             $logger->info('InfluxDB write ' . ($isSuccess ? 'success' : 'failed'));
82 82
         }, 'dry-run, don\'t really send points');
Please login to merge, or discard this patch.
src/Command/Command.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
                 $config->loadConfigFile();
59 59
             } catch (\RuntimeException $e) {
60 60
                 $logger->critical($e->getMessage());
61
-                $this->setCode(function () {
61
+                $this->setCode(function() {
62 62
                     return 1;
63 63
                 });
64 64
                 return;
Please login to merge, or discard this patch.
src/TransmissionClient.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@
 block discarded – undo
47 47
             ];
48 48
         }
49 49
 
50
-        $cleanedIds = array_map(function ($torrentId) {
51
-            return (int)$torrentId;
50
+        $cleanedIds = array_map(function($torrentId) {
51
+            return (int) $torrentId;
52 52
         }, $ids);
53 53
 
54 54
         $this->createSession();
Please login to merge, or discard this patch.
src/Helpers/TorrentUtils.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             $filters = self::parseAgeFilter($filters['age']) + $filters;
49 49
         }
50 50
 
51
-        return array_filter($torrentList, function ($torrent) use ($filters) {
51
+        return array_filter($torrentList, function($torrent) use ($filters) {
52 52
             $age = self::getTorrentAgeInDays($torrent);
53 53
             if ($age < $filters['age_min'] || $age > $filters['age_max']) {
54 54
                 return false;
@@ -88,8 +88,7 @@  discard block
 block discarded – undo
88 88
     public static function getTorrentAge($torrent)
89 89
     {
90 90
         $date = isset($torrent[Torrent\Get::DONE_DATE]) && $torrent[Torrent\Get::DONE_DATE] ?
91
-            $torrent[Torrent\Get::DONE_DATE] :
92
-            (isset($torrent[Torrent\Get::ADDED_DATE]) ? $torrent[Torrent\Get::ADDED_DATE] : 0);
91
+            $torrent[Torrent\Get::DONE_DATE] : (isset($torrent[Torrent\Get::ADDED_DATE]) ? $torrent[Torrent\Get::ADDED_DATE] : 0);
93 92
         return $date ? time() - $date : 0;
94 93
     }
95 94
 
@@ -110,7 +109,7 @@  discard block
 block discarded – undo
110 109
             abs($columnNumber)
111 110
         )) - 1;
112 111
 
113
-        usort($rowsSorted, function ($first, $second) use ($columnIndex, $sortOrder) {
112
+        usort($rowsSorted, function($first, $second) use ($columnIndex, $sortOrder) {
114 113
             return $first[$columnIndex] > $second[$columnIndex] ? $sortOrder : $sortOrder * -1;
115 114
         });
116 115
 
Please login to merge, or discard this patch.