Changed conditional to PSR-2 format. Refactored to remove duplicate array check.