Skip to content

Commit

Permalink
Handle strict typing in Checker and fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Feb 21, 2018
1 parent 4d5f2e6 commit 72e745b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/private/IntegrityCheck/Checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ private function verify(string $signaturePath, string $basePath, string $certifi
return [];
}

$signatureData = json_decode($this->fileAccessHelper->file_get_contents($signaturePath), true);
$content = $this->fileAccessHelper->file_get_contents($signaturePath);
$signatureData = null;

if (\is_string($content)) {
$signatureData = json_decode($content, true);
}
if(!\is_array($signatureData)) {
throw new InvalidSignatureException('Signature data not found.');
}
Expand Down
3 changes: 3 additions & 0 deletions tests/lib/IntegrityCheck/CheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public function setUp() {
$this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->appManager = $this->createMock(IAppManager::class);

$this->config->method('getAppValue')
->will($this->returnArgument(2));

$this->cacheFactory
->expects($this->any())
->method('createDistributed')
Expand Down

0 comments on commit 72e745b

Please sign in to comment.