How to get a customer by his ID with the \Magento\Customer\Api\CustomerRepositoryInterface::getById()?

Context: How to get a customer by his ID?

Interface

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Customer/Api/CustomerRepositoryInterface.php#L40-L49

Implementation

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php#L246-L253

Usages

1

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Backend/Model/Session/Quote.php#L144-L164

2

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php#L322-L335

3

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Checkout/Controller/Action.php#L51-L69

4

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Checkout/Model/DefaultConfigProvider.php#L316-L332

5

6

7

8

9

10

11

12

13

14

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Customer/Controller/Account/Edit.php#L69-L80

15

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Customer/Controller/Account/ResetPasswordPost.php#L73-L90

16

https://github.com/magento/magento2/blob/ab051bf/app/code/Magento/Customer/Controller/Adminhtml/Index/Edit.php#L29-L49

See also: