Require the `$name` parameter of DatabaseTableIndex::create() to be set
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 5 Oct 2022 08:07:09 +0000 (10:07 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 5 Oct 2022 11:36:28 +0000 (13:36 +0200)
An empty name may still be provided and will result in an autogenerated name,
but by forcing the parameter to be set, developers are likely to specify a
proper name.

see #4505

wcfsetup/install/files/lib/system/database/table/index/DatabaseTableIndex.class.php

index b0f14a6be1e84ef437d5fbe5cafc218cbfe861bb..b92fb6b86819805bcd6e387278ea5934ef278753 100644 (file)
@@ -169,7 +169,7 @@ final class DatabaseTableIndex
     /**
      * Returns a `DatabaseTableIndex` object with the given name.
      */
-    public static function create(string $name = ''): self
+    public static function create(string $name): self
     {
         return new self($name);
     }