Skip to content

Commit

Permalink
Fix exit condition and CGL
Browse files Browse the repository at this point in the history
Return early when the file does not exist. Minor CGL issue is fixed.
  • Loading branch information
andreaskienast committed Jul 6, 2015
1 parent 02f2f98 commit 0990743
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zray.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public function findFileWithExtensionExit($context, &$storage)

public function registerExit($context, &$storage)
{
$composerDir = dirname($context['calledFromFile']);
$composerDir = dirname($context['calledFromFile']);
$jsonFile = $composerDir.'/installed.json';

if (file_exists($jsonFile) || !is_readable($jsonFile)) {
if (!file_exists($jsonFile) || !is_readable($jsonFile)) {
return false;
}

$json = file_get_contents($jsonFile);
$data = json_decode($json);
$json = file_get_contents($jsonFile);
$data = json_decode($json);

foreach ($data as $package) {
$source = (isset($package->source) && isset($package->source->url))
Expand Down

0 comments on commit 0990743

Please sign in to comment.