src/SavedSearches/SavedSearchesCommandHandler.php
private function getUiTIDSavedSearchRepository()
    {
        $metadata = $this->metadata->serialize();
        $tokenCredentials = $metadata['uitid_token_credentials'];

        $savedSearchesService = $this->savedSearchesServiceFactory->withTokenCredentials($tokenCredentials);

        $repository = new UiTIDSavedSearchRepository($savedSearchesService);

        if ($this->logger) {
            $repository->setLogger($this->logger);
        }

        return $repository;
    }
private function getUiTIDSavedSearchRepository()
    {
        $metadata = $this->metadata->serialize();
        $tokenCredentials = $metadata['uitid_token_credentials'];

        $savedSearchesService = $this->savedSearchesServiceFactory->withTokenCredentials($tokenCredentials);

        $repository = new UiTIDSavedSearchRepository($savedSearchesService);

        if ($this->logger) {
            $repository->setLogger($this->logger);
        }

        return $repository;
    }
private function getUiTIDSavedSearchRepository ( ) { $ metadata = $ this -> metadata -> serialize ( ) ; $ tokenCredentials = $ metadata [ 'uitid_token_credentials' ] ; $ savedSearchesService = $ this -> savedSearchesServiceFactory -> withTokenCredentials ( $ tokenCredentials ) ; $ repository = new UiTIDSavedSearchRepository ( $ savedSearchesService ) ; if ( $ this -> logger ) { $ repository -> setLogger ( $ this -> logger ) ; } return $ repository ; }
Should be called inside the handle methods and not inside the constructor,
because the metadata property is set or overwritten right before a handle
method is called.

@return UiTIDSavedSearchRepository
Should be called inside the handle methods and not inside the constructor because the metadata property is set or overwritten right before a handle method is called .