for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sugarcrm\UpgradeSpec\DI\Extension;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
class ApplicationExtension extends Extension
{
/**
* @param array $configs
* @param ContainerBuilder $container
*/
public function load(array $configs, ContainerBuilder $container)
$fileLocator = new FileLocator(APPLICATION_ROOT);
$loader = new DirectoryLoader($container, $fileLocator);
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$loader->setResolver(new LoaderResolver([
new XmlFileLoader($container, $fileLocator),
$loader,
]));
$loader->load('./resources/services/');
}
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.