for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PEIP\Context;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
* Description of XMLContextReader
*
* @author timo
use PEIP\Translator\XMLArrayTranslator;
class XMLContextReader extends \PEIP\ABS\Base\Connectable
{
//put your code here
protected $config;
public function __construct($config)
$this->config = ($config);
}
public function read()
$iterator = new \SimpleXMLIterator($this->config);
$iterator->rewind();
while ($iterator->valid()) {
$arrayNode = XMLArrayTranslator::translate($iterator->current()->asXML());
$this->doFireEvent('read_node', ['NODE' => $arrayNode]);
$iterator->next();
foreach ($iterator as $xmlNode) {
foreach
This check looks for foreach loops that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.
Consider removing the loop.
$this->config = [];
This check looks for
foreach
loops that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.Consider removing the loop.