V1.0.0/2282

You can just use ternary since you are just checking if the type is set.
 maybe something like this:
```php
$sql = "SELECT DISTINCT tags FROM " . self::TABLE_NAME . " WHERE tags <> ''";
$sql .= (($type) ? " AND type = '{$type}'" : "") . " GROUP BY tags";
```