Skip to content

Conversation

alipowerful7
Copy link
Contributor

add return null in this function

    /**
     * Get the date format for an attribute if it has one.
     *
     * @param  string  $attribute
     * @return string|null
     */
    protected function getDateFormat($attribute)
    {
        if ($result = $this->getRule($attribute, 'DateFormat')) {
            return $result[1][0];
        }

        return null;
    }

and add |null in this docblock

    /**
     * Get the date timestamp.
     *
     * @param  mixed  $value
     * @return int|null
     */
    protected function getDateTimestamp($value)
    {
        $date = is_null($value) ? null : $this->getDateTime($value);

        return $date?->getTimestamp();
    }

@taylorotwell taylorotwell merged commit 6b5f87d into laravel:12.x Oct 3, 2025
63 checks passed
@alipowerful7 alipowerful7 deleted the refactor/add-return-type branch October 3, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants