fix typos, set code style to PSR1-2, fix return type in expects