Skip to content

Wrong method return documentation for DB::transaction in DB Facade #53526

@dragonofmercy

Description

@dragonofmercy

Laravel Version

11.31

PHP Version

8.2

Database Driver & Version

No response

Description

DB::transaction method documentation dosen't match Illuminate/Database/Concerns/ManagesTransactions.php

In Facade

/**
 * @method static void transaction(\Closure $callback, int $attempts = 1)
 */

In trait ManagesTransactions

/**
 * @template TReturn of mixed
 *
 * Execute a Closure within a transaction.
 *
 * @param  (\Closure(static): TReturn)  $callback
 * @param  int  $attempts
 * @return TReturn
 *
 * @throws \Throwable
 */

Steps To Reproduce

Use DB::transaction in IDE with return will make an inspection error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions