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?
This commit is contained in:
Fabien Potencier 2012-11-13 13:58:15 +01:00
commit d45a76b316
3 changed files with 16 additions and 5 deletions

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Form\Util;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class FormUtil
class FormUtil
{
/**
* Map english plural to singular suffixes
@ -97,6 +97,11 @@ abstract class FormUtil
array('xuae', 4, false, true, 'eau'),
);
/**
* This class should not be instantiated
*/
private function __construct() {}
/**
* Returns the singular form of a word
*

View File

@ -36,6 +36,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.
*

View File

@ -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.