@@ -171,20 +171,20 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | Tool::buildDIC($container, $this->classes); |
| 173 | 173 | |
| 174 | - $container['paginator'] = $container->factory(function ($c) { |
|
| 174 | + $container['paginator'] = $container->factory(function($c) { |
|
| 175 | 175 | return new Paginator($c); |
| 176 | 176 | }); |
| 177 | 177 | |
| 178 | - $container['oauth'] = $container->factory(function ($c) { |
|
| 178 | + $container['oauth'] = $container->factory(function($c) { |
|
| 179 | 179 | return new OAuth2($c); |
| 180 | 180 | }); |
| 181 | 181 | |
| 182 | - $container['httpClient'] = function ($c) { |
|
| 182 | + $container['httpClient'] = function($c) { |
|
| 183 | 183 | return new HttpClient($c); |
| 184 | 184 | }; |
| 185 | 185 | |
| 186 | 186 | if (CACHE_DRIVER === 'memcached') { |
| 187 | - $container['memcached'] = function ($c) { |
|
| 187 | + $container['memcached'] = function($c) { |
|
| 188 | 188 | $memcached = new \Memcached(); |
| 189 | 189 | |
| 190 | 190 | $config = require JITAMIN_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'memcached.php'; |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | }; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - $container['objectStorage'] = function () { |
|
| 202 | + $container['objectStorage'] = function() { |
|
| 203 | 203 | return new FileStorage(FILES_DIR); |
| 204 | 204 | }; |
| 205 | 205 | |
@@ -35,23 +35,23 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function register(Container $container) |
| 37 | 37 | { |
| 38 | - $container['memoryCache'] = function () { |
|
| 38 | + $container['memoryCache'] = function() { |
|
| 39 | 39 | return new MemoryCache(); |
| 40 | 40 | }; |
| 41 | 41 | |
| 42 | 42 | if (CACHE_DRIVER === 'file') { |
| 43 | - $container['cacheDriver'] = function () { |
|
| 43 | + $container['cacheDriver'] = function() { |
|
| 44 | 44 | return new FileCache(); |
| 45 | 45 | }; |
| 46 | 46 | } elseif (CACHE_DRIVER === 'memcached') { |
| 47 | - $container['cacheDriver'] = function ($c) { |
|
| 47 | + $container['cacheDriver'] = function($c) { |
|
| 48 | 48 | return new MemcachedCache($c['memcached'], defined('CACHE_PREFIX') ? CACHE_PREFIX : ''); |
| 49 | 49 | }; |
| 50 | 50 | } else { |
| 51 | 51 | $container['cacheDriver'] = $container['memoryCache']; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $container['userMetadataCacheDecorator'] = function ($c) { |
|
| 54 | + $container['userMetadataCacheDecorator'] = function($c) { |
|
| 55 | 55 | return new MetadataCacheDecorator( |
| 56 | 56 | $c['cacheDriver'], |
| 57 | 57 | $c['userMetadataModel'], |
@@ -60,21 +60,21 @@ discard block |
||
| 60 | 60 | ); |
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | - $container['columnMoveRestrictionCacheDecorator'] = function ($c) { |
|
| 63 | + $container['columnMoveRestrictionCacheDecorator'] = function($c) { |
|
| 64 | 64 | return new ColumnMoveRestrictionCacheDecorator( |
| 65 | 65 | $c['memoryCache'], |
| 66 | 66 | $c['columnMoveRestrictionModel'] |
| 67 | 67 | ); |
| 68 | 68 | }; |
| 69 | 69 | |
| 70 | - $container['columnRestrictionCacheDecorator'] = function ($c) { |
|
| 70 | + $container['columnRestrictionCacheDecorator'] = function($c) { |
|
| 71 | 71 | return new ColumnRestrictionCacheDecorator( |
| 72 | 72 | $c['memoryCache'], |
| 73 | 73 | $c['columnRestrictionModel'] |
| 74 | 74 | ); |
| 75 | 75 | }; |
| 76 | 76 | |
| 77 | - $container['projectRoleRestrictionCacheDecorator'] = function ($c) { |
|
| 77 | + $container['projectRoleRestrictionCacheDecorator'] = function($c) { |
|
| 78 | 78 | return new ProjectRoleRestrictionCacheDecorator( |
| 79 | 79 | $c['memoryCache'], |
| 80 | 80 | $c['projectRoleRestrictionModel'] |
@@ -36,35 +36,35 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function register(Container $container) |
| 38 | 38 | { |
| 39 | - $container['commentEventJob'] = $container->factory(function ($c) { |
|
| 39 | + $container['commentEventJob'] = $container->factory(function($c) { |
|
| 40 | 40 | return new CommentEventJob($c); |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | - $container['subtaskEventJob'] = $container->factory(function ($c) { |
|
| 43 | + $container['subtaskEventJob'] = $container->factory(function($c) { |
|
| 44 | 44 | return new SubtaskEventJob($c); |
| 45 | 45 | }); |
| 46 | 46 | |
| 47 | - $container['taskEventJob'] = $container->factory(function ($c) { |
|
| 47 | + $container['taskEventJob'] = $container->factory(function($c) { |
|
| 48 | 48 | return new TaskEventJob($c); |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | - $container['taskFileEventJob'] = $container->factory(function ($c) { |
|
| 51 | + $container['taskFileEventJob'] = $container->factory(function($c) { |
|
| 52 | 52 | return new TaskFileEventJob($c); |
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | - $container['taskLinkEventJob'] = $container->factory(function ($c) { |
|
| 55 | + $container['taskLinkEventJob'] = $container->factory(function($c) { |
|
| 56 | 56 | return new TaskLinkEventJob($c); |
| 57 | 57 | }); |
| 58 | 58 | |
| 59 | - $container['projectFileEventJob'] = $container->factory(function ($c) { |
|
| 59 | + $container['projectFileEventJob'] = $container->factory(function($c) { |
|
| 60 | 60 | return new ProjectFileEventJob($c); |
| 61 | 61 | }); |
| 62 | 62 | |
| 63 | - $container['notificationJob'] = $container->factory(function ($c) { |
|
| 63 | + $container['notificationJob'] = $container->factory(function($c) { |
|
| 64 | 64 | return new NotificationJob($c); |
| 65 | 65 | }); |
| 66 | 66 | |
| 67 | - $container['projectMetricJob'] = $container->factory(function ($c) { |
|
| 67 | + $container['projectMetricJob'] = $container->factory(function($c) { |
|
| 68 | 68 | return new ProjectMetricJob($c); |
| 69 | 69 | }); |
| 70 | 70 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function register(Container $container) |
| 34 | 34 | { |
| 35 | - $container['userNotificationTypeModel'] = function ($container) { |
|
| 35 | + $container['userNotificationTypeModel'] = function($container) { |
|
| 36 | 36 | $type = new UserNotificationTypeModel($container); |
| 37 | 37 | $type->setType(MailNotification::TYPE, t('Email'), '\Jitamin\Notification\MailNotification'); |
| 38 | 38 | $type->setType(WebNotification::TYPE, t('Web'), '\Jitamin\Notification\WebNotification'); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | return $type; |
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | - $container['projectNotificationTypeModel'] = function ($container) { |
|
| 43 | + $container['projectNotificationTypeModel'] = function($container) { |
|
| 44 | 44 | $type = new ProjectNotificationTypeModel($container); |
| 45 | 45 | $type->setType('webhook', 'Webhook', '\Jitamin\Notification\WebhookNotification', true); |
| 46 | 46 | $type->setType('activity', 'Activity', '\Jitamin\Notification\ActivityNotification', true); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function isAdmin($user_id) |
| 80 | 80 | { |
| 81 | - return $this->userSession->isAdmin() || // Avoid SQL query if connected |
|
| 81 | + return $this->userSession->isAdmin() || // Avoid SQL query if connected |
|
| 82 | 82 | $this->db |
| 83 | 83 | ->table(self::TABLE) |
| 84 | 84 | ->eq('id', $user_id) |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | { |
| 317 | 317 | $this->avatarModel->remove($user_id); |
| 318 | 318 | |
| 319 | - return $this->db->transaction(function (Database $db) use ($user_id) { |
|
| 319 | + return $this->db->transaction(function(Database $db) use ($user_id) { |
|
| 320 | 320 | |
| 321 | 321 | // All assigned tasks are now unassigned (no foreign key) |
| 322 | 322 | if (!$db->table(TaskModel::TABLE)->eq('owner_id', $user_id)->update(['owner_id' => 0])) { |
@@ -186,7 +186,7 @@ |
||
| 186 | 186 | { |
| 187 | 187 | $interface = '\Jitamin\Foundation\Security\\'.$interface; |
| 188 | 188 | |
| 189 | - return array_filter($this->providers, function (AuthenticationProviderInterface $provider) use ($interface) { |
|
| 189 | + return array_filter($this->providers, function(AuthenticationProviderInterface $provider) use ($interface) { |
|
| 190 | 190 | return is_a($provider, $interface); |
| 191 | 191 | }); |
| 192 | 192 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function register(Container $container) |
| 29 | 29 | { |
| 30 | - $container['emailClient'] = function ($container) { |
|
| 30 | + $container['emailClient'] = function($container) { |
|
| 31 | 31 | $mailer = new EmailClient($container); |
| 32 | 32 | $mailer->setTransport('smtp', '\Jitamin\Foundation\Mail\Transport\Smtp'); |
| 33 | 33 | $mailer->setTransport('sendmail', '\Jitamin\Foundation\Mail\Transport\Sendmail'); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function createUserFilter(Container $container) |
| 79 | 79 | { |
| 80 | - $container['userQuery'] = $container->factory(function ($c) { |
|
| 80 | + $container['userQuery'] = $container->factory(function($c) { |
|
| 81 | 81 | $builder = new QueryBuilder(); |
| 82 | 82 | $builder->withQuery($c['db']->table(UserModel::TABLE)); |
| 83 | 83 | |
@@ -96,28 +96,28 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function createProjectFilter(Container $container) |
| 98 | 98 | { |
| 99 | - $container['projectGroupRoleQuery'] = $container->factory(function ($c) { |
|
| 99 | + $container['projectGroupRoleQuery'] = $container->factory(function($c) { |
|
| 100 | 100 | $builder = new QueryBuilder(); |
| 101 | 101 | $builder->withQuery($c['db']->table(ProjectGroupRoleModel::TABLE)); |
| 102 | 102 | |
| 103 | 103 | return $builder; |
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | - $container['projectUserRoleQuery'] = $container->factory(function ($c) { |
|
| 106 | + $container['projectUserRoleQuery'] = $container->factory(function($c) { |
|
| 107 | 107 | $builder = new QueryBuilder(); |
| 108 | 108 | $builder->withQuery($c['db']->table(ProjectUserRoleModel::TABLE)); |
| 109 | 109 | |
| 110 | 110 | return $builder; |
| 111 | 111 | }); |
| 112 | 112 | |
| 113 | - $container['projectQuery'] = $container->factory(function ($c) { |
|
| 113 | + $container['projectQuery'] = $container->factory(function($c) { |
|
| 114 | 114 | $builder = new QueryBuilder(); |
| 115 | 115 | $builder->withQuery($c['db']->table(ProjectModel::TABLE)); |
| 116 | 116 | |
| 117 | 117 | return $builder; |
| 118 | 118 | }); |
| 119 | 119 | |
| 120 | - $container['projectActivityLexer'] = $container->factory(function ($c) { |
|
| 120 | + $container['projectActivityLexer'] = $container->factory(function($c) { |
|
| 121 | 121 | $builder = new LexerBuilder(); |
| 122 | 122 | $builder |
| 123 | 123 | ->withQuery($c['projectActivityModel']->getQuery()) |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | return $builder; |
| 135 | 135 | }); |
| 136 | 136 | |
| 137 | - $container['projectActivityQuery'] = $container->factory(function ($c) { |
|
| 137 | + $container['projectActivityQuery'] = $container->factory(function($c) { |
|
| 138 | 138 | $builder = new QueryBuilder(); |
| 139 | 139 | $builder->withQuery($c['projectActivityModel']->getQuery()); |
| 140 | 140 | |
@@ -153,14 +153,14 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function createTaskFilter(Container $container) |
| 155 | 155 | { |
| 156 | - $container['taskQuery'] = $container->factory(function ($c) { |
|
| 156 | + $container['taskQuery'] = $container->factory(function($c) { |
|
| 157 | 157 | $builder = new QueryBuilder(); |
| 158 | 158 | $builder->withQuery($c['taskFinderModel']->getExtendedQuery()); |
| 159 | 159 | |
| 160 | 160 | return $builder; |
| 161 | 161 | }); |
| 162 | 162 | |
| 163 | - $container['taskLexer'] = $container->factory(function ($c) { |
|
| 163 | + $container['taskLexer'] = $container->factory(function($c) { |
|
| 164 | 164 | $builder = new LexerBuilder(); |
| 165 | 165 | |
| 166 | 166 | $builder |