Skip to content

Commit 4e5fabe

Browse files
committed
Provide example for a file holding more than one class. Update CustomExceptions (the example) to fix commenting.
1 parent 7646c30 commit 4e5fabe

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

user_guide_src/source/contributing/styleguide.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ Structure
4747
=========
4848

4949
- A single file SHOULD NOT declare more than one class.
50+
Examples where we feel that more than one class in a source file
51+
is appropriate:
52+
53+
- `system/Debug/CustomExceptions` contains a number of CodeIgniter
54+
exceptions and errors, that we want to use for a consistent
55+
experience across applications.
56+
If we stick with the purist route, then each of the 13+/- custom
57+
exceptions would require an additional file, which would have a
58+
performance impact at times.
59+
- `system/HTTP/Response` provides a RedirectException, used with the
60+
Response class.
61+
- `system/Router/Router` similarly provides a RedirectException, used with
62+
the Router class.
63+
5064
- Files SHOULD either declare symbols (i.e. classes, functions, constants)
5165
or execute non-declarative logic, but SHOULD NOT do both.
5266

0 commit comments

Comments
 (0)