Added additional type check.

Related to https://scrutinizer-ci.com/g/phpDocumentor/phpDocumentor2/inspections/01df17f4-8aac-49fc-b46a-0e99c42407a8/issues/files/src/phpDocumentor/Descriptor/ConstantDescriptor.php?status=existing&orderField=path&order=asc
Merge pull request #1174 from siad007/patch-20

Added additional type check.