mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 04:19:12 +00:00
Clean up code.
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user