appendPrefix() public static method

Example: $string = 'Targaryen'; $stringWithPrefix = Strings::appendPrefix($string, 'Daenerys '); Result: Daenerys Targaryen
public static appendPrefix ( string $string, string $prefix = '' ) : string
$string string
$prefix string
return string
Esempio n. 1
0
 public static function getMessageWithHttpProtocol($code, $protocol = 'HTTP/1.1 ')
 {
     return Strings::appendPrefix(self::getMessage($code), $protocol);
 }
Esempio n. 2
0
 /**
  * @test
  */
 public function shouldAppendPrefix()
 {
     //given
     $string = 'Targaryen';
     //when
     $stringWithSuffix = Strings::appendPrefix($string, 'Daenerys ');
     //then
     $this->assertEquals('Daenerys Targaryen', $stringWithSuffix);
 }
 public static function createModule($moduleName)
 {
     $moduleName = ucfirst(Inflector::singularize($moduleName));
     $moduleName = Strings::appendPrefix($moduleName, '\\SugarClient\\Module\\');
     return new $moduleName();
 }