@@ -70,15 +70,13 @@ discard block |
||
70 | 70 | |
71 | 71 | if(isset($element)) { |
72 | 72 | $text = $element->getValue(); |
73 | - } |
|
74 | - else { |
|
73 | + } else { |
|
75 | 74 | throw new \Exception(sprintf("Element is null")); |
76 | 75 | } |
77 | 76 | |
78 | 77 | if($text === $value) { |
79 | 78 | return true; |
80 | - } |
|
81 | - else { |
|
79 | + } else { |
|
82 | 80 | throw new \Exception(sprintf('Value of input : "%s" does not match the text "%s"', $text, $value)); |
83 | 81 | } |
84 | 82 | } |
@@ -92,8 +90,7 @@ discard block |
||
92 | 90 | $this->iShouldSeeInTheSourceOfThePage($text); |
93 | 91 | $isTextFound = true; |
94 | 92 | break; |
95 | - } |
|
96 | - catch (\Exception $e) { |
|
93 | + } catch (\Exception $e) { |
|
97 | 94 | sleep(1); |
98 | 95 | } |
99 | 96 | } |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | $not_clean_url_language_code = substr($current_url,$base_url_length+3,2); |
85 | 85 | if(in_array($clean_url_language_code,$this->languages_iso_codes) && substr($current_url,$base_url_length+2,1) == "/") { |
86 | 86 | return $clean_url_language_code; |
87 | - } |
|
88 | - else if (in_array($not_clean_url_language_code,$this->languages_iso_codes) && substr($current_url,$base_url_length+5,1) == "/"){ |
|
87 | + } else if (in_array($not_clean_url_language_code,$this->languages_iso_codes) && substr($current_url,$base_url_length+5,1) == "/"){ |
|
89 | 88 | return $not_clean_url_language_code; |
89 | + } else { |
|
90 | + return $this->multilingual_parameters['default_language']; |
|
90 | 91 | } |
91 | - else return $this->multilingual_parameters['default_language']; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | if(isset($this->translations[$target][$this->multilingual_parameters['default_language']])){ |
104 | 104 | $target = $this->translations[$target][$this->languageDetection()]; |
105 | 105 | return $target; |
106 | - } |
|
107 | - elseif (isset($this->translations[$target])) { |
|
106 | + } elseif (isset($this->translations[$target])) { |
|
108 | 107 | return $target; |
108 | + } else { |
|
109 | + throw new \Exception ("The text '$target'' is not defined in '$translations' translation file."); |
|
109 | 110 | } |
110 | - else throw new \Exception ("The text '$target'' is not defined in '$translations' translation file."); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |