Skip to content

Commit

Permalink
[Validator] Added inline documentation for the PropertyPath utility c…
Browse files Browse the repository at this point in the history
…lass
  • Loading branch information
webmozart committed Mar 30, 2014
1 parent be7f055 commit 9986f03
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/Symfony/Component/Validator/Util/PropertyPath.php
Expand Up @@ -12,11 +12,29 @@
namespace Symfony\Component\Validator\Util;

/**
* @since %%NextVersion%%
* Contains utility methods for dealing with property paths.
*
* For more extensive functionality, use Symfony's PropertyAccess component.
*
* @since 2.5
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class PropertyPath
{
/**
* Appends a path to a given property path.
*
* If the base path is empty, the appended path will be returned unchanged.
* If the base path is not empty, and the appended path starts with a
* squared opening bracket ("["), the concatenation of the two paths is
* returned. Otherwise, the concatenation of the two paths is returned,
* separated by a dot (".").
*
* @param string $basePath The base path
* @param string $subPath The path to append
*
* @return string The concatenation of the two property paths
*/
public static function append($basePath, $subPath)
{
if ('' !== (string) $subPath) {
Expand All @@ -30,6 +48,9 @@ public static function append($basePath, $subPath)
return $basePath;
}

/**
* Not instantiable.
*/
private function __construct()
{
}
Expand Down

0 comments on commit 9986f03

Please sign in to comment.