File tree 3 files changed +26
-2
lines changed
3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -636,8 +636,11 @@ might be to handle switch and goto labels differently."
636
636
(defun php-lineup-cascaded-calls (langelem )
637
637
" Line up chained methods using `c-lineup-cascaded-calls' ,
638
638
but only if the setting is enabled"
639
- (when php-mode-lineup-cascaded-calls
640
- (c-lineup-cascaded-calls langelem)))
639
+ (if php-mode-lineup-cascaded-calls
640
+ (c-lineup-cascaded-calls langelem)
641
+ (save-excursion
642
+ (beginning-of-line )
643
+ (if (looking-at-p " \\ s-*->" ) '+ nil ))))
641
644
642
645
(c-add-style
643
646
" php"
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ object = new DateTime ();
4
+
5
+ $ object ->something ()
6
+ ->something (); // ###php-mode-test### ((indent 4))
7
+
8
+ var_dump (
9
+ $ object ->something () // ###php-mode-test### ((indent 4))
10
+ ->something (), // ###php-mode-test### ((indent 8))
11
+ ); // ###php-mode-test### ((indent 0))
12
+
13
+ $ arr = [
14
+ $ object ->something () // ###php-mode-test### ((indent 4))
15
+ /* comment */ ->something () // ###php-mode-test### ((indent 4))
16
+ ->something (), // ###php-mode-test### ((indent 8))
17
+ ]; // ###php-mode-test### ((indent 0))
Original file line number Diff line number Diff line change @@ -645,6 +645,10 @@ Meant for `php-mode-test-issue-503'."
645
645
(goto-char (point-min ))
646
646
(should (eq (php-mode-test-in-function-p nil ) nil ))))
647
647
648
+ (ert-deftest php-mode-test-issue-623 ()
649
+ " Proper alignment object -> accessor."
650
+ (with-php-mode-test (" indent/issue-623.php" :indent t :magic t )))
651
+
648
652
(ert-deftest php-mode-test-php74 ()
649
653
" Test highlighting language constructs added in PHP 7.4."
650
654
(with-php-mode-test (" 7.4/arrow-function.php" :faces t ))
You can’t perform that action at this time.
0 commit comments