diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php index 63b3b297b163..dd376159603f 100644 --- a/src/Illuminate/Database/DetectsLostConnections.php +++ b/src/Illuminate/Database/DetectsLostConnections.php @@ -43,6 +43,7 @@ protected function causedByLostConnection(Throwable $e) 'Connection refused', 'running with the --read-only option so it cannot execute this statement', 'The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.', + 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again', ]); } } diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php index 9fb153be7a13..986e8a72121f 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php @@ -351,7 +351,7 @@ public function getAttributeValue($key) } // If the attribute exists within the cast array, we will convert it to - // an appropriate native PHP type dependant upon the associated value + // an appropriate native PHP type dependent upon the associated value // given with the key in the pair. Dayle made this comment line up. if ($this->hasCast($key)) { return $this->castAttribute($key, $value); diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index 3e488526edaa..5b3990ddfa2a 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -2331,9 +2331,9 @@ protected function stripTableForPluck($column) return $column; } - $seperator = strpos(strtolower($column), ' as ') !== false ? ' as ' : '\.'; + $separator = strpos(strtolower($column), ' as ') !== false ? ' as ' : '\.'; - return last(preg_split('~'.$seperator.'~i', $column)); + return last(preg_split('~'.$separator.'~i', $column)); } /** diff --git a/src/Illuminate/Http/Request.php b/src/Illuminate/Http/Request.php index 0c9bfa6b005f..a4018c5c2174 100644 --- a/src/Illuminate/Http/Request.php +++ b/src/Illuminate/Http/Request.php @@ -294,7 +294,7 @@ public function ips() /** * Get the client user agent. * - * @return string + * @return string|null */ public function userAgent() { diff --git a/src/Illuminate/Routing/Matching/HostValidator.php b/src/Illuminate/Routing/Matching/HostValidator.php index 76f9d878ec04..a0ea7210cb54 100644 --- a/src/Illuminate/Routing/Matching/HostValidator.php +++ b/src/Illuminate/Routing/Matching/HostValidator.php @@ -16,10 +16,12 @@ class HostValidator implements ValidatorInterface */ public function matches(Route $route, Request $request) { - if (is_null($route->getCompiled()->getHostRegex())) { + $hostRegex = $route->getCompiled()->getHostRegex(); + + if (is_null($hostRegex)) { return true; } - return preg_match($route->getCompiled()->getHostRegex(), $request->getHost()); + return preg_match($hostRegex, $request->getHost()); } } diff --git a/tests/Database/DatabaseEloquentBuilderTest.php b/tests/Database/DatabaseEloquentBuilderTest.php index d772a8477a30..8276ea03e96b 100755 --- a/tests/Database/DatabaseEloquentBuilderTest.php +++ b/tests/Database/DatabaseEloquentBuilderTest.php @@ -836,7 +836,7 @@ public function testHasWithConstraintsWithOrWhereAndHavingInSubquery() $this->assertEquals(['larry', '90210', '90220', 'fooside dr', 29], $builder->getBindings()); } - public function testHasWithContraintsAndJoinAndHavingInSubquery() + public function testHasWithConstraintsAndJoinAndHavingInSubquery() { $model = new EloquentBuilderTestModelParentStub; $builder = $model->where('bar', 'baz');