Skip to content

Improve psalm annotations to make it easier to use in userland #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/Column/DataColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
*
* A simple data column definition refers to an attribute in the GridView's data provider.
*
* @psalm-type ContentCallable = callable(array|object, DataContext): string|Stringable|int|float
* @template TData as array|object
* @psalm-type FilterEmptyCallable = callable(mixed $value): bool
* @psalm-type BodyAttributesCallable = callable(array|object, DataContext): array
*/
final class DataColumn implements ColumnInterface
{
/**
* @var callable|float|int|string|Stringable|null
* @psalm-var string|Stringable|int|float|ContentCallable|null
* @psalm-var string|Stringable|int|float|(callable(TData, DataContext): (string|Stringable|int|float))|null
*/
public readonly mixed $content;

Expand Down Expand Up @@ -118,8 +117,8 @@ final class DataColumn implements ColumnInterface
* @param string|null $headerClass Additional CSS class for the header cell.
* @param string|null $bodyClass Additional CSS class for the body cells.
*
* @psalm-param array|BodyAttributesCallable $bodyAttributes
* @psalm-param string|Stringable|int|float|ContentCallable|null $content
* @psalm-param array|(callable(TData, DataContext): array) $bodyAttributes
* @psalm-param string|Stringable|int|float|(callable(TData, DataContext): (string|Stringable|int|float))|null $content
* @psalm-param bool|array<array-key,string|array<array-key,string>>|FilterWidget $filter
* @psalm-param RuleInterface[]|RuleInterface|null $filterValidation
* @psalm-param bool|FilterEmptyCallable|null $filterEmpty
Expand Down
Loading