Pass function to array in Magento 2.3

I have this code to get the item quantity from Magento 2.3 product namespace Hello\SourceItemData\Model; use Exception; use Psr\Log\LoggerInterface; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\InventoryApi\Api\Data\SourceItemInterface; use Magento\InventoryApi\Api\SourceItemRepositoryInterface; class SourceItem { /** * @var SearchCriteriaBuilder */ private $searchCriteriaBuilder; /** * @var SourceItemRepositoryInterface */ private $sourceItemRepository; /** * @var LoggerInterface */ private $logger; public function __construct( SearchCriteriaBuilder $searchCriteriaBuilder, SourceItemRepositoryInterface…

Details