for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* this file is part of magerun
*
* @author Tom Klingenberg <https://github.com/ktomk>
*/
namespace N98;
use Composer\Autoload\ClassLoader;
use ErrorException;
class MagerunBootstrap
{
* @param ClassLoader $loader
$loader
null|ClassLoader
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
* @return Magento\Application
* @throws ErrorException
public static function createApplication(ClassLoader $loader = null)
if (null === $loader) {
$loader = self::getLoader();
}
$application = new Magento\Application($loader);
return $application;
* @return ClassLoader
public static function getLoader()
if (
!($loader = self::includeIfExists(__DIR__ . '/../../vendor/autoload.php'))
&& !($loader = self::includeIfExists(__DIR__ . '/../../../../autoload.php'))
) {
throw new ErrorException(
'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
return $loader;
* @param $file
* @return mixed
public static function includeIfExists($file)
if (file_exists($file)) {
return include $file;
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.