Skip to content

Commit 56daa8f

Browse files
committed
Refactor method declarations by removing unnecessary line breaks for improved readability in VisualCeption module.
1 parent 30e419e commit 56daa8f

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

src/Codeception/Module/VisualCeption.php

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
namespace Codeception\Module;
55

6-
use Codeception\Lib\Interfaces\MultiSession;
76
use Codeception\Configuration;
87
use Codeception\Exception\ConfigurationException;
98
use Codeception\Exception\ImageDeviationException;
9+
use Codeception\Lib\Interfaces\MultiSession;
1010
use Codeception\Module as CodeceptionModule;
1111
use Codeception\Test\Descriptor;
1212
use Codeception\TestInterface;
@@ -281,6 +281,7 @@ private function compareVisualChanges($identifier, $elementID, $excludeElements,
281281
if (is_null($deviationResult["deviationImage"])) {
282282
return;
283283
}
284+
284285
$outOfMaxDeviation = !$seeChanges && $deviationResult["deviation"] > $maximumDeviation;
285286

286287
if ($outOfMaxDeviation) {
@@ -588,8 +589,7 @@ private function hideScrollbarsForScreenshot(): void
588589
*
589590
* @param array $excludeElements Array of strings, which should be not visible
590591
*/
591-
private
592-
function hideElementsForScreenshot(array $excludeElements)
592+
private function hideElementsForScreenshot(array $excludeElements)
593593
{
594594
foreach ($excludeElements as $element) {
595595
$this->hideElement($element);
@@ -604,8 +604,7 @@ function hideElementsForScreenshot(array $excludeElements)
604604
*
605605
* @param array $excludeElements array of strings, which should be visible again
606606
*/
607-
private
608-
function resetHideElementsForScreenshot(array $excludeElements)
607+
private function resetHideElementsForScreenshot(array $excludeElements)
609608
{
610609
foreach ($excludeElements as $element) {
611610
$this->showElement($element);
@@ -621,8 +620,7 @@ function resetHideElementsForScreenshot(array $excludeElements)
621620
* @param $identifier identifies your test object
622621
* @return string Path of the deviation image
623622
*/
624-
private
625-
function getDeviationScreenshotPath($identifier, $alternativePrefix = '')
623+
private function getDeviationScreenshotPath($identifier, $alternativePrefix = '')
626624
{
627625
$debugDir = Configuration::outputDir() . 'debug/';
628626
$prefix = ($alternativePrefix === '') ? 'compare' : $alternativePrefix;
@@ -638,8 +636,7 @@ function getDeviationScreenshotPath($identifier, $alternativePrefix = '')
638636
* @param $identifier identifies your test object
639637
* @return array Test result of image comparison
640638
*/
641-
private
642-
function compare($identifier)
639+
private function compare($identifier)
643640
{
644641
$expectedImagePath = $this->getExpectedScreenshotPath($identifier);
645642
$currentImagePath = $this->getScreenshotPath($identifier);
@@ -660,8 +657,7 @@ function compare($identifier)
660657
* @param $image2 Path to the current image in the screenshot
661658
* @return array Result of the comparison
662659
*/
663-
private
664-
function compareImages($image1, $image2)
660+
private function compareImages($image1, $image2)
665661
{
666662
$this->debug("Trying to compare $image1 with $image2");
667663

@@ -716,8 +712,7 @@ protected function _initVisualReport()
716712
/**
717713
* Get a new loaded module
718714
*/
719-
public
720-
function _initializeSession(): void
715+
public function _initializeSession(): void
721716
{
722717
$browserModule = $this->getBrowserModule();
723718

@@ -730,8 +725,7 @@ function _initializeSession(): void
730725
*
731726
* @param $session
732727
*/
733-
public
734-
function _loadSession($session): void
728+
public function _loadSession($session): void
735729
{
736730
$this->webDriver = $session;
737731
}
@@ -741,14 +735,12 @@ function _loadSession($session): void
741735
*
742736
* @return RemoteWebDriver
743737
*/
744-
public
745-
function _backupSession()
738+
public function _backupSession()
746739
{
747740
return $this->webDriver;
748741
}
749742

750-
public
751-
function _closeSession($session = null): void
743+
public function _closeSession($session = null): void
752744
{
753745
// this method will never be needed
754746
}

0 commit comments

Comments
 (0)