diff options
Diffstat (limited to 'app/Core')
-rw-r--r-- | app/Core/Base.php | 15 | ||||
-rw-r--r-- | app/Core/ExternalTask/ExternalTaskManager.php | 7 | ||||
-rw-r--r-- | app/Core/Filter/FormatterInterface.php | 2 | ||||
-rw-r--r-- | app/Core/Tool.php | 25 |
4 files changed, 46 insertions, 3 deletions
diff --git a/app/Core/Base.php b/app/Core/Base.php index 881cccbd..d3c264d1 100644 --- a/app/Core/Base.php +++ b/app/Core/Base.php @@ -62,6 +62,21 @@ use Pimple\Container; * @property \Kanboard\Decorator\ColumnRestrictionCacheDecorator $columnRestrictionCacheDecorator * @property \Kanboard\Decorator\ColumnMoveRestrictionCacheDecorator $columnMoveRestrictionCacheDecorator * @property \Kanboard\Decorator\ProjectRoleRestrictionCacheDecorator $projectRoleRestrictionCacheDecorator + * @property \Kanboard\Formatter\BoardColumnFormatter $boardColumnFormatter + * @property \Kanboard\Formatter\BoardFormatter $boardFormatter + * @property \Kanboard\Formatter\BoardSwimlaneFormatter $boardSwimlaneFormatter + * @property \Kanboard\Formatter\BoardTaskFormatter $boardTaskFormatter + * @property \Kanboard\Formatter\GroupAutoCompleteFormatter $groupAutoCompleteFormatter + * @property \Kanboard\Formatter\ProjectActivityEventFormatter $projectActivityEventFormatter + * @property \Kanboard\Formatter\ProjectGanttFormatter $projectGanttFormatter + * @property \Kanboard\Formatter\SubtaskTimeTrackingCalendarFormatter $subtaskTimeTrackingCalendarFormatter + * @property \Kanboard\Formatter\TaskAutoCompleteFormatter $taskAutoCompleteFormatter + * @property \Kanboard\Formatter\TaskCalendarFormatter $taskCalendarFormatter + * @property \Kanboard\Formatter\TaskGanttFormatter $taskGanttFormatter + * @property \Kanboard\Formatter\TaskICalFormatter $taskICalFormatter + * @property \Kanboard\Formatter\TaskSuggestMenuFormatter $taskSuggestMenuFormatter + * @property \Kanboard\Formatter\UserAutoCompleteFormatter $userAutoCompleteFormatter + * @property \Kanboard\Formatter\UserMentionFormatter $userMentionFormatter * @property \Kanboard\Model\ActionModel $actionModel * @property \Kanboard\Model\ActionParameterModel $actionParameterModel * @property \Kanboard\Model\AvatarFileModel $avatarFileModel diff --git a/app/Core/ExternalTask/ExternalTaskManager.php b/app/Core/ExternalTask/ExternalTaskManager.php index 2ce6f106..102ec459 100644 --- a/app/Core/ExternalTask/ExternalTaskManager.php +++ b/app/Core/ExternalTask/ExternalTaskManager.php @@ -48,6 +48,11 @@ class ExternalTaskManager public function getProvidersList() { $providers = array_keys($this->providers); - return array_combine($providers, $providers); + + if (count($providers)) { + return array_combine($providers, $providers); + } + + return array(); } } diff --git a/app/Core/Filter/FormatterInterface.php b/app/Core/Filter/FormatterInterface.php index b7c04c51..0ff84976 100644 --- a/app/Core/Filter/FormatterInterface.php +++ b/app/Core/Filter/FormatterInterface.php @@ -17,7 +17,7 @@ interface FormatterInterface * * @access public * @param Table $query - * @return FormatterInterface + * @return $this */ public function withQuery(Table $query); diff --git a/app/Core/Tool.php b/app/Core/Tool.php index 9b8820eb..6e457641 100644 --- a/app/Core/Tool.php +++ b/app/Core/Tool.php @@ -41,7 +41,7 @@ class Tool } /** - * Build dependency injection container from an array + * Build dependency injection containers from an array * * @static * @access public @@ -64,6 +64,29 @@ class Tool } /** + * Build dependency injection container from an array + * + * @static + * @access public + * @param Container $container + * @param array $namespaces + * @return Container + */ + public static function buildFactories(Container $container, array $namespaces) + { + foreach ($namespaces as $namespace => $classes) { + foreach ($classes as $name) { + $class = '\\Kanboard\\'.$namespace.'\\'.$name; + $container[lcfirst($name)] = $container->factory(function ($c) use ($class) { + return new $class($c); + }); + } + } + + return $container; + } + + /** * Build dependency injection container for custom helpers from an array * * @static |