Skip to content

Commit

Permalink
Merge pull request #28 from Icinga/introduce-base-filter
Browse files Browse the repository at this point in the history
Introduce trait `ipl\Stdlib\BaseFilter`
  • Loading branch information
nilmerg authored Dec 17, 2021
2 parents c64112c + 14fbc67 commit edbb664
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/BaseFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace ipl\Stdlib;

use ipl\Stdlib\Filter\Rule;

trait BaseFilter
{
/** @var Rule Base filter */
private $baseFilter;

/**
* Get whether a base filter has been set
*
* @return bool
*/
public function hasBaseFilter(): bool
{
return $this->baseFilter !== null;
}

/**
* Get the base filter
*
* @return ?Rule
*/
public function getBaseFilter()
{
return $this->baseFilter;
}

/**
* Set the base filter
*
* @param Rule $baseFilter
*
* @return $this
*/
public function setBaseFilter(Rule $baseFilter = null): self
{
$this->baseFilter = $baseFilter;

return $this;
}
}

0 comments on commit edbb664

Please sign in to comment.