DocBlocks

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 36
Joined: Mon Sep 01, 2014 10:54 pm

Re: DocBlocks

Post by Kailey »

Agree on all points except #2.

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: DocBlocks

Post by 3Di »

Marc wrote: Wed Oct 23, 2019 7:22 pm I'm also for the gap to separate different types.

@3Di: The @access specifier is still a legacy from the old days when this couldn't be properly defined and is no longer needed (and therefore should also no longer be used).
Ah, good to know thx.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

User avatar
martti
Registered User
Posts: 45
Joined: Wed Aug 20, 2014 4:50 pm
Location: Belgium

Re: DocBlocks

Post by martti »

As PHP 7.1 is the lowest supported version for phpBB 3.3.x I'm for setting all the parameter and return types directly in the code and then for removing all DocBlocks that don't add extra value or information (or even could be misleading when they go out of sync with the code).

https://localheinz.com/blog/2018/05/06/ ... docblocks/

Also, you can make phpBB strictly typed by adding declare(strict_types=1); at the top of all PHP files. That will huge a benefit in making the code solid and clear. Errors are then thrown on type violations.

https://dev.to/robdwaller/how-php-type- ... -work-1mm5

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: DocBlocks

Post by DavidIQ »

That first one is pretty much an opinion piece. Dev team can decide on how docblocks are used moving forward though. Probably wouldn't do that second one until at least 5.0 way in the future. It would be very disruptive to current development and doesn't really buy us much.
Image

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: DocBlocks

Post by JoshyPHP »

You can use strict_types on new files while preserving compatibility with the less type-aware parts of the codebase.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: DocBlocks

Post by DavidIQ »

Ah that's true 👍🏼
Image

Post Reply