2013-01-07 08:19:31 +00:00
< ? php
/*
* This file is part of the Symfony package .
*
* ( c ) Fabien Potencier < fabien @ symfony . com >
*
* For the full copyright and license information , please view the LICENSE
* file that was distributed with this source code .
*/
namespace Symfony\Component\PropertyAccess ;
2016-03-22 09:02:09 +00:00
use Symfony\Component\Inflector\Inflector ;
2013-01-07 08:19:31 +00:00
/**
* Creates singulars from plurals .
*
* @ author Bernhard Schussek < bschussek @ gmail . com >
2016-03-22 09:02:09 +00:00
*
2016-12-03 10:46:43 +00:00
* @ deprecated since version 3.1 , to be removed in 4.0 . Use { @ see Symfony\Component\Inflector\Inflector } instead .
2013-01-07 08:19:31 +00:00
*/
class StringUtil
{
/**
2014-11-30 13:33:44 +00:00
* This class should not be instantiated .
2013-01-07 08:19:31 +00:00
*/
2014-09-21 19:53:12 +01:00
private function __construct ()
{
}
2013-01-07 08:19:31 +00:00
/**
2014-11-30 13:33:44 +00:00
* Returns the singular form of a word .
2013-01-07 08:19:31 +00:00
*
* If the method can ' t determine the form with certainty , an array of the
* possible singulars is returned .
*
* @ param string $plural A word in plural form
2014-11-30 13:33:44 +00:00
*
2013-01-07 08:19:31 +00:00
* @ return string | array The singular form or an array of possible singular
* forms
2016-03-22 09:02:09 +00:00
*
2016-12-03 10:46:43 +00:00
* @ deprecated since version 3.1 , to be removed in 4.0 . Use { @ see Symfony\Component\Inflector\Inflector :: singularize } instead .
2013-01-07 08:19:31 +00:00
*/
public static function singularify ( $plural )
{
2016-03-22 09:02:09 +00:00
@ trigger_error ( 'StringUtil::singularify() is deprecated since version 3.1 and will be removed in 4.0. Use Symfony\Component\Inflector\Inflector::singularize instead.' , E_USER_DEPRECATED );
2013-01-07 08:19:31 +00:00
2016-03-22 09:02:09 +00:00
return Inflector :: singularize ( $plural );
2013-01-07 08:19:31 +00:00
}
}