mirror of
				https://github.com/elyby/accounts.git
				synced 2025-05-31 14:11:46 +05:30 
			
		
		
		
	Учитываем вероятность получения null-евого значения в нашу реализацию trim
This commit is contained in:
		| @@ -49,7 +49,11 @@ class StringHelper { | ||||
|      * @param  string $string string to remove whitespaces | ||||
|      * @return string trimmed $string | ||||
|      */ | ||||
|     public static function trim(string $string): string { | ||||
|     public static function trim(?string $string): string { | ||||
|         if ($string === null) { | ||||
|             return ''; | ||||
|         } | ||||
|  | ||||
|         return preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $string); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user