vscode-php-getters-setters
vscode-php-getters-setters copied to clipboard
Multiline description block, properties that starts by `_`
Fix multiline getter/setter description block:
Example:
/**
* The layout for the View, `'default'` by default.
*
* ### Pattern
* `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @var string
*/
protected $layout = 'default';
Before:
/**
* Get `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @return string
*/
public function getLayout()
{
return $this->layout;
}
After:
/**
* Get the layout for the View, `'default'` by default.
*
* ### Pattern
* `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @return string
*/
public function getLayout()
{
return $this->layout;
}
Fix generatedMethodName for properties that starts by _
Example:
/**
* The layout for the View, `'default'` by default.
*
* ### Pattern
* `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @var string
*/
protected $_layout = 'default';
Before:
/**
* Get `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @return string
*/
public function get_layout()
{
return $this->_layout;
}
After:
/**
* Get the layout for the View, `'default'` by default.
*
* ### Pattern
* `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @return string
*/
public function getLayout()
{
return $this->_layout;
}
Fix setter argument name for properties that starts by _
Example:
/**
* The layout for the View, `'default'` by default.
*
* ### Pattern
* `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @var string
*/
protected $_layout = 'default';
Before:
/**
* Set the layout for the View, `'default'` by default.
*
* ### Pattern
* `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @param string $_layout The layout for the View, `'default'` by default.
* @return self
*/
public function setLayout(string $_layout)
{
$this->_layout = $_layout;
return $this;
}
After:
/**
* Set the layout for the View, `'default'` by default.
*
* ### Pattern
* `src/Template/Layout/{$_layoutPath}/{$_layout}.ctp`
*
* @param string $layout The layout for the View, `'default'` by default.
* @return self
*/
public function setLayout(string $layout)
{
$this->_layout = $layout;
return $this;
}