Skip to content

Commit 53a6172

Browse files
committed
Merge branch '7.x'
2 parents 8082d4b + 50efe09 commit 53a6172

File tree

6 files changed

+39
-8
lines changed

6 files changed

+39
-8
lines changed

src/Illuminate/Cache/DynamoDbStore.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,6 @@ public function putMany(array $values, $seconds)
253253
* @param mixed $value
254254
* @param int $seconds
255255
* @return bool
256-
*
257-
* @throws \Aws\DynamoDb\Exception\DynamoDbException
258256
*/
259257
public function add($key, $value, $seconds)
260258
{
@@ -300,8 +298,6 @@ public function add($key, $value, $seconds)
300298
* @param string $key
301299
* @param mixed $value
302300
* @return int|bool
303-
*
304-
* @throws \Aws\DynamoDb\Exception\DynamoDbException
305301
*/
306302
public function increment($key, $value = 1)
307303
{
@@ -347,8 +343,6 @@ public function increment($key, $value = 1)
347343
* @param string $key
348344
* @param mixed $value
349345
* @return int|bool
350-
*
351-
* @throws \Aws\DynamoDb\Exception\DynamoDbException
352346
*/
353347
public function decrement($key, $value = 1)
354348
{

src/Illuminate/Filesystem/Filesystem.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Contracts\Filesystem\FileNotFoundException;
88
use Illuminate\Macroable\Macroable;
99
use Symfony\Component\Finder\Finder;
10+
use Symfony\Component\Mime\MimeTypes;
1011

1112
class Filesystem
1213
{
@@ -312,6 +313,17 @@ public function extension($path)
312313
return pathinfo($path, PATHINFO_EXTENSION);
313314
}
314315

316+
/**
317+
* Guess the file extension from the mime-type of a given file.
318+
*
319+
* @param string $path
320+
* @return string|null
321+
*/
322+
public function guessExtension($path)
323+
{
324+
return (new MimeTypes)->getExtensions($this->mimeType($path))[0] ?? null;
325+
}
326+
315327
/**
316328
* Get the file type of a given file.
317329
*

src/Illuminate/Http/Client/Request.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ public function withData(array $data)
244244
return $this;
245245
}
246246

247+
/**
248+
* Get the underlying PSR compliant request instance.
249+
*
250+
* @return \Psr\Http\Message\RequestInterface
251+
*/
252+
public function toPsrRequest()
253+
{
254+
return $this->request;
255+
}
256+
247257
/**
248258
* Determine if the given offset exists.
249259
*

src/Illuminate/Pagination/resources/views/tailwind.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">{{ $page }}</span>
7272
</span>
7373
@else
74-
<a href="{{ $url }}" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150" aria-label="{{ __('pagination.goto_page', ['page' => $page]) }}">
74+
<a href="{{ $url }}" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
7575
{{ $page }}
7676
</a>
7777
@endif

src/Illuminate/Support/MessageBag.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ public function add($key, $message)
6767
return $this;
6868
}
6969

70+
/**
71+
* Add a message to the message bag if the given conditional is "true".
72+
*
73+
* @param bool $boolean
74+
* @param string $key
75+
* @param string $message
76+
* @return $this
77+
*/
78+
public function addIf($boolean, $key, $message)
79+
{
80+
return $boolean ? $this->add($key, $message) : $this;
81+
}
82+
7083
/**
7184
* Determine if a key and message combination already exists.
7285
*

src/Illuminate/Validation/Validator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,9 @@ protected function validateUsingCustomRule($attribute, $value, $rule)
697697
if (! $rule->passes($attribute, $value)) {
698698
$this->failedRules[$attribute][get_class($rule)] = [];
699699

700-
$messages = $rule->message() ? (array) $rule->message() : [get_class($rule)];
700+
$messages = $rule->message();
701+
702+
$messages = $messages ? (array) $messages : [get_class($rule)];
701703

702704
foreach ($messages as $message) {
703705
$this->messages->add($attribute, $this->makeReplacements(

0 commit comments

Comments
 (0)