Revert 981cc42 allow null in getDirectoryContents

Revert 981cc42 allowing null parameter in
`Environment::getDirectoryContents()` as type juggling of interface
feels like it will encourage bad habits that cannot be taken back later.

Commit 981cc429e282a379e8b4930cbc8fffaf89f07752