Jump to content

[SOLVED] [addons validation] Visibility must be declared on method


bellini13

Recommended Posts

Can you please provide an explanation as to why my module must declare 'visibility' on a function (ie  public, private, protected)

 

As defined by the PHP documentation, PHP functions without an explicit declaration are automatically defined as public.

 
Method Visibility

Class methods may be defined as public, private, or protected. Methods declared without any explicit visibility keyword are defined as public.

 

http://www.php.net/manual/en/language.oop5.visibility.php

 

 

Why would a module I create be rejected for not specifically stating "public"?

Link to comment
Share on other sites

Hi Samyha, I replied to the declined email I received and I await their response.  But I posted this because it is better to have an open discussion. 

 

If there are pointless validations occurring, that are causing declines, then that is a waste of resources and time. 

 

I'd like to understand why this validation is occurring, and what benefit is being received by having this validation?

Link to comment
Share on other sites

I understand your approach, but only the Addons team will be able to answer that request, we don't do support service on the forum, it is entirely dedicated to members using PrestaShop and who need help to improve and set their online store  :).

Link to comment
Share on other sites

Hello all, here is a short summary of our Email correspondence. 

 

 We understand that the simple "public" notation does not do anything to improve the code at a technical standpoint. That said, it does help improve our team efficiency when all contributors have the same standard. 
 
   Maybe "Code quality" is not the right way to put it, maybe "Code Readability". It helps the Addons team read and validate modules. In any case, I trust that you respect the reasons why we must insist on using the "public" function.
 
bellini13 was satisfied with the answer and appreciative that we gave him "some latitude to challenge" our stance.
 
Feel free to add onto this thread for a short time before it's closed. Thanks!
  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...