for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace ValueParsers\Normalizers;
use InvalidArgumentException;
/**
* Null implementation of StringNormalizer.
*
* @since 0.3
* @license GPL-2.0+
* @author
class SentenceCapitalizer implements StringNormalizer {
* @param string $value
* @throws InvalidArgumentException if $value is not a string
* @return string the normalized value
public function normalize( $value ) {
if ( !is_string( $value ) ) {
throw new InvalidArgumentException( 'Parameter $value must be a string' );
}
$value = str_replace("_", " ",$value);
$value=strtolower($value);
$value=ucfirst($value) ;
return $value;