[!!!][FEATURE] Removed php-di as suggested by #477

NOTE: Custom class-loader should be used to create custom integrations with frameworks like php-di. See documentation for more information.

- Removed all references to php-cli from composer + code.
- Added ClassLoader php-unit tests.
This commit is contained in:
Simon Sessingø
2021-03-23 00:46:17 +01:00
parent 6686de46b9
commit a44a93d705
10 changed files with 58 additions and 150 deletions
+4 -10
View File
@@ -10,7 +10,6 @@
namespace Pecee\SimpleRouter;
use DI\Container;
use Pecee\Exceptions\InvalidArgumentException;
use Pecee\Http\Middleware\BaseCsrfVerifier;
use Pecee\Http\Request;
@@ -533,17 +532,12 @@ class SimpleRouter
}
/**
* Enable or disable dependency injection
*
* @param Container $container
* @return IClassLoader
* Set custom class-loader class used.
* @param IClassLoader $classLoader
*/
public static function enableDependencyInjection(Container $container): IClassLoader
public static function setCustomClassLoader(IClassLoader $classLoader): void
{
return static::router()
->getClassLoader()
->useDependencyInjection(true)
->setContainer($container);
static::router()->setClassLoader($classLoader);
}
/**