eclipse-pdt / pdt

PHP Development Tools project (PDT)
https://eclipse.org/pdt
Eclipse Public License 2.0
188 stars 46 forks source link

Add "Strict Types Declaration" Checkbox in NewPHP____Wizards #263

Closed blondak closed 7 months ago

blondak commented 7 months ago

I would like to propose the addition of a new feature in Eclipse PDT that allows developers to include the declare(strict_types = 1); statement in generated PHP classes, interfaces, and traits through respective wizards.

Details:

  1. Checkbox Addition: Introduce a new checkbox in the NewPHPClassWizard and NewPHPInterfaceWizard UIs, labeled "Add Strict Types Declaration." This checkbox will give developers the option to include the declare(strict_types = 1); statement in the generated PHP code.
  2. Code Generation Logic: Modify the code generation logic in the wizards to include the declare(strict_types = 1); statement when the "Add Strict Types Declaration" checkbox is selected.
  3. User Interface Integration Ensure that the checkbox is appropriately integrated into the UI, allowing users to easily toggle the "Add Strict Types Declaration" option during the class/interface creation process.

Benefits:

Enhanced control over the generated PHP code's strict types declaration, aligning with modern PHP development practices. Provides developers with an easy way to adopt strict typing in their classes, interfaces, and traits from the point of creation.. .