How to programmatically get the field cardinality Is there any way to get the number of paragraphs' repeating limit for the entity's field which those paragraphs depends on?

I'm writing a code which creates paragraphs according to the data taken from a CSV data and and insert their target ID (and target revision ID) into user fields programmatically.

The repeating limits of paragraphs for each user field differs. 
Some user fields allow paragraphs to repeat only a few times and others expect them to repeat 10 times. 

So if my guess was correct it would be useful if I can get the number when collecting data from CSV and that's why I'm asking.
Thanks for the comments, I figured out a way to get the number(cardinality). Hope it helps someone. 

(array) $user_fields = \Drupal::service('entity_field.manager')-&gt;getFieldDefinitions('user', 'user');

foreach ($user_fields as $user_field_name =&gt; $user_field_definition) {
    (array) $cardinality = $user_field_definition-&gt;get('fieldStorage')-&gt;get('cardinality');
}