Fixed Typehint callable for schema manager

Xon

Well-known member
Affected version
2.3.3
Modern phpdoc (at least the variants supported by phpstan and phpstorm) supports defining a callable's expected arguments, which can provide feedback to the caller and the user on the types of arguments.

Schema manager has 3 functions which take a closure which this can be applied to:
PHP:
/**
 * @param string $tableName
 * @param \Closure(Alter): void $toApply
 */
public function alterTable($tableName, \Closure $toApply)

/**
 * @param string  $tableName
 * @param \Closure(Create): void $toApply
 */
public function createTable($tableName, \Closure $toApply)

/**
 * @param string $tableName
 * @param null|\Closure(Drop): void $toApply
 */
public function dropTable($tableName, ?\Closure $toApply = null)
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.5).

Change log:
Improve type hinting of schema manager closures
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom