This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/PropertyAccess/StringUtil.php

52 lines
1.4 KiB
PHP
Raw Normal View History

<?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;
use Symfony\Component\Inflector\Inflector;
/**
* Creates singulars from plurals.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
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.
*/
class StringUtil
{
/**
2014-11-30 13:33:44 +00:00
* This class should not be instantiated.
*/
2014-09-21 19:53:12 +01:00
private function __construct()
{
}
/**
2014-11-30 13:33:44 +00:00
* Returns the singular form of a word.
*
* 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
*
* @return string|array The singular form or an array of possible singular
* forms
*
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.
*/
public static function singularify($plural)
{
@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);
return Inflector::singularize($plural);
}
}