Commit 4e80fc1
authored
Handle nested destructuring assignment (#129)
* Add test for nested list() destructuring
* Add phpcsutils as dependency
* Use Lists::getAssignments to determine list assignment
* Add short list nested destructuring test
* Use Lists::getAssignments to determine short list assignments
* Remove null coalesce to support php 5
* Wrap getAssignments in try/catch
It shouldn't be able to fail since we already search for the opening
bracket, but it seems to fail in CI.
* Add phpcsutils to circleci dependencies
* Add namespace to Exception
* Prevent findPrevious from returning true
This will never happen but the return type can include `true` so we must
look for it to satisfy the static analysis.
* Try another way to test for bool return value from findPrevious
The comparison with true was sometimes breaking phpstan.1 parent 1d12cbc commit 4e80fc1
File tree
5 files changed
+68
-14
lines changed- VariableAnalysis
- Sniffs/CodeAnalysis
- Tests/CodeAnalysis
- fixtures
5 files changed
+68
-14
lines changedLines changed: 26 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
821 | 822 | | |
822 | 823 | | |
823 | 824 | | |
824 | | - | |
825 | | - | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
826 | 828 | | |
827 | 829 | | |
828 | | - | |
829 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
830 | 837 | | |
831 | 838 | | |
832 | 839 | | |
833 | 840 | | |
834 | | - | |
835 | | - | |
| 841 | + | |
836 | 842 | | |
837 | 843 | | |
838 | 844 | | |
| |||
854 | 860 | | |
855 | 861 | | |
856 | 862 | | |
857 | | - | |
| 863 | + | |
858 | 864 | | |
859 | 865 | | |
860 | 866 | | |
861 | 867 | | |
862 | | - | |
863 | | - | |
864 | | - | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
865 | 880 | | |
866 | 881 | | |
867 | 882 | | |
868 | 883 | | |
869 | | - | |
870 | | - | |
| 884 | + | |
871 | 885 | | |
872 | 886 | | |
873 | 887 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
742 | 746 | | |
743 | 747 | | |
744 | 748 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments