@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | /** |
| 45 | 45 | * Define filed attributes |
| 46 | 46 | */ |
| 47 | - const FIELD_COUNTRY = 'country'; |
|
| 48 | - const FIELD_NUMBER = 'number'; |
|
| 47 | + const FIELD_COUNTRY = 'country'; |
|
| 48 | + const FIELD_NUMBER = 'number'; |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * @var IPub\Phone\Phone |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | - throw new Exceptions\InvalidArgumentException('Provided value is not valid phone number, or is out of list of allowed countries, "' . $value . '" given.'); |
|
| 264 | + throw new Exceptions\InvalidArgumentException('Provided value is not valid phone number, or is out of list of allowed countries, "'.$value.'" given.'); |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | /** |
@@ -294,10 +294,10 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | public function loadHttpData() |
| 296 | 296 | { |
| 297 | - $country = $this->getHttpData(Forms\Form::DATA_LINE, '[' . static::FIELD_COUNTRY . ']'); |
|
| 297 | + $country = $this->getHttpData(Forms\Form::DATA_LINE, '['.static::FIELD_COUNTRY.']'); |
|
| 298 | 298 | $this->country = ($country === '' || $country === NULL) ? NULL : (string) $country; |
| 299 | 299 | |
| 300 | - $number = $this->getHttpData(Forms\Form::DATA_LINE, '[' . static::FIELD_NUMBER . ']'); |
|
| 300 | + $number = $this->getHttpData(Forms\Form::DATA_LINE, '['.static::FIELD_NUMBER.']'); |
|
| 301 | 301 | $this->number = ($number === '' || $number === NULL) ? NULL : (string) $number; |
| 302 | 302 | } |
| 303 | 303 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | public function getControl() |
| 308 | 308 | { |
| 309 | 309 | return Utils\Html::el() |
| 310 | - ->add($this->getControlPart(static::FIELD_COUNTRY) . $this->getControlPart(static::FIELD_NUMBER)); |
|
| 310 | + ->add($this->getControlPart(static::FIELD_COUNTRY).$this->getControlPart(static::FIELD_NUMBER)); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | ); |
| 346 | 346 | |
| 347 | 347 | $result[$row] = Utils\Html::el('option') |
| 348 | - ->setText('+' . $this->phoneUtils->getCountryCodeForCountry($row) . ' (' . $countryName . ')') |
|
| 348 | + ->setText('+'.$this->phoneUtils->getCountryCodeForCountry($row).' ('.$countryName.')') |
|
| 349 | 349 | ->addAttributes([ |
| 350 | 350 | 'data-mask' => preg_replace('/[0-9]/', '9', $this->phoneUtils->getExampleNationalNumber($row)), |
| 351 | 351 | ]) |
@@ -359,12 +359,12 @@ discard block |
||
| 359 | 359 | ); |
| 360 | 360 | |
| 361 | 361 | $control->addAttributes([ |
| 362 | - 'name' => $name . '[' . static::FIELD_COUNTRY . ']', |
|
| 363 | - 'id' => $this->getHtmlId() . '-' . static::FIELD_COUNTRY, |
|
| 362 | + 'name' => $name.'['.static::FIELD_COUNTRY.']', |
|
| 363 | + 'id' => $this->getHtmlId().'-'.static::FIELD_COUNTRY, |
|
| 364 | 364 | |
| 365 | 365 | 'data-ipub-forms-phone' => '', |
| 366 | 366 | 'data-settings' => json_encode([ |
| 367 | - 'field' => $name . '[' . static::FIELD_NUMBER . ']' |
|
| 367 | + 'field' => $name.'['.static::FIELD_NUMBER.']' |
|
| 368 | 368 | ]) |
| 369 | 369 | ]); |
| 370 | 370 | |
@@ -380,8 +380,8 @@ discard block |
||
| 380 | 380 | $control = Utils\Html::el('input'); |
| 381 | 381 | |
| 382 | 382 | $control->addAttributes([ |
| 383 | - 'name' => $name . '[' . static::FIELD_NUMBER . ']', |
|
| 384 | - 'id' => $this->getHtmlId() . '-' . static::FIELD_NUMBER, |
|
| 383 | + 'name' => $name.'['.static::FIELD_NUMBER.']', |
|
| 384 | + 'id' => $this->getHtmlId().'-'.static::FIELD_NUMBER, |
|
| 385 | 385 | 'value' => $this->number, |
| 386 | 386 | 'type' => 'text', |
| 387 | 387 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | return $control; |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | - throw new Exceptions\InvalidArgumentException('Part ' . $key . ' does not exist.'); |
|
| 399 | + throw new Exceptions\InvalidArgumentException('Part '.$key.' does not exist.'); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | /** |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | return $country; |
| 424 | 424 | |
| 425 | 425 | } else { |
| 426 | - throw new Exceptions\NoValidCountryException('Provided country code "' . $country . '" is not valid. Provide valid country code or AUTO for automatic detection.'); |
|
| 426 | + throw new Exceptions\NoValidCountryException('Provided country code "'.$country.'" is not valid. Provide valid country code or AUTO for automatic detection.'); |
|
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | |
@@ -439,11 +439,11 @@ discard block |
||
| 439 | 439 | // Phone type have to be upper-cased |
| 440 | 440 | $type = strtoupper($type); |
| 441 | 441 | |
| 442 | - if (defined('\IPub\Phone\Phone::TYPE_' . $type)) { |
|
| 442 | + if (defined('\IPub\Phone\Phone::TYPE_'.$type)) { |
|
| 443 | 443 | return $type; |
| 444 | 444 | |
| 445 | 445 | } else { |
| 446 | - throw new Exceptions\NoValidTypeException('Provided phone type "' . $type . '" is not valid. Provide valid phone type.'); |
|
| 446 | + throw new Exceptions\NoValidTypeException('Provided phone type "'.$type.'" is not valid. Provide valid phone type.'); |
|
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | |