Skip to content

Commit

Permalink
Codestyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IljaN committed Apr 11, 2018
1 parent 26d53f3 commit 6842886
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions apps/files/lib/Command/VerifyChecksums.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ public function __construct(IRootFolder $rootFolder, IUserManager $userManager)
protected function configure() {
$this
->setName('files:checksums:verify')
->setDescription("Get all checksums in filecache and compares them by recalculating the checksum of the file.")
->addOption('repair', 'r', InputOption::VALUE_NONE, "Repair filecache-entry with missmatched checksums.")
->setDescription('Get all checksums in filecache and compares them by recalculating the checksum of the file.')
->addOption('repair', 'r', InputOption::VALUE_NONE, 'Repair filecache-entry with mismatched checksums.')
->addOption('user', 'u', InputOption::VALUE_REQUIRED, 'Specific user to check')
->addOption('path', 'p', InputOption::VALUE_REQUIRED, "Path to check relative to data e.g /john/files/", '');
->addOption('path', 'p', InputOption::VALUE_REQUIRED, 'Path to check relative to data e.g /john/files/', '');
}

public function execute(InputInterface $input, OutputInterface $output) {
Expand All @@ -100,7 +100,7 @@ public function execute(InputInterface $input, OutputInterface $output) {
$path = $node->getInternalPath();
$currentChecksums = $node->getChecksum();

// Files without calculated checksum can`t cause checksum errors
// Files without calculated checksum can't cause checksum errors
if (empty($currentChecksums)) {
$output->writeln("Skipping $path => No Checksum", OutputInterface::VERBOSITY_VERBOSE);
return;
Expand All @@ -117,7 +117,7 @@ public function execute(InputInterface $input, OutputInterface $output) {
$this->exitStatus = self::EXIT_CHECKSUM_ERRORS;

if ($input->getOption('repair')) {
$output->writeln("<info>Repairing!</info>");
$output->writeln("<info>Repairing $path</info>");
$this->updateChecksumsForNode($node, $actualChecksums);
$this->exitStatus = self::EXIT_NO_ERRORS;
}
Expand Down
10 changes: 5 additions & 5 deletions apps/files/tests/Command/VerifyChecksumsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ private function assertChecksumsAreCorrect(array $files) {
$f = $files[$key]['file'];
$expectedChecksums = $files[$key]['expectedChecksums'];
$this->refreshFileInfo($files[$key]['file']);
$this->assertThat(
$this->assertSame(
$expectedChecksums(),
$this->equalTo($f->getChecksum())
$f->getChecksum()
);
}
}
Expand All @@ -160,7 +160,7 @@ public function testNoBrokenChecksums() {
$this->cmd->execute([]);
$exitCode = $this->cmd->getStatusCode();

$this->assertEquals(VerifyChecksums::EXIT_NO_ERRORS, $exitCode, "Wrong exit code");
$this->assertEquals(VerifyChecksums::EXIT_NO_ERRORS, $exitCode, 'Wrong exit code');
$this->assertChecksumsAreCorrect($this->testFiles);
}

Expand All @@ -178,7 +178,7 @@ public function testBrokenChecksumsAreNotRepairedWithoutArguments() {


$exitCode = $this->cmd->getStatusCode();
$this->assertEquals(VerifyChecksums::EXIT_CHECKSUM_ERRORS, $exitCode, "Wrong exit code");
$this->assertEquals(VerifyChecksums::EXIT_CHECKSUM_ERRORS, $exitCode, 'Wrong exit code');


$this->assertEquals(self::BROKEN_CHECKSUM_STRING, $file1->getChecksum());
Expand Down Expand Up @@ -222,7 +222,7 @@ public function testBrokenChecksumsResultInErrorExitCode() {
$this->assertEquals(self::BROKEN_CHECKSUM_STRING, $file1->getChecksum());

$exitCode = $this->cmd->getStatusCode();
$this->assertEquals(VerifyChecksums::EXIT_CHECKSUM_ERRORS, $exitCode, "Wrong exit code");
$this->assertEquals(VerifyChecksums::EXIT_CHECKSUM_ERRORS, $exitCode, 'Wrong exit code');

}

Expand Down

0 comments on commit 6842886

Please sign in to comment.