2929final readonly class KanbanConfig implements Wireable
3030{
3131 public function __construct (
32- private string $ columnField = 'status ' ,
33- private array $ columnValues = [],
34- private ?array $ columnColors = null ,
35- private string $ titleField = 'title ' ,
36- private ?string $ descriptionField = null ,
37- private array $ cardAttributes = [],
38- private ?string $ orderField = null ,
39- private ?string $ cardLabel = null ,
40- private ?string $ pluralCardLabel = null ,
41- ) {}
32+ private string $ columnField = 'status ' ,
33+ private array $ columnValues = [],
34+ private array |bool |null $ columnColors = null ,
35+ private string $ titleField = 'title ' ,
36+ private ?string $ descriptionField = null ,
37+ private array $ cardAttributes = [],
38+ private ?string $ orderField = null ,
39+ private ?string $ cardLabel = null ,
40+ private ?string $ pluralCardLabel = null ,
41+ )
42+ {
43+ }
4244
4345 /**
4446 * Get the field that stores the column value.
@@ -63,9 +65,9 @@ public function getColumnValues(): array
6365 /**
6466 * Get the colors for each column.
6567 *
66- * @return array<string, string> |null Map of column values to color codes, or null if not set
68+ * @return array|bool |null Map of column values to color codes, or null if not set
6769 */
68- public function getColumnColors (): ? array
70+ public function getColumnColors (): array | bool | null
6971 {
7072 return $ this ->columnColors ;
7173 }
@@ -133,8 +135,8 @@ public function getPluralCardLabel(): ?string
133135 /**
134136 * Get the default form schema for creating cards.
135137 *
136- * @param string $titleField The field name used for card titles
137- * @param string|null $descriptionField Optional field name for card descriptions
138+ * @param string $titleField The field name used for card titles
139+ * @param string|null $descriptionField Optional field name for card descriptions
138140 * @return array<\Filament\Forms\Components\Component> The default form schema
139141 */
140142 public static function getDefaultCreateFormSchema (string $ titleField , ?string $ descriptionField ): array
@@ -155,18 +157,19 @@ public static function getDefaultCreateFormSchema(string $titleField, ?string $d
155157 /**
156158 * Get the default form schema for editing cards.
157159 *
158- * @param string $titleField The field name used for card titles
159- * @param string|null $descriptionField Optional field name for card descriptions
160- * @param string $columnField The field name that determines which column a card belongs to
161- * @param array<string, string> $columnValues Available column values with their labels
160+ * @param string $titleField The field name used for card titles
161+ * @param string|null $descriptionField Optional field name for card descriptions
162+ * @param string $columnField The field name that determines which column a card belongs to
163+ * @param array<string, string> $columnValues Available column values with their labels
162164 * @return array<\Filament\Forms\Components\Component> The default form schema
163165 */
164166 public static function getDefaultEditFormSchema (
165- string $ titleField ,
167+ string $ titleField ,
166168 ?string $ descriptionField ,
167- string $ columnField ,
168- array $ columnValues
169- ): array {
169+ string $ columnField ,
170+ array $ columnValues
171+ ): array
172+ {
170173 $ schema = [
171174 TextInput::make ($ titleField )
172175 ->required ()
@@ -192,21 +195,21 @@ public static function getDefaultEditFormSchema(
192195 * For example, `withColumnField('status')` will create a new configuration
193196 * with the columnField property set to 'status'.
194197 *
195- * @param string $method The method name
196- * @param array $arguments The method arguments
198+ * @param string $method The method name
199+ * @param array $arguments The method arguments
197200 * @return self A new instance with the updated property
198201 *
199202 * @throws \BadMethodCallException If the method is not a valid with* method or targets a non-existent property
200203 */
201204 public function __call (string $ method , array $ arguments ): self
202205 {
203- if (! Str::startsWith ($ method , 'with ' )) {
206+ if (!Str::startsWith ($ method , 'with ' )) {
204207 throw new \BadMethodCallException ("Method {$ method } not found " );
205208 }
206209
207210 $ property = lcfirst (Str::after ($ method , 'with ' ));
208211
209- if (! property_exists ($ this , $ property )) {
212+ if (!property_exists ($ this , $ property )) {
210213 throw new \BadMethodCallException ("Property {$ property } not found " );
211214 }
212215
@@ -216,7 +219,7 @@ public function __call(string $method, array $arguments): self
216219 /**
217220 * Create a new configuration with the specified properties updated.
218221 *
219- * @param array<string, mixed> $properties The properties to update
222+ * @param array<string, mixed> $properties The properties to update
220223 * @return self A new instance with the updated properties
221224 */
222225 public function with (array $ properties ): self
0 commit comments