Conditions | 1 |
Paths | 1 |
Total Lines | 74 |
Code Lines | 62 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
64 | protected static function getExceptionConversionData() : array |
||
65 | { |
||
66 | return [ |
||
67 | self::EXCEPTION_CONNECTION => [ |
||
68 | [1044], |
||
69 | [1045], |
||
70 | [1046], |
||
71 | [1049], |
||
72 | [1095], |
||
73 | [1142], |
||
74 | [1143], |
||
75 | [1227], |
||
76 | [1370], |
||
77 | [2002], |
||
78 | [2005], |
||
79 | ], |
||
80 | self::EXCEPTION_FOREIGN_KEY_CONSTRAINT_VIOLATION => [ |
||
81 | [1216], |
||
82 | [1217], |
||
83 | [1451], |
||
84 | [1452], |
||
85 | ], |
||
86 | self::EXCEPTION_INVALID_FIELD_NAME => [ |
||
87 | [1054], |
||
88 | [1166], |
||
89 | [1611], |
||
90 | ], |
||
91 | self::EXCEPTION_NON_UNIQUE_FIELD_NAME => [ |
||
92 | [1052], |
||
93 | [1060], |
||
94 | [1110], |
||
95 | ], |
||
96 | self::EXCEPTION_NOT_NULL_CONSTRAINT_VIOLATION => [ |
||
97 | [1048], |
||
98 | [1121], |
||
99 | [1138], |
||
100 | [1171], |
||
101 | [1252], |
||
102 | [1263], |
||
103 | [1364], |
||
104 | [1566], |
||
105 | ], |
||
106 | self::EXCEPTION_SYNTAX_ERROR => [ |
||
107 | [1064], |
||
108 | [1149], |
||
109 | [1287], |
||
110 | [1341], |
||
111 | [1342], |
||
112 | [1343], |
||
113 | [1344], |
||
114 | [1382], |
||
115 | [1479], |
||
116 | [1541], |
||
117 | [1554], |
||
118 | [1626], |
||
119 | ], |
||
120 | self::EXCEPTION_TABLE_EXISTS => [ |
||
121 | [1050], |
||
122 | ], |
||
123 | self::EXCEPTION_TABLE_NOT_FOUND => [ |
||
124 | [1051], |
||
125 | [1146], |
||
126 | ], |
||
127 | self::EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION => [ |
||
128 | [1062], |
||
129 | [1557], |
||
130 | [1569], |
||
131 | [1586], |
||
132 | ], |
||
133 | self::EXCEPTION_DEADLOCK => [ |
||
134 | [1213], |
||
135 | ], |
||
136 | self::EXCEPTION_LOCK_WAIT_TIMEOUT => [ |
||
137 | [1205], |
||
138 | ], |
||
142 |