PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.1.0
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.1.0
2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 All 42 releases
← All changes | vendor/wpfluent/framework/src/WPFluent/Database/ConnectionResolver.php +4 -3 1.132.1.0 View file →
@@ -1,8 +1,9 @@
1 1 <?php
2 2
3 3 namespace FluentBoards\Framework\Database;
4 4
5 +use InvalidArgumentException;
5 6 use FluentBoards\Framework\Foundation\App;
6 7 use FluentBoards\Framework\Database\ConnectionResolverInterface;
7 8
8 9 class ConnectionResolver implements ConnectionResolverInterface
@@ -46,9 +47,9 @@
46 47 return $name;
47 48 }
48 49
49 50 if (is_null($name)) {
50 - return $this->getDefaultConnection();
51 + $name = $this->getDefaultConnection();
51 52 }
52 53
53 54 if (isset($this->connections[$name])) {
54 55 return $this->connections[$name];
@@ -53,9 +54,9 @@
53 54 if (isset($this->connections[$name])) {
54 55 return $this->connections[$name];
55 56 }
56 57
57 - return $this->getDefaultConnection();
58 + throw new InvalidArgumentException("Connection [{$name}] not found.");
58 59 }
59 60
60 61 /**
61 62 * Add a connection to the resolver.
@@ -86,9 +87,9 @@
86 87 * @return string
87 88 */
88 89 public function getDefaultConnection()
89 90 {
90 - return $this->default ?: App::getInstance('db');
91 + return $this->default;
91 92 }
92 93
93 94 /**
94 95 * Set the default connection name.