Fix errors found by PHPStan
Test Plan:
Ran phpstan analyze --autoload-file=src/__phutil_library_init__.php -c phpstan.neon -l 1 src/ with phpstan.neon containing:
parameters: excludes_analyse: - */__tests__/*
Reviewers: Blessed Reviewers, epriestley
Reviewed By: Blessed Reviewers, epriestley
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D17364