Passed
Push — master ( 8b31db...d0e1bc )
by Roeland
09:05
created
lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -42,67 +42,67 @@
 block discarded – undo
42 42
  */
43 43
 class CleanupCardDAVPhotoCache implements IRepairStep {
44 44
 
45
-	/** @var IConfig */
46
-	private $config;
45
+    /** @var IConfig */
46
+    private $config;
47 47
 
48
-	/** @var IAppData */
49
-	private $appData;
48
+    /** @var IAppData */
49
+    private $appData;
50 50
 
51
-	/** @var ILogger */
52
-	private $logger;
51
+    /** @var ILogger */
52
+    private $logger;
53 53
 
54
-	public function __construct(IConfig $config, IAppData $appData, ILogger $logger) {
55
-		$this->config = $config;
56
-		$this->appData = $appData;
57
-		$this->logger = $logger;
58
-	}
54
+    public function __construct(IConfig $config, IAppData $appData, ILogger $logger) {
55
+        $this->config = $config;
56
+        $this->appData = $appData;
57
+        $this->logger = $logger;
58
+    }
59 59
 
60
-	public function getName(): string {
61
-		return 'Cleanup invalid photocache files for carddav';
62
-	}
60
+    public function getName(): string {
61
+        return 'Cleanup invalid photocache files for carddav';
62
+    }
63 63
 
64
-	private function repair(IOutput $output): void {
65
-		try {
66
-			$folders = $this->appData->getDirectoryListing();
67
-		} catch (NotFoundException $e) {
68
-			return;
69
-		} catch (RuntimeException $e) {
70
-			$this->logger->logException($e, ['message' => 'Failed to fetch directory listing in CleanupCardDAVPhotoCache']);
71
-			return;
72
-		}
64
+    private function repair(IOutput $output): void {
65
+        try {
66
+            $folders = $this->appData->getDirectoryListing();
67
+        } catch (NotFoundException $e) {
68
+            return;
69
+        } catch (RuntimeException $e) {
70
+            $this->logger->logException($e, ['message' => 'Failed to fetch directory listing in CleanupCardDAVPhotoCache']);
71
+            return;
72
+        }
73 73
 
74
-		$folders = array_filter($folders, function (ISimpleFolder $folder) {
75
-			return $folder->fileExists('photo.');
76
-		});
74
+        $folders = array_filter($folders, function (ISimpleFolder $folder) {
75
+            return $folder->fileExists('photo.');
76
+        });
77 77
 
78
-		if (empty($folders)) {
79
-			return;
80
-		}
78
+        if (empty($folders)) {
79
+            return;
80
+        }
81 81
 
82
-		$output->info('Delete ' . count($folders) . ' "photo." files');
82
+        $output->info('Delete ' . count($folders) . ' "photo." files');
83 83
 
84
-		foreach ($folders as $folder) {
85
-			try {
86
-				/** @var ISimpleFolder $folder */
87
-				$folder->getFile('photo.')->delete();
88
-			} catch (\Exception $e) {
89
-				$this->logger->logException($e);
90
-				$output->warning('Could not delete file "dav-photocache/' . $folder->getName() . '/photo."');
91
-			}
92
-		}
93
-	}
84
+        foreach ($folders as $folder) {
85
+            try {
86
+                /** @var ISimpleFolder $folder */
87
+                $folder->getFile('photo.')->delete();
88
+            } catch (\Exception $e) {
89
+                $this->logger->logException($e);
90
+                $output->warning('Could not delete file "dav-photocache/' . $folder->getName() . '/photo."');
91
+            }
92
+        }
93
+    }
94 94
 
95
-	private function shouldRun(): bool {
96
-		return version_compare(
97
-			$this->config->getSystemValue('version', '0.0.0.0'),
98
-			'16.0.0.0',
99
-			'<='
100
-		);
101
-	}
95
+    private function shouldRun(): bool {
96
+        return version_compare(
97
+            $this->config->getSystemValue('version', '0.0.0.0'),
98
+            '16.0.0.0',
99
+            '<='
100
+        );
101
+    }
102 102
 
103
-	public function run(IOutput $output): void {
104
-		if ($this->shouldRun()) {
105
-			$this->repair($output);
106
-		}
107
-	}
103
+    public function run(IOutput $output): void {
104
+        if ($this->shouldRun()) {
105
+            $this->repair($output);
106
+        }
107
+    }
108 108
 }
Please login to merge, or discard this patch.