Skip to content

Fix: PHPStan errors in Datagrid and Filter classes#1285

Open
radimvaculik wants to merge 1 commit into
masterfrom
fix/phpstan-errors
Open

Fix: PHPStan errors in Datagrid and Filter classes#1285
radimvaculik wants to merge 1 commit into
masterfrom
fix/phpstan-errors

Conversation

@radimvaculik
Copy link
Copy Markdown
Member

Summary

  • Use Nette\Application\UI\Presenter for lookupPath() in Datagrid::getSortableParentPath()Nette\Application\IPresenter is just a marker interface (not an IComponent), so it doesn't satisfy class-string<IComponent>.
  • Remove redundant instanceof Form checks in FilterSelect and FilterMultiSelectContainer::lookup(Form::class) already guarantees the return type via its conditional return type.

Test plan

  • make phpstan[OK] No errors

Use Nette\Application\UI\Presenter for lookupPath (IPresenter is not an IComponent) and remove redundant Form instanceof checks where lookup() already guarantees the type.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.86%. Comparing base (e5faff0) to head (7f579a3).

Files with missing lines Patch % Lines
src/Datagrid.php 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1285      +/-   ##
==========================================
+ Coverage   46.79%   46.86%   +0.06%     
==========================================
  Files          53       53              
  Lines        2729     2725       -4     
==========================================
  Hits         1277     1277              
+ Misses       1452     1448       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants