groups = $groups; } public function matches( \WP_Post $post ): bool { if ( array() === $this->groups ) { return true; } foreach ( $this->groups as $group ) { if ( ! $group instanceof RuleGroup || ! $group->matches( $post ) ) { return false; } } return true; } }