summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-17 22:31:04 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-17 22:31:04 -0400
commitad55e6ede5fab449c91aced8c1a42ae4ee7b809c (patch)
tree744fc7ba3d82c830dd90ec4de992385607b9a832 /app
parent09da289c2fb18475f372bee24e885617da484e0b (diff)
Remove exit expression in database provider
Diffstat (limited to 'app')
-rw-r--r--app/Core/Base.php2
-rw-r--r--app/Model/NotificationType.php2
-rw-r--r--app/Model/UserMetadata.php2
-rw-r--r--app/ServiceProvider/DatabaseProvider.php9
4 files changed, 8 insertions, 7 deletions
diff --git a/app/Core/Base.php b/app/Core/Base.php
index b7be45d1..d402fb37 100644
--- a/app/Core/Base.php
+++ b/app/Core/Base.php
@@ -56,6 +56,8 @@ use Pimple\Container;
* @property \Kanboard\Model\ProjectDailyStats $projectDailyStats
* @property \Kanboard\Model\ProjectMetadata $projectMetadata
* @property \Kanboard\Model\ProjectPermission $projectPermission
+ * @property \Kanboard\Model\ProjectNotification $projectNotification
+ * @property \Kanboard\Model\ProjectNotificationType $projectNotificationType
* @property \Kanboard\Model\Subtask $subtask
* @property \Kanboard\Model\SubtaskExport $subtaskExport
* @property \Kanboard\Model\SubtaskTimeTracking $subtaskTimeTracking
diff --git a/app/Model/NotificationType.php b/app/Model/NotificationType.php
index bc9c6fdc..9d8317b7 100644
--- a/app/Model/NotificationType.php
+++ b/app/Model/NotificationType.php
@@ -120,7 +120,7 @@ abstract class NotificationType extends Base
{
$classes = $this->classes;
- return array_filter($types, function($type) use ($classes) {
+ return array_filter($types, function ($type) use ($classes) {
return isset($classes[$type]);
});
}
diff --git a/app/Model/UserMetadata.php b/app/Model/UserMetadata.php
index 6f1222e2..411837bd 100644
--- a/app/Model/UserMetadata.php
+++ b/app/Model/UserMetadata.php
@@ -27,4 +27,4 @@ class UserMetadata extends Metadata
{
return 'user_id';
}
-} \ No newline at end of file
+}
diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php
index 43c4b813..b2115644 100644
--- a/app/ServiceProvider/DatabaseProvider.php
+++ b/app/ServiceProvider/DatabaseProvider.php
@@ -2,6 +2,8 @@
namespace Kanboard\ServiceProvider;
+use LogicException;
+use RuntimeException;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use PicoDb\Database;
@@ -27,24 +29,21 @@ class DatabaseProvider implements ServiceProviderInterface
case 'sqlite':
$db = $this->getSqliteInstance();
break;
-
case 'mysql':
$db = $this->getMysqlInstance();
break;
-
case 'postgres':
$db = $this->getPostgresInstance();
break;
-
default:
- die('Database driver not supported');
+ throw new LogicException('Database driver not supported');
}
if ($db->schema()->check(\Schema\VERSION)) {
return $db;
} else {
$errors = $db->getLogMessages();
- die('Unable to migrate database schema: <br/><br/><strong>'.(isset($errors[0]) ? $errors[0] : 'Unknown error').'</strong>');
+ throw new RuntimeException('Unable to migrate database schema: '.(isset($errors[0]) ? $errors[0] : 'Unknown error'));
}
}