summaryrefslogtreecommitdiff
path: root/app/ServiceProvider/ClassProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/ServiceProvider/ClassProvider.php')
-rw-r--r--app/ServiceProvider/ClassProvider.php25
1 files changed, 12 insertions, 13 deletions
diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php
index ef7aa575..a5677948 100644
--- a/app/ServiceProvider/ClassProvider.php
+++ b/app/ServiceProvider/ClassProvider.php
@@ -2,13 +2,16 @@
namespace ServiceProvider;
+use Core\ObjectStorage\FileStorage;
use Core\Paginator;
use Core\OAuth2;
+use Core\Tool;
use Model\Config;
use Model\Project;
use Model\Webhook;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
+use League\HTMLToMarkdown\HtmlConverter;
class ClassProvider implements ServiceProviderInterface
{
@@ -18,7 +21,6 @@ class ClassProvider implements ServiceProviderInterface
'Action',
'Authentication',
'Board',
- 'Budget',
'Category',
'Color',
'Comment',
@@ -26,7 +28,6 @@ class ClassProvider implements ServiceProviderInterface
'Currency',
'DateParser',
'File',
- 'HourlyRate',
'LastLogin',
'Link',
'Notification',
@@ -93,17 +94,7 @@ class ClassProvider implements ServiceProviderInterface
public function register(Container $container)
{
- foreach ($this->classes as $namespace => $classes) {
-
- foreach ($classes as $name) {
-
- $class = '\\'.$namespace.'\\'.$name;
-
- $container[lcfirst($name)] = function ($c) use ($class) {
- return new $class($c);
- };
- }
- }
+ Tool::buildDIC($container, $this->classes);
$container['paginator'] = $container->factory(function ($c) {
return new Paginator($c);
@@ -112,5 +103,13 @@ class ClassProvider implements ServiceProviderInterface
$container['oauth'] = $container->factory(function ($c) {
return new OAuth2($c);
});
+
+ $container['htmlConverter'] = function($c) {
+ return new HtmlConverter(array('strip_tags' => true));
+ };
+
+ $container['objectStorage'] = function($c) {
+ return new FileStorage(FILES_DIR);
+ };
}
}