File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -318,12 +318,11 @@ Methods to Search and Replace
318
318
u('foo')->equalsTo('foo'); // true
319
319
320
320
// checks if the string content match the given regular expression.
321
- // You can pass flags for preg_match() as second argument. If PREG_PATTERN_ORDER
322
- // or PREG_SET_ORDER are passed, preg_match_all() will be used.
323
321
u('avatar-73647.png')->match('/avatar-(\d+)\.png/');
324
- // result = ['avatar-73647.png', '73647']
325
- u('avatar-73647.png')->match('/avatar-(\d+)(-\d+)?\.png/', \PREG_UNMATCHED_AS_NULL);
326
322
// result = ['avatar-73647.png', '73647', null]
323
+
324
+ // You can pass flags for preg_match() as second argument. If PREG_PATTERN_ORDER
325
+ // or PREG_SET_ORDER are passed, preg_match_all() will be used.
327
326
u('206-555-0100 and 800-555-1212')->match('/\d{3}-\d{3}-\d{4}/', \PREG_PATTERN_ORDER);
328
327
// result = [['206-555-0100', '800-555-1212']]
329
328
Original file line number Diff line number Diff line change @@ -206,8 +206,12 @@ Naming Conventions
206
206
* Use `snake_case `_ for configuration parameters and Twig template variables
207
207
(e.g. ``framework.csrf_protection ``, ``http_status_code ``);
208
208
209
- * Use namespaces for all PHP classes and `UpperCamelCase `_ for their names (e.g.
210
- ``ConsoleLogger ``);
209
+ * Use `SCREAMING_SNAKE_CASE `_ for constants (e.g. ``InputArgument::IS_ARRAY ``);
210
+
211
+ * Use `UpperCamelCase `_ for enumeration cases (e.g. ``InputArgumentMode::IsArray ``);
212
+
213
+ * Use namespaces for all PHP classes, interfaces, traits and enums and
214
+ `UpperCamelCase `_ for their names (e.g. ``ConsoleLogger ``);
211
215
212
216
* Prefix all abstract classes with ``Abstract `` except PHPUnit ``*TestCase ``.
213
217
Please note some early Symfony classes do not follow this convention and
@@ -218,6 +222,9 @@ Naming Conventions
218
222
219
223
* Suffix traits with ``Trait ``;
220
224
225
+ * Don't use a dedicated suffix for classes or enumerations (e.g. like ``Class ``
226
+ or ``Enum ``), except for the cases listed below.
227
+
221
228
* Suffix exceptions with ``Exception ``;
222
229
223
230
* Prefix PHP attributes with ``As `` where applicable (e.g. ``#[AsCommand] ``
You can’t perform that action at this time.
0 commit comments