Yes it works, of course you have to put MyPathResolver.php somewhere where Yii auto loader find it (component directory or somewhere else what you put in 'import' part of the config).

MyPathResolver has no namespace, and it will be created deep in \yiiyuiclientscript\components namespace. So without the starting \ the class would be \yiiyuiclientscript\components\MyPathResolver.