className() public static method

Convert words to PHP Class name
public static className ( $input ) : string
$input
return string
Beispiel #1
0
 public function testClassname()
 {
     isSame('Class123Name456', Filter::className('Class123Name456'));
     isSame('Class123Name456', Filter::className('Class123 Name456'));
     isSame('Class123Name456', Filter::className('CLASS123 NAME456'));
     isSame('Class123Name456', Filter::className('class123 name456'));
     isSame('Class123Name456', Filter::className('class123Name456'));
     isSame('Class123Name456', Filter::className('class123_Name456'));
     isSame('Class123Name456', Filter::className('class123_name456'));
     isSame('Class123Name456', Filter::className('class123-name456'));
     isSame('Class123Name456', Filter::className('class123|name456'));
     isSame('Class123Name456', Filter::className('class123.name456'));
     isSame('Class123Name456', Filter::className('class123name456'));
     isSame('Class123Name456', Filter::className('CLASS123NAME456'));
     isSame('Classname', Filter::className('CLASSNAME'));
 }