Completed
Push — master ( 2335de...3044dd )
by Adam
03:28
created
src/IPub/FormPhone/Controls/Phone.php 2 patches
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -18,15 +18,11 @@
 block discarded – undo
18 18
 use Nette\Forms;
19 19
 use Nette\Localization;
20 20
 use Nette\Utils;
21
-
22 21
 use IPub;
23 22
 use IPub\FormPhone;
24 23
 use IPub\FormPhone\Exceptions;
25
-
26 24
 use IPub\Phone\Phone as PhoneUtils;
27 25
 
28
-use libphonenumber;
29
-
30 26
 /**
31 27
  * Form phone control element
32 28
  *
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -295,10 +295,10 @@  discard block
 block discarded – undo
295 295
 	 */
296 296
 	public function loadHttpData()
297 297
 	{
298
-		$country = $this->getHttpData(Forms\Form::DATA_LINE, '[' . self::FIELD_COUNTRY . ']');
298
+		$country = $this->getHttpData(Forms\Form::DATA_LINE, '['.self::FIELD_COUNTRY.']');
299 299
 		$this->country = ($country === '' || $country === NULL) ? NULL : (string) $country;
300 300
 
301
-		$number = $this->getHttpData(Forms\Form::DATA_LINE, '[' . self::FIELD_NUMBER . ']');
301
+		$number = $this->getHttpData(Forms\Form::DATA_LINE, '['.self::FIELD_NUMBER.']');
302 302
 		$this->number = ($number === '' || $number === NULL) ? NULL : (string) $number;
303 303
 	}
304 304
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	public function getControl()
309 309
 	{
310 310
 		$el = Utils\Html::el();
311
-		$el->addHtml($this->getControlPart(self::FIELD_COUNTRY) . $this->getControlPart(self::FIELD_NUMBER));
311
+		$el->addHtml($this->getControlPart(self::FIELD_COUNTRY).$this->getControlPart(self::FIELD_NUMBER));
312 312
 
313 313
 		return $el;
314 314
 	}
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 				);
348 348
 
349 349
 				$result[$row] = Utils\Html::el('option');
350
-				$result[$row]->setText('+' . $this->phoneUtils->getCountryCodeForCountry($row) . ' (' . $countryName . ')');
350
+				$result[$row]->setText('+'.$this->phoneUtils->getCountryCodeForCountry($row).' ('.$countryName.')');
351 351
 				$result[$row]->data('mask', preg_replace('/[0-9]/', '9', $this->phoneUtils->getExampleNationalNumber($row)));
352 352
 				$result[$row]->addAttributes([
353 353
 					'value' => $row,
@@ -364,12 +364,12 @@  discard block
 block discarded – undo
364 364
 			);
365 365
 
366 366
 			$control->addAttributes([
367
-				'name' => $name . '[' . self::FIELD_COUNTRY . ']',
368
-				'id'   => $this->getHtmlId() . '-' . self::FIELD_COUNTRY,
367
+				'name' => $name.'['.self::FIELD_COUNTRY.']',
368
+				'id'   => $this->getHtmlId().'-'.self::FIELD_COUNTRY,
369 369
 			]);
370 370
 			$control->data('ipub-forms-phone', '');
371 371
 			$control->data('settings', json_encode([
372
-					'field' => $name . '[' . self::FIELD_NUMBER . ']'
372
+					'field' => $name.'['.self::FIELD_NUMBER.']'
373 373
 				])
374 374
 			);
375 375
 
@@ -387,8 +387,8 @@  discard block
 block discarded – undo
387 387
 			$control = Utils\Html::el('input');
388 388
 
389 389
 			$control->addAttributes([
390
-				'name'  => $name . '[' . self::FIELD_NUMBER . ']',
391
-				'id'    => $this->getHtmlId() . '-' . self::FIELD_NUMBER,
390
+				'name'  => $name.'['.self::FIELD_NUMBER.']',
391
+				'id'    => $this->getHtmlId().'-'.self::FIELD_NUMBER,
392 392
 				'value' => $this->number,
393 393
 				'type'  => 'text',
394 394
 			]);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 		// Phone type have to be upper-cased
449 449
 		$type = strtoupper($type);
450 450
 
451
-		if (defined('\IPub\Phone\Phone::TYPE_' . $type)) {
451
+		if (defined('\IPub\Phone\Phone::TYPE_'.$type)) {
452 452
 			return $type;
453 453
 
454 454
 		} else {
Please login to merge, or discard this patch.
src/IPub/FormPhone/Locale/Locale.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 	 */
31 31
 	public static function countryCodeToLocale(string $countryCode, string $languageCode = '')
32 32
 	{
33
-		$locale = 'en-' . $countryCode;
33
+		$locale = 'en-'.$countryCode;
34 34
 		$localeRegion = locale_get_region($locale);
35 35
 		$localeLanguage = locale_get_primary_language($locale);
36 36
 		$localeArray = [
Please login to merge, or discard this patch.
src/IPub/FormPhone/Forms/PhoneValidator.php 1 patch
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -16,18 +16,13 @@
 block discarded – undo
16 16
 
17 17
 namespace IPub\FormPhone\Forms;
18 18
 
19
-use Nette;
20 19
 use Nette\Forms;
21
-
22 20
 use libphonenumber;
23 21
 use libphonenumber\PhoneNumberUtil;
24
-
25 22
 use IPub\FormPhone;
26 23
 use IPub\FormPhone\Controls;
27 24
 use IPub\FormPhone\Exceptions;
28
-
29 25
 use IPub\Phone;
30
-use Tracy\Debugger;
31 26
 
32 27
 /**
33 28
  * Phone number control form field validator
Please login to merge, or discard this patch.