Skip to content

Manage PHP class properties extension for Visual Studio Code

License

Notifications You must be signed in to change notification settings

kotfire/vscode-php-add-property

Repository files navigation

Version Rating Installs

PHP Add Property

Visual Code Studio extension to manage PHP class properties

Support my work

Github sponsors Buy me a tea Buy the world a tree

Features

Add a property

Add a property demo

Add existing properties

It gets the property type from the docblock!

Add existing properties demo

Remove a property

Remove a property demo

Rename a property

Remove a property demo

Change property type

Remove a property demo

Insert constructor

Automatically insert a constructor if it does not exist.

Insert constructor demo

Multi-line constructor support

Multi-line constructor demo

Highly customizable

Highly customizable demo

Extension Settings

This extension contributes the following settings:

  • phpAddProperty.property.visibility.choose: Specifies whether to choose property visibility when inserting
  • phpAddProperty.property.visibility.default: Specifies the default property visibility
  • phpAddProperty.property.stopToImport: Specifies whether to stop after typing the type to refer to an external fully qualified name with an alias or importing
  • phpAddProperty.property.docblock.add: Specifies whether to add a docblock @var type to the property
  • phpAddProperty.property.docblock.multiline: Specifies whether to use a multiline docblock
  • phpAddProperty.property.docblock.withParameter: Specifies whether to add the docblock @var type to the property and the constructor parameter type at the same time
  • phpAddProperty.property.docblock.stopToImport: Specifies whether to stop after typing the type to refer to an external fully qualified name with an alias or importing
  • phpAddProperty.property.types: Specifies whether to enable PHP 7.4+ typed properties More info
  • phpAddProperty.constructor.docblock.enable: Specifies whether to add/update the docblock to the constructor
  • phpAddProperty.constructor.docblock.withParameter: Specifies whether to add the docblock @param type together with the constructor parameter type
  • phpAddProperty.constructor.docblock.stopToImport: Specifies whether to stop after typing the @param type to refer to an external fully qualified name with an alias or importing
  • phpAddProperty.constructor.docblock.stopForDescription: Specifies whether to stop after typing the @var type to add a description
  • phpAddProperty.constructor.visibility.choose: Specifies whether to choose constructor visibility when inserting
  • phpAddProperty.constructor.visibility.default: Specifies the default constructor visibility
  • phpAddProperty.constructor.breakIntoMultilineIfLengthExceeded.enabled: Specifies whether to break the constructor into multiple lines if the given line length is exceeded
  • phpAddProperty.constructor.breakIntoMultilineIfLengthExceeded.maxLineLength: Specifies the maximum line length before using a multiline constructor
  • phpAddProperty.showMessagesOnStatusBar: Specifies whether to show messages on status bar instead of notification box
  • phpAddProperty.contextMenuOptions.enable: Specifies whether to show the context menu options
  • phpAddProperty.contextMenuOptions.addProperty: Specifies whether to show the add property command in the context menu options
  • phpAddProperty.contextMenuOptions.appendProperty: Specifies whether to show the append property command in the context menu options
  • phpAddProperty.contextMenuOptions.renameProperty: Specifies whether to show the rename property command in the context menu options
  • phpAddProperty.contextMenuOptions.changePropertyType: Specifies whether to show the change property type command in the context menu options
  • phpAddProperty.contextMenuOptions.removeProperty: Specifies whether to show the remove property command in the context menu options
  • phpAddProperty.contextMenuOptions.breakConstructorIntoMultiline: Specifies whether to show the break constructor into multiline command in the context menu options
  • phpAddProperty.showVersionUpdates: Specifies whether to show What's New after upgrading to a new version