Skip to content

Commit

Permalink
Add dynamic return type seed support
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 17, 2021
1 parent 7542305 commit 49f8b6e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 77 deletions.
31 changes: 31 additions & 0 deletions phpstan-ext.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
# move to atk4/core later (or at least atk4/data)
-
factory: Mvorisek\Atk4\Hintable\Phpstan\SeedDmrtExtension(Atk4\Core\Factory, factory, 0)
tags:
- phpstan.broker.dynamicStaticMethodReturnTypeExtension

-
factory: Mvorisek\Atk4\Hintable\Phpstan\SeedDmrtExtension(Atk4\Ui\AbstractView, add, 0)
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
factory: Mvorisek\Atk4\Hintable\Phpstan\SeedDmrtExtension(Atk4\Ui\Columns, addColumn, 0)
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
factory: Mvorisek\Atk4\Hintable\Phpstan\SeedDmrtExtension(Atk4\Ui\Form, addControl, 1)
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
factory: Mvorisek\Atk4\Hintable\Phpstan\SeedDmrtExtension(Atk4\Ui\Form, controlFactory, 1)
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
factory: Mvorisek\Atk4\Hintable\Phpstan\SeedDmrtExtension(Atk4\Ui\Grid, addColumn, 1)
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
factory: Mvorisek\Atk4\Hintable\Phpstan\SeedDmrtExtension(Atk4\Ui\Table, addColumn, 1)
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
84 changes: 7 additions & 77 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
includes:
# remove once https://github.com/phpstan/extension-installer/pull/37 is merged
- vendor/mvorisek/atk4-hintable/phpstan-ext.neon
# remove once https://github.com/phpstan/extension-installer/issues/36 is fixed
- phpstan-ext.neon

