up() public static méthode

Make a string uppercase
public static up ( string $string ) : string
$string string
Résultat string
Exemple #1
0
 /**
  * String to upper and trim
  *
  * @param $string
  * @return string
  *
  * @SuppressWarnings(PHPMD.ShortMethodName)
  */
 public static function up($string)
 {
     $cleaned = Str::up($string);
     $cleaned = Str::trim($cleaned);
     return $cleaned;
 }
Exemple #2
0
 /**
  * Clean and validate HTTP-method type
  *
  * @param string $method
  * @return string
  * @throws Exception
  */
 protected function _getMethod($method)
 {
     $method = trim(Str::up($method));
     $validList = array(self::METHOD_GET, self::METHOD_POST, self::METHOD_HEAD, self::METHOD_PUT, self::METHOD_DELETE, self::METHOD_OPTIONS, self::METHOD_PATCH);
     if (Arr::in($method, $validList)) {
         return $method;
     } else {
         throw new Exception('Unsupported Request Method: ' . $method);
     }
 }
Exemple #3
0
 public function testMBString()
 {
     isSame(Str::isMBString(), function_exists('mb_strtoupper'));
     isSame(Str::isOverload(), (int) ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING);
     is(5, Str::len('Денис'));
     isSame(1, Str::pos('Денис', 'е'));
     isSame(false, Str::pos('Денис', 'Е'));
     isSame(3, Str::rpos('Денис', 'и'));
     isSame(1, Str::ipos('Денис', 'Е'));
     isSame(1, Str::ipos('Денис', 'Е'));
     isSame('енис', Str::strstr('Денис', 'е'));
     isSame('енис', Str::istr('Денис', 'Е'));
     isSame('ис', Str::rchr('Денис', 'и'));
     isSame('нис', Str::sub('Денис', 2));
     isSame('ени', Str::sub('Денис', 1, 3));
     isSame('денис', Str::low('ДЕНИС'));
     isSame('ДЕНИС', Str::up('денис'));
     isSame(2, Str::subCount('денис ДеНИС', 'е'));
     isSame(1, Str::subCount('денис ДеНИС', 'И'));
     isTrue(Str::isStart('денис', 'ден', true));
     isTrue(Str::isStart('денис', 'ДЕН', false));
     isFalse(Str::isStart('денис', 'ДЕН', true));
     isTrue(Str::isEnd('денис', 'нис', true));
     isTrue(Str::isEnd('денис', 'НИС', false));
     isFalse(Str::isEnd('денис', 'ДЕНИС', true));
 }