Added error handling for glob()

glob() returns false for an error, which causes the foreach to raise
invalid argument warnings
Modified formatting to match project reqs

PSR-2 is exactly why I didn't miss working with PHP. Same readability
on triple the lines.
Merge pull request #4 from robertdp/develop-2

Added error handling for glob()