Cast `$length` to an actual `int` in TLengthDatabaseTableColumn::length()
authormutec <mysterycode@mysterycode.de>
Sun, 28 Nov 2021 10:49:39 +0000 (11:49 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 7 Dec 2021 14:02:46 +0000 (15:02 +0100)
commit8b00a2565d6e23681f7c24840f6515023e1ed473
treea3ea9b46a551bf616bf309c5395364dfa601c627
parentaea2563dd5b41a425dd31b0e6e84d6171b75b616
Cast `$length` to an actual `int` in TLengthDatabaseTableColumn::length()

When the object is being initialized from the existing structure in the
database, the length will be passed as a string and was previously stored as-is
within the object.

This violates the existing PHPDoc type declaration and breaks consumers that
use a strict comparison (`===`) to check the length, notably
`YearDatabaseTableColumn`.

Fix this by casting the passed parameter to an actual `int`. This should be
adjusted to a proper parameter type in a future version.

Resolves #4594

[Tim: Adjusted commit message]
wcfsetup/install/files/lib/system/database/table/column/TLengthDatabaseTableColumn.class.php