File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1212namespace EdgeTelemetrics \EventCorrelation \Rule ;
1313
1414use EdgeTelemetrics \EventCorrelation \Rule ;
15+ use function count ;
1516
1617/**
17- * Class Continuously
18+ * Class MatchSingle
1819 * @package EdgeTelemetrics\EventCorrelation\Rule
1920 */
2021abstract class MatchSingle extends Rule
2122{
22-
23+ public function __construct ()
24+ {
25+ parent ::__construct ();
26+ if (count (static ::EVENTS ) !== 1 ) {
27+ throw new \RuntimeException ('A rule of MatchSingle must have only one event group defined, ' . count (static ::EVENTS ) . ' are defined ' );
28+ }
29+ }
2330}
Original file line number Diff line number Diff line change 1212namespace EdgeTelemetrics \EventCorrelation \Rule ;
1313
1414use EdgeTelemetrics \EventCorrelation \Rule ;
15+ use function count ;
1516
1617/**
1718 * Class MatchSingleContinuously
@@ -21,6 +22,14 @@ abstract class MatchSingleContinuously extends Rule
2122{
2223 const EVENTS = [[]];
2324
25+ public function __construct ()
26+ {
27+ parent ::__construct ();
28+ if (count (static ::EVENTS ) !== 1 ) {
29+ throw new \RuntimeException ('A rule of MatchSingleContinuously must have only one event group defined, ' . count (static ::EVENTS ) . ' are defined ' );
30+ }
31+ }
32+
2433 public function complete () : bool
2534 {
2635 return false ;
You can’t perform that action at this time.
0 commit comments