diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2012-11-13 13:58:15 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2012-11-13 13:58:15 +0100 |
commit | a46aea9710aceb5d10aabf0d56af2500dc4bbced (patch) | |
tree | 226b56809aca2faf5ad58e5146a2161082d3644e /Core/Util | |
parent | 706855841105f0befced9a7ae8b47b9d48a86f4e (diff) | |
parent | 9228a2a8d92e5023b02ff5c16d1332fa392766f3 (diff) | |
download | symfony-security-a46aea9710aceb5d10aabf0d56af2500dc4bbced.zip symfony-security-a46aea9710aceb5d10aabf0d56af2500dc4bbced.tar.gz symfony-security-a46aea9710aceb5d10aabf0d56af2500dc4bbced.tar.bz2 |
merged branch Inori/consistent-util-classes (PR #5879)
This PR was squashed before being merged into the master branch (closes #5879).
Commits
-------
07bd5c6 Make non-instantiable utils classes consistent with each other
Discussion
----------
Make non-instantiable utils classes consistent with each other
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
As per discussion in #5875 turned out that we don't have a consistent way to define non-instantiatable classes.
I don't like `final` as it removes flexibility with no visible gain.
I don't like `abstract` since it's not specifically clear what is meant by that. Is this class not complete? Should it be extended?
Diffstat (limited to 'Core/Util')
-rw-r--r-- | Core/Util/ClassUtils.php | 5 | ||||
-rw-r--r-- | Core/Util/StringUtils.php | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/Core/Util/ClassUtils.php b/Core/Util/ClassUtils.php index 7b583a3..26bf1a1 100644 --- a/Core/Util/ClassUtils.php +++ b/Core/Util/ClassUtils.php @@ -37,6 +37,11 @@ class ClassUtils const MARKER_LENGTH = 6; /** + * This class should not be instantiated + */ + private function __construct() {} + + /** * Gets the real class name of a class name that could be a proxy. * * @param string|object diff --git a/Core/Util/StringUtils.php b/Core/Util/StringUtils.php index a73b471..d21efd3 100644 --- a/Core/Util/StringUtils.php +++ b/Core/Util/StringUtils.php @@ -16,11 +16,12 @@ namespace Symfony\Component\Security\Core\Util; * * @author Fabien Potencier <fabien@symfony.com> */ -final class StringUtils +class StringUtils { - final private function __construct() - { - } + /** + * This class should not be instantiated + */ + private function __construct() {} /** * Compares two strings. |