Skip to content

Commit 5a915b3

Browse files
Improve PHPDoc return type for Eloquent's getOriginal methods with conditional typing (#55779)
1 parent ccf320a commit 5a915b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,7 @@ public function setRawAttributes(array $attributes, $sync = false)
19601960
*
19611961
* @param string|null $key
19621962
* @param mixed $default
1963-
* @return mixed|array
1963+
* @return ($key is null ? array<string, mixed> : mixed)
19641964
*/
19651965
public function getOriginal($key = null, $default = null)
19661966
{
@@ -1974,7 +1974,7 @@ public function getOriginal($key = null, $default = null)
19741974
*
19751975
* @param string|null $key
19761976
* @param mixed $default
1977-
* @return mixed|array
1977+
* @return ($key is null ? array<string, mixed> : mixed)
19781978
*/
19791979
protected function getOriginalWithoutRewindingModel($key = null, $default = null)
19801980
{
@@ -1994,7 +1994,7 @@ protected function getOriginalWithoutRewindingModel($key = null, $default = null
19941994
*
19951995
* @param string|null $key
19961996
* @param mixed $default
1997-
* @return mixed|array
1997+
* @return ($key is null ? array<string, mixed> : mixed)
19981998
*/
19991999
public function getRawOriginal($key = null, $default = null)
20002000
{

0 commit comments

Comments
 (0)