Fix PHP warning: invalid argument for foreach in comment and photo

When cache dir is empty - argument is bool:false.
Warning is fire up when comment cache clear and photo cache (don't test for photo  but check for false must be set).

Also add PHPDoc in class - to be more friendly for IDE and community