rfc:namespaces_in_bundled_extensions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:namespaces_in_bundled_extensions [2021/02/26 09:05] – nikic | rfc:namespaces_in_bundled_extensions [2021/04/19 13:04] – nikic | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Date: 2021-02-25 | * Date: 2021-02-25 | ||
* Author: Nikita Popov < | * Author: Nikita Popov < | ||
- | * Status: | + | * Status: |
* Target Version: PHP 8.1 | * Target Version: PHP 8.1 | ||
Line 65: | Line 65: | ||
* The top-level namespace should match the extension name (apart from casing). | * The top-level namespace should match the extension name (apart from casing). | ||
* Namespace names should follow '' | * Namespace names should follow '' | ||
- | * All symbols defined in the extension should be part of the top-level namespace or a sub-namespace. | + | * All symbols defined in the extension should be part of the extension' |
==== Examples ==== | ==== Examples ==== | ||
Line 83: | Line 83: | ||
The distinction between these three extensions is somewhat murky from an end-user perspective, | The distinction between these three extensions is somewhat murky from an end-user perspective, | ||
- | Because these extensions combine a lot of unrelated or only tangentially related functionality, | + | Because these extensions combine a lot of unrelated or only tangentially related functionality, |
- | For example, '' | + | For example, '' |
==== Existing non-namespaces symbols and consistency ==== | ==== Existing non-namespaces symbols and consistency ==== | ||
Line 91: | Line 91: | ||
When adding new symbols to existing extensions, it is more important to be consistent with existing symbols than to follow the namespacing guidelines. | When adding new symbols to existing extensions, it is more important to be consistent with existing symbols than to follow the namespacing guidelines. | ||
- | For example, the '' | + | For example, the '' |
This is a somewhat loose guideline, and applies more strongly to functions than classes. In particular, when new object-oriented elements are introduced into an extension that has historically been procedural, these may be namespaced. For example, if '' | This is a somewhat loose guideline, and applies more strongly to functions than classes. In particular, when new object-oriented elements are introduced into an extension that has historically been procedural, these may be namespaced. For example, if '' | ||
Line 97: | Line 97: | ||
For the Core/ | For the Core/ | ||
- | ==== Namespaced aliases | + | ==== Namespace collisions |
- | Aliasing | + | The disadvantage |
+ | |||
+ | As a matter | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
None. | None. | ||
+ | |||
+ | ===== Future Scope ===== | ||
+ | |||
+ | This RFC only officially allows use of namespaces, and provides basic guidelines for their use. However, it does not propose to migrate already existing non-namespaced symbols to use namespaces. Such a migration should be the subject of a separate RFC. | ||
===== Vote ===== | ===== Vote ===== | ||
- | Yes/No. | + | Voting started 2021-04-19 and ends 2021-05-03. |
+ | |||
+ | <doodle title=" | ||
+ | | ||
+ | | ||
+ | </ | ||
rfc/namespaces_in_bundled_extensions.txt · Last modified: 2021/05/03 08:01 by nikic