@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | |
122 | 122 | protected $tagTypes = array( |
123 | 123 | 'button' => array('input', 'button'), |
124 | - 'buttons' => array('input','button'), |
|
124 | + 'buttons' => array('input', 'button'), |
|
125 | 125 | 'cell' => 'td', |
126 | 126 | 'cells' => 'td', |
127 | - 'heading' => array('h1', 'h2', 'h3', 'h4', 'h5','h6'), |
|
128 | - 'headings' => array('h1', 'h2', 'h3', 'h4', 'h5','h6'), |
|
127 | + 'heading' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'), |
|
128 | + 'headings' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'), |
|
129 | 129 | 'link' => 'a', |
130 | 130 | 'links' => 'a', |
131 | 131 | 'orderedlist' => 'ol', |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | 'unorderedlist' => self::SINGLE_TARGET |
155 | 155 | ); |
156 | 156 | |
157 | - protected $searchTypes = array ( |
|
157 | + protected $searchTypes = array( |
|
158 | 158 | 'id' => 'ById', |
159 | 159 | 'label' => 'ByLabel', |
160 | 160 | 'labelled' => 'ByLabel', |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | { |
297 | 297 | // we need to know which element they want |
298 | 298 | $words = $this->convertMethodNameToWords($methodName); |
299 | - $indexType = $this->determineIndexType($words); |
|
299 | + $indexType = $this->determineIndexType($words); |
|
300 | 300 | |
301 | 301 | // get all the elements that match |
302 | 302 | $elements = $this->retrieveElements($methodName, $methodArgs); |
@@ -323,7 +323,8 @@ |
||
323 | 323 | $searchTerm = $methodArgs[0]; |
324 | 324 | |
325 | 325 | $searchType = $this->determineSearchType($words); |
326 | - if ($searchType === null) { // we do not understand how to find the target field |
|
326 | + if ($searchType === null) { |
|
327 | +// we do not understand how to find the target field |
|
327 | 328 | throw new E5xx_ActionFailed(__CLASS__ . '::' . $methodName, "could not work out how to find the target to action upon"); |
328 | 329 | } |
329 | 330 |
@@ -245,8 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | // search all of the label elements to find an associated input |
247 | 247 | // element that we can safely use |
248 | - foreach ($labelElements as $labelElement) |
|
249 | - { |
|
248 | + foreach ($labelElements as $labelElement) { |
|
250 | 249 | try { |
251 | 250 | // add each element that matches this label |
252 | 251 | $retval[] = $this->getElementAssociatedWithLabelElement($labelElement, $labelText); |
@@ -289,8 +288,7 @@ discard block |
||
289 | 288 | } |
290 | 289 | |
291 | 290 | // what do we do next? |
292 | - if ($inputElementId !== null) |
|
293 | - { |
|
291 | + if ($inputElementId !== null) { |
|
294 | 292 | // where does the 'for' attribute go? |
295 | 293 | try { |
296 | 294 | $inputElement = $log->addStep("find the input element with the id '{$inputElementId}'", function() use($topElement, $inputElementId) { |
@@ -121,7 +121,7 @@ |
||
121 | 121 | $log = usingLog()->startAction("$elementDesc '$elementName' must exist"); |
122 | 122 | |
123 | 123 | $actualCount = count($elements); |
124 | - switch($requiredCount) { |
|
124 | + switch ($requiredCount) { |
|
125 | 125 | // this satisfies something like: |
126 | 126 | // |
127 | 127 | // expectsBrowser()->has()->fieldWithId('XX'); |
@@ -272,7 +272,7 @@ |
||
272 | 272 | $log = usingLog()->startAction("retrieve the value of the $elementDesc '$elementName'"); |
273 | 273 | |
274 | 274 | // is this a select box? |
275 | - switch($element->name()) { |
|
275 | + switch ($element->name()) { |
|
276 | 276 | case 'select': |
277 | 277 | // get the option that is selected |
278 | 278 | try { |
@@ -350,8 +350,7 @@ discard block |
||
350 | 350 | // all done |
351 | 351 | return $credentials; |
352 | 352 | } |
353 | - catch (Exception $e) |
|
354 | - { |
|
353 | + catch (Exception $e) { |
|
355 | 354 | return null; |
356 | 355 | } |
357 | 356 | } |
@@ -370,8 +369,7 @@ discard block |
||
370 | 369 | // get the details |
371 | 370 | return $adapter->hasHttpBasicAuthForHost($hostname); |
372 | 371 | } |
373 | - catch (Exception $e) |
|
374 | - { |
|
372 | + catch (Exception $e) { |
|
375 | 373 | return false; |
376 | 374 | } |
377 | 375 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $words = $this->convertMethodNameToWords($methodName); |
88 | 88 | |
89 | 89 | // how many elements are we searching for? |
90 | - $countType = $this->determineCountType($words); |
|
90 | + $countType = $this->determineCountType($words); |
|
91 | 91 | |
92 | 92 | // get the elements we need |
93 | 93 | $elements = $this->retrieveElements($methodName, $methodArgs); |
@@ -77,7 +77,7 @@ |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | // yes, it really is a form |
80 | - $this->formId = $formId; |
|
80 | + $this->formId = $formId; |
|
81 | 81 | $this->setTopElement($formElement); |
82 | 82 | } |
83 | 83 |
@@ -77,7 +77,7 @@ |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | // yes, it really is a form |
80 | - $this->formId = $formId; |
|
80 | + $this->formId = $formId; |
|
81 | 81 | $this->setTopElement($formElement); |
82 | 82 | } |
83 | 83 |
@@ -77,7 +77,7 @@ |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | // yes, it really is a form |
80 | - $this->formId = $formId; |
|
80 | + $this->formId = $formId; |
|
81 | 81 | $this->setTopElement($formElement); |
82 | 82 | } |
83 | 83 |
@@ -55,7 +55,8 @@ |
||
55 | 55 | */ |
56 | 56 | class E5xx_UnknownDomElementType extends E5xx_ProseException |
57 | 57 | { |
58 | - public function __construct($elementType) { |
|
58 | + public function __construct($elementType) |
|
59 | + { |
|
59 | 60 | $msg = "Unknown DOM element type '{$elementType}'"; |
60 | 61 | parent::__construct(500, $msg, $msg); |
61 | 62 | } |