Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ might be to handle switch and goto labels differently."
(defun php-lineup-cascaded-calls (langelem)
"Line up chained methods using `c-lineup-cascaded-calls',
but only if the setting is enabled"
(if php-lineup-cascaded-calls
(when php-mode-lineup-cascaded-calls
(c-lineup-cascaded-calls langelem)))

(c-add-style
Expand All @@ -661,6 +661,7 @@ but only if the setting is enabled"
(tab-width . ,(default-value 'tab-width))
(fill-column . ,(default-value 'fill-column))
(show-trailing-whitespace . ,(default-value 'show-trailing-whitespace))
(php-mode-lineup-cascaded-calls . t)
(php-style-delete-trailing-whitespace . nil)))

(defun php-enable-default-coding-style ()
Expand All @@ -687,6 +688,7 @@ but only if the setting is enabled"
(tab-width . 2)
(fill-column . 78)
(show-trailing-whitespace . t)
(php-mode-lineup-cascaded-calls . nil)
(php-style-delete-trailing-whitespace . t)))

(defun php-enable-drupal-coding-style ()
Expand All @@ -713,6 +715,7 @@ but only if the setting is enabled"
'("php"
(c-offsets-alist . ((statement-cont . php-lineup-hanging-semicolon)))
(c-indent-comments-syntactically-p . t)
(php-mode-lineup-cascaded-calls . nil)
(fill-column . 78)))

(defun php-enable-symfony2-coding-style ()
Expand All @@ -721,12 +724,13 @@ but only if the setting is enabled"
(php-set-style "symfony2"))

(c-add-style
"psr2"
"psr2" ; PSR-2 / PSR-12
'("php"
(c-offsets-alist . ((statement-cont . +)))
(c-indent-comments-syntactically-p . t)
(fill-column . 78)
(show-trailing-whitespace . t)
(php-mode-lineup-cascaded-calls . nil)
(php-style-delete-trailing-whitespace . t)))

(defun php-enable-psr2-coding-style ()
Expand Down