Check if file is not a dir

`DefinitionFileLoader` doesn't take into account filetype. It causes confusing error message like
```
Invalid argument supplied for foreach()
```