Yii 2 code style not use type hinting. So signature should be __construct($query, $config = array()). Same in other places.