HomePhabricator

DataSender: Add type hint and remove needless count() operation

Description

DataSender: Add type hint and remove needless count() operation

Rather than counting the number of items and determining whether
the result is zero, check only if the array has 'any' items,
which is achieved with a boolean check.

Also, the previous code (in theory) allowed $documenets to
be null, and still correctly "do nothing" because of legacy
tolerance inside count().

Rather than starting to fail in a confusing way for that use case,
add a type-hint to make sure any such code is explicitly detected.

For the record, I could not find any such code. Merely defensive.

Change-Id: Id1339dfc14732676316a63d19bd4a16c1412cd41

Details

Provenance
KrinkleAuthored on Sep 18 2018, 11:29 PM
Parents
rECIR88035bba11e1: Merge "Add basic test case for MappingConfigBuilder"
Branches
Unknown
Tags
Unknown
ChangeId
Id1339dfc14732676316a63d19bd4a16c1412cd41