@@ -152,62 +152,74 @@ rewritten to comply with these rules.
152
152
1. Method names follow the *studlyCaps* (also referred to as *bumpy case* or
153
153
*camel caps*) naming convention, with care taken to minimize the letter
154
154
count. The initial letter of the name is lowercase, and each letter that
155
- starts a new ` word` is capitalized:
155
+ starts a new " word" is capitalized.
156
156
157
- Good:
157
+ 1. Class names should be descriptive nouns in *PascalCase* and as short as
158
+ possible. Each word in the class name should start with a capital letter,
159
+ without underscore delimiters. The class name should be prefixed with the
160
+ name of the " parent set" (e.g. the name of the extension) if no namespaces
161
+ are used.
162
+
163
+ 1. Abbreviations and acronyms as well as initialisms should be avoided wherever
164
+ possible, unless they are much more widely used than the long form (e.g. HTTP
165
+ or URL). Abbreviations, acronyms, and initialisms should be treated like
166
+ regular words, thus they should be written with an uppercase first character,
167
+ followed by lowercase characters.
168
+
169
+ 1. Diverging from this policy is allowed to keep internal consistency within a
170
+ single extension, if the name follows an established, language-agnostic
171
+ standard, or for other reasons, if those reasons are properly justified
172
+ and voted on as part of the RFC process.
173
+
174
+
175
+ Good method names:
158
176
159
177
```php
160
178
connect()
161
179
getData()
162
180
buildSomeWidget()
181
+ performHttpRequest()
163
182
```
164
183
165
- Bad:
184
+ Bad method names :
166
185
167
186
```php
168
187
get_Data()
169
188
buildsomewidget()
170
189
getI()
190
+ performHTTPRequest()
171
191
```
172
192
173
- 1. Class names should be descriptive nouns in *PascalCase* and as short as
174
- possible. Each word in the class name should start with a capital letter,
175
- without underscore delimiters. The class name should be prefixed with the
176
- name of the " parent set" (e.g. the name of the extension) if no namespaces
177
- are used. Abbreviations and acronyms as well as initialisms should be
178
- avoided wherever possible, unless they are much more widely used than the
179
- long form (e.g. HTTP or URL). Abbreviations start with a capital letter
180
- followed by lowercase letters, whereas acronyms and initialisms are written
181
- according to their standard notation. Usage of acronyms and initialisms is
182
- not allowed if they are not widely adopted and recognized as such.
183
-
184
- Good:
193
+ Good class names:
185
194
186
195
```php
187
196
Curl
188
197
CurlResponse
189
- HTTPStatusCode
190
- URL
191
- BTreeMap // B-tree Map
192
- Id // Identifier
193
- ID // Identity Document
198
+ HttpStatusCode
199
+ Url
200
+ BtreeMap // B-tree Map
201
+ UserId // User Identifier
194
202
Char // Character
195
203
Intl // Internationalization
196
- Radar // Radio Detecting and Ranging
204
+ Ssl\Certificate
205
+ Ssl\Crl // Certificate Revocation List
206
+ Ssl\CrlUrl
197
207
```
198
208
199
- Bad:
209
+ Bad class names :
200
210
201
211
```php
202
212
curl
203
213
curl_response
204
- HttpStatusCode
205
- Url
206
- BtreeMap
207
- ID // Identifier
214
+ HTTPStatusCode
215
+ URL
216
+ BTreeMap
217
+ UserID // User Identifier
208
218
CHAR
209
219
INTL
210
- RADAR // Radio Detecting and Ranging
220
+ SSL\Certificate
221
+ SSL\CRL
222
+ SSL\CRLURL
211
223
```
212
224
213
225
## Internal function naming conventions
0 commit comments