`!empty($filteredAttributes)`? As you just want to know there are some filtered attributes, and not how many of them.