for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the SVN-Buddy library.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* @copyright Alexander Obuhovich <[email protected]>
* @link https://github.com/console-helpers/svn-buddy
*/
namespace ConsoleHelpers\SVNBuddy\Config;
class StringConfigSetting extends AbstractConfigSetting
{
* Normalizes value.
* @param mixed $value Value.
* @return mixed
protected function normalizeValue($value)
return is_string($value) ? trim($value) : $value;
}
* Converts value into scalar for used for storage.
protected function convertToStorageFormat($value)
return (string)$value;
* Performs value validation.
* @return void
* @throws \InvalidArgumentException When validation failed.
protected function validate($value)
if ( !is_string($value) ) {
throw new \InvalidArgumentException(
'The "' . $this->getName() . '" config setting value must be a string.'
);