Move rules to class

__DIR__ doesn't work for composer plugins.