Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Follow-up to #2743815: Fill the Alt Text of the Image File using Google Vision API
Move the helper functions to a helper service.
google_vision_edit_alt_text
google_vision_set_alt_text
Comment | File | Size | Author |
---|---|---|---|
#4 | 2776441-4.patch | 8.82 KB | naveenvalecha |
#2 | Moved-functions-to-services-2776441-8-2.patch | 8.48 KB | ajalan065 |
Comments
Comment #2
ajalan065 CreditAttribution: ajalan065 at Google Summer of Code commentedHere is the patch with the functions moved to services.
I have also checked the entire module for proper comments and whitespaces and added new lines to the EOF, where they were missing.
Comment #3
naveenvalechaMake the service name to be "google_vision.helper" and keep all the helper functions into it related to all detection types.
Class name to be GoogleVisionHelper Also define the interface as well. GoogleVisionHelperInterface
Comment #4
naveenvalechaUploaded the rerolled patch with suggestions above
Comment #6
naveenvalechaCommitting and pushed to 8.x-1.x
While I was reviewing this I have also filed another issue #2783795: Define the Interface for GoogleVisionApi
Comment #7
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedMhh, why do we need interface GoogleVisionHelperInterface.php? Is it standard?
Comment #8
naveenvalechaYup this is made to keep in mind about the #2739855: Use code from https://github.com/ThijsFeryn/google-cloud-vision-api external library when we'll implement it later(i.e. when php7 will be requirement of the drupal).We will extend the interfaces of that library in our own interface and we'll not break the constructors of our own services(api) as per the d.o. B.C. policy
‘Holy Grail’ of programming is the reuse of existing code – interfaces play an important role in this.
Feel free to reopen if you need any more clarity on it.