Skip to content

Commit

Permalink
[BUGFIX] Fixed warning in foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuench committed Apr 13, 2013
1 parent 52012d0 commit 43ba827
Showing 1 changed file with 14 additions and 12 deletions.
Expand Up @@ -36,7 +36,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$rewrites = $this->loadRewrites();
$conflictCounter = 0;
foreach ($rewrites as $type => $data) {
if (count($data) > 0) {
if (count($data) > 0 && is_array($data)) {
foreach ($data as $class => $rewriteClass) {
if (count($rewriteClass) > 1) {
if ($this->_isInheritanceConflict($rewriteClass)) {
Expand Down Expand Up @@ -108,17 +108,19 @@ protected function logJUnit(array $conflicts, $filename, $duration)
$testCase = $suite->addTestCase();
$testCase->setName('Magento Rewrite Conflict Test');
$testCase->setClassname('ConflictsCommand');
foreach ($conflicts as $conflictRow) {
$testCase->addFailure(
sprintf(
'Rewrite conflict: Type %s | Class: %s, Rewrites: %s | Loaded class: %s',
$conflictRow['Type'],
$conflictRow['Class'],
$conflictRow['Rewrites'],
$conflictRow['Loaded Class']
),
'MagentoRewriteConflictException'
);
if (count($conflicts) > 0) {
foreach ($conflicts as $conflictRow) {
$testCase->addFailure(
sprintf(
'Rewrite conflict: Type %s | Class: %s, Rewrites: %s | Loaded class: %s',
$conflictRow['Type'],
$conflictRow['Class'],
$conflictRow['Rewrites'],
$conflictRow['Loaded Class']
),
'MagentoRewriteConflictException'
);
}
}

$document->save($filename);
Expand Down

0 comments on commit 43ba827

Please sign in to comment.