Skip to content
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

Add generic information for child admins #6882

Merged
merged 1 commit into from
Feb 21, 2021
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/Admin/AbstractAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,8 @@ public function buildSideMenu($action, ?AdminInterface $childAdmin = null)
* @param string $action
*
* @return ItemInterface
*
* @phpstan-param AdminInterface<object>|null $childAdmin
*/
public function getSideMenu($action, ?AdminInterface $childAdmin = null)
{
Expand Down Expand Up @@ -3023,6 +3025,8 @@ protected function configureBatchActions($actions)
* NEXT_MAJOR: remove this method.
*
* @deprecated Use configureTabMenu instead
*
* @phpstan-param AdminInterface<object>|null $childAdmin
*/
protected function configureSideMenu(ItemInterface $menu, string $action, ?AdminInterface $childAdmin = null)
{
Expand All @@ -3032,6 +3036,8 @@ protected function configureSideMenu(ItemInterface $menu, string $action, ?Admin
* Configures the tab menu in your admin.
*
* @param string $action
*
* @phpstan-param AdminInterface<object>|null $childAdmin
*/
protected function configureTabMenu(ItemInterface $menu, $action, ?AdminInterface $childAdmin = null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/AdminExtensionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function configureRoutes(AdminInterface $admin, RouteCollection $collecti
* @return void
*
* @phpstan-param AdminInterface<T> $admin
* @phpstan-param AdminInterface<T>|null $childAdmin
* @phpstan-param AdminInterface<object>|null $childAdmin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The admin and child admin can mange different types, so object is more accurate here.

*
* @deprecated
*/
Expand All @@ -94,7 +94,7 @@ public function configureSideMenu(
* @return void
*
* @phpstan-param AdminInterface<T> $admin
* @phpstan-param AdminInterface<T>|null $childAdmin
* @phpstan-param AdminInterface<object>|null $childAdmin
*/
public function configureTabMenu(
AdminInterface $admin,
Expand Down
4 changes: 4 additions & 0 deletions src/Admin/MenuBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ interface MenuBuilderInterface
* @return ItemInterface|bool
*
* @deprecated Use buildTabMenu instead
*
* @phpstan-param AdminInterface<object>|null $childAdmin
*/
public function buildSideMenu($action, ?AdminInterface $childAdmin = null);

Expand All @@ -39,6 +41,8 @@ public function buildSideMenu($action, ?AdminInterface $childAdmin = null);
* @param string $action
*
* @return ItemInterface|bool
*
* @phpstan-param AdminInterface<object>|null $childAdmin
*/
public function buildTabMenu($action, ?AdminInterface $childAdmin = null);
}