Skip to content

Commit

Permalink
Simplified logic in applyFocusPatterns().
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Dec 1, 2016
1 parent 7519df2 commit 261d642
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/Core/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,25 +192,17 @@ public function applyFocusPatterns($focusPattern, $skipPattern = null)
{
$title = $this->getTitle();

if ($focusPattern === null) {
$isFocused = true;
} else {
$isFocused = preg_match($focusPattern, $title);
}

if (!$isFocused) {
if ($skipPattern !== null && preg_match($skipPattern, $title)) {
$this->focused = false;

return;
}

if ($skipPattern === null) {
if ($focusPattern === null) {
$this->focused = true;

return;
} else {
$this->focused = preg_match($focusPattern, $title);
}

$this->focused = !preg_match($skipPattern, $title);
}

/**
Expand Down

0 comments on commit 261d642

Please sign in to comment.