parameters:
level: 6
Expand Down Expand Up @@ -51,10 +53,13 @@ parameters:
message: '~^Call to an undefined method Atk4\\Ui\\View::addFields\(\)\.$~'
-
path: 'demos/form-control/calendar.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Control::addAction\(\)\.$~'
message: '~^Call to an undefined method Atk4\\Ui\\JsExpression::setDate\(\)\.$~'
-
path: 'demos/form-control/calendar.php'
message: '~^Call to an undefined method Atk4\\Ui\\JsExpression::open\(\)\.$~'
-
path: 'demos/form-control/calendar.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Control::getJsInstance\(\)\.$~'
message: '~^Call to an undefined method Atk4\\Ui\\JsExpression::clear\(\)\.$~'
-
path: 'demos/form-control/input2.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Control::onDelete\(\)\.$~'
Expand All @@ -64,21 +69,6 @@ parameters:
-
path: 'demos/form-control/multiline.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Layout::addColumn\(\)\.$~'
-
path: 'demos/form-control/upload.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Control::onDelete\(\)\.$~'
-
path: 'demos/form-control/upload.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Control::clearThumbnail\(\)\.$~'
-
path: 'demos/form-control/upload.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Control::onUpload\(\)\.$~'
-
path: 'demos/form-control/upload.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Control::setThumbnailSrc\(\)\.$~'
-
path: 'demos/form-control/upload.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Control::setFileId\(\)\.$~'
-
path: 'demos/form/form-section-accordion.php'
message: '~^Call to an undefined method Atk4\\Ui\\Form\\Layout::addSection\(\)\.$~'
Expand Down Expand Up @@ -139,30 +129,18 @@ parameters:
-
path: 'src/CallbackLater.php'
message: '~^Method Atk4\\Ui\\CallbackLater::set\(\) should return mixed but return statement is missing\.$~'
-
path: 'src/Card.php'
message: '~^Call to an undefined method Atk4\\Ui\\AbstractView::setAction\(\)\.$~'
-
path: 'src/Card.php'
message: '~^Call to an undefined method Atk4\\Ui\\View::addFields\(\)\.$~'
-
path: 'src/Card.php'
message: '~^Call to an undefined method Atk4\\Ui\\View::addDescription\(\)\.$~'
-
path: 'src/CardDeck.php'
message: '~^Access to an undefined property Atk4\\Ui\\AbstractView::\$reload\.$~'
-
path: 'src/CardDeck.php'
message: '~^Access to an undefined property Atk4\\Ui\\AbstractView::\$queryArg\.$~'
-
path: 'src/CardDeck.php'
message: '~^Call to an undefined method Atk4\\Ui\\AbstractView::addClass\(\)\.$~'
-
path: 'src/CardDeck.php'
message: '~^Call to an undefined method Atk4\\Ui\\AbstractView::on\(\)\.$~'
-
path: 'src/CardSection.php'
message: '~^Call to an undefined method Atk4\\Ui\\AbstractView::addClass\(\)\.$~'
-
path: 'src/Crud.php'
message: '~^Call to an undefined method Atk4\\Ui\\UserAction\\JsExecutorInterface::stickyGet\(\)\.$~'
Expand Down Expand Up @@ -196,9 +174,6 @@ parameters:
-
path: 'src/JsVueService.php'
message: '~^Call to an undefined method Atk4\\Ui\\JsChain::useComponent\(\)\.$~'
-
path: 'src/Menu.php'
message: '~^Call to an undefined method Atk4\\Ui\\AbstractView::setElement\(\)\.$~'
-
path: 'src/Menu.php'
message: '~^Call to an undefined method Atk4\\Ui\\AbstractView::addClass\(\)\.$~'
Expand All @@ -223,9 +198,6 @@ parameters:
-
path: 'src/Panel/Right.php'
message: '~^Call to an undefined method Atk4\\Ui\\JsExpression::addPanel\(\)\.$~'
-
path: 'src/Table/Column.php'
message: '~^Call to an undefined method Atk4\\Ui\\AbstractView::setHoverable\(\)\.$~'
-
path: 'src/Table/Column.php'
message: '~^Call to an undefined method Atk4\\Ui\\JsCallback::onSelectItem\(\)\.$~'
Expand Down Expand Up @@ -298,27 +270,12 @@ parameters:
-
path: 'src/App.php'
message: '~^Property Atk4\\Ui\\App::\$html \(Atk4\\Ui\\View\) does not accept null\.$~'
-
path: 'src/App.php'
message: '~^Property Atk4\\Ui\\App::\$layout \(Atk4\\Ui\\Layout\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Card.php'
message: '~^Property Atk4\\Ui\\Card::\$section \(Atk4\\Ui\\CardSection\|null\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Card.php'
message: '~^Method Atk4\\Ui\\Card::getSection\(\) should return Atk4\\Ui\\View\|null but returns Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Card.php'
message: '~^Method Atk4\\Ui\\Card::addContent\(\) should return Atk4\\Ui\\View\|null but returns Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Card.php'
message: '~^Method Atk4\\Ui\\Card::addExtraContent\(\) should return Atk4\\Ui\\View but returns Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Card.php'
message: '~^Method Atk4\\Ui\\Card::addImage\(\) should return Atk4\\Ui\\View\|null but returns Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Card.php'
message: '~^Method Atk4\\Ui\\Card::addButton\(\) should return Atk4\\Ui\\View\|null but returns Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/CardDeck.php'
message: '~^Property Atk4\\Ui\\CardDeck::\$container \(Atk4\\Ui\\View\|null\) does not accept default value of type array\<int\|string, class-string\|string\>\.$~'
Expand All @@ -328,21 +285,9 @@ parameters:
-
path: 'src/CardDeck.php'
message: '~^Property Atk4\\Ui\\CardDeck::\$paginator \(Atk4\\Ui\\Paginator\|null\) does not accept default value of type array\<int, string\>\.$~'
-
path: 'src/CardDeck.php'
message: '~^Property Atk4\\Ui\\CardDeck::\$container \(Atk4\\Ui\\View\|null\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/CardDeck.php'
message: '~^Property Atk4\\Ui\\CardDeck::\$cardHolder \(Atk4\\Ui\\View\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/CardDeck.php'
message: '~^Property Atk4\\Ui\\CardDeck::\$menu \(array\|null\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/CardDeck.php'
message: '~^Property Atk4\\Ui\\CardDeck::\$search \(array\|Atk4\\Ui\\Component\\ItemSearch\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/CardDeck.php'
message: '~^Property Atk4\\Ui\\CardDeck::\$paginator \(Atk4\\Ui\\Paginator\|null\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Columns.php'
message: '~^Property Atk4\\Ui\\Columns::\$calculated_width \(int\) does not accept false\.$~'
Expand Down Expand Up @@ -418,27 +363,12 @@ parameters:
-
path: 'src/Grid.php'
message: '~^Property Atk4\\Ui\\Grid::\$actionButtonsDecorator \(string\) does not accept default value of type array\<int, string\>\.$~'
-
path: 'src/Grid.php'
message: '~^Property Atk4\\Ui\\Grid::\$menu \(Atk4\\Ui\\Menu\|false\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Grid.php'
message: '~^Property Atk4\\Ui\\Grid::\$table \(Atk4\\Ui\\Table\|false\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Grid.php'
message: '~^Property Atk4\\Ui\\Grid::\$paginator \(Atk4\\Ui\\Paginator\|false\) does not accept Atk4\\Ui\\AbstractView\.$~'
-
path: 'src/Grid.php'
message: '~^Property Atk4\\Ui\\Grid::\$paginator \(Atk4\\Ui\\Paginator\|false\) does not accept null\.$~'
-
path: 'src/Grid.php'
message: '~^Property Atk4\\Ui\\Grid::\$actionButtons \(Atk4\\Ui\\Table\\Column\\ActionButtons\) does not accept Atk4\\Ui\\Table\\Column\.$~'
-
path: 'src/Grid.php'
message: '~^Property Atk4\\Ui\\Grid::\$selection \(Atk4\\Ui\\Table\\Column\\Checkbox\) does not accept Atk4\\Ui\\Table\\Column\.$~'
-
path: 'src/Grid.php'
message: '~^Method Atk4\\Ui\\Grid::addSelection\(\) should return Atk4\\Ui\\Table\\Column\\Checkbox but returns Atk4\\Ui\\Table\\Column\.$~'
-
path: 'src/Header.php'
message: '~^Property Atk4\\Ui\\Header::\$icon \(string\) does not accept Atk4\\Ui\\Icon\.$~'
Expand Down

0 comments on commit 49f8b6e

Please sign in to comment.