PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.10.01
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.10.01
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
← All changes | vendor/wpfluent/framework/src/WPFluent/Database/ConnectionResolver.php +4 -3 1.0.942.10.01 View file →
@@ -1,8 +1,9 @@
1 1 <?php
2 2
3 3 namespace FluentCommunity\Framework\Database;
4 4
5 +use InvalidArgumentException;
5 6 use FluentCommunity\Framework\Foundation\App;
6 7 use FluentCommunity\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.