Sonataadminbundle: [Next Major] Close API

Created on 12 Dec 2019  ยท  8Comments  ยท  Source: sonata-project/SonataAdminBundle

  • [ ] Add final modifier
  • [ ] Reduce visiblity to private
  • [ ] Add type hints
keep major

All 8 comments

Now that 7.1 is EOL (https://secure.php.net/supported-versions.php), maybe we should bump to 7.2 add _parameter_ type declarations in a new minor? If we consider current docblocks as a contract?

๐Ÿ‘Ž For adding parameter types. There is a reason why symfony won't do this in a major release...

๐Ÿ‘ For adding return types

๐Ÿ‘ for adding return types to final classes, but not otherwise, and not to interfaces either: https://3v4l.org/KLvG9

:-1: For adding parameter types. There is a reason why symfony won't do this in a major release...

You mean a minor release, and what's the reason?

๐Ÿ‘ for adding return types to final classes, but not otherwise, and not to interfaces either: https://3v4l.org/KLvG9

๐Ÿ‘ for full return / parameter types to final classes

You mean a minor release, and what's the reason?

If we add a parameter type and someone uses an other type hint, it would break:
https://3v4l.org/XBfik

Butโ€ฆ they can't use a type declaration if we don't, that would break the LSP, and php rightfully forbids that: https://3v4l.org/eiigE

Also, we can add type declarations to private methods.

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

As explained here some interface are required/useful if we want to add final modifier to some class.

  • PoolInterface
  • MapperInterface
  • GroupMapperInterface
  • DatagridMapperInterface
  • ListMapperInterface
  • FormMapperInterface
  • ShowMapperInterface
  • AdminObjectAclDataInterface
  • AdminObjectAclManipulatorInterface

And maybe SearchHandlerInterface.

Was this page helpful?
0 / 5 - 0 ratings