vscode-php-getters-setters icon indicating copy to clipboard operation
vscode-php-getters-setters copied to clipboard

Multiline description block, properties that starts by `_`

Open flashios09 opened this issue 6 years ago • 0 comments

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;
}

flashios09 avatar Dec 22 '19 02:12 flashios09