Clean up code.

This commit is contained in:
James Cole
2025-05-04 17:41:26 +02:00
parent e28e538272
commit 0573bf2402
147 changed files with 1758 additions and 1770 deletions

View File

@@ -34,28 +34,6 @@ abstract class Node
{
protected bool $prohibited;
/**
* Returns the prohibited status of the node, optionally inverted based on flipFlag
*
* Flipping is used when a node is inside a NodeGroup that has a prohibited status itself, causing inversion of the
* query parts inside
*
* @param bool $flipFlag When true, inverts the prohibited status
*
* @return bool The (potentially inverted) prohibited status
*/
public function isProhibited(bool $flipFlag): bool
{
if ($flipFlag) {
// Log::debug(sprintf('This %s is (flipped) now prohibited: %s',get_class($this), var_export(!$this->prohibited, true)));
return !$this->prohibited;
}
// Log::debug(sprintf('This %s is (not flipped) now prohibited: %s',get_class($this), var_export($this->prohibited, true)));
return $this->prohibited;
}
public function equals(self $compare): bool
{
if ($compare->isProhibited(false) !== $this->isProhibited(false)) {
@@ -87,4 +65,26 @@ abstract class Node
return true;
}
/**
* Returns the prohibited status of the node, optionally inverted based on flipFlag
*
* Flipping is used when a node is inside a NodeGroup that has a prohibited status itself, causing inversion of the
* query parts inside
*
* @param bool $flipFlag When true, inverts the prohibited status
*
* @return bool The (potentially inverted) prohibited status
*/
public function isProhibited(bool $flipFlag): bool
{
if ($flipFlag) {
// Log::debug(sprintf('This %s is (flipped) now prohibited: %s',get_class($this), var_export(!$this->prohibited, true)));
return !$this->prohibited;
}
// Log::debug(sprintf('This %s is (not flipped) now prohibited: %s',get_class($this), var_export($this->prohibited, true)));
return $this->prohibited;
}
}