Manuel Lemos - 2022-09-18 13:54:59 - In reply to message 1 from Mat Jung
Thank you for asking. This package is pending review. We sent you an email many months ago about the review's result. We don't know if you received that message.
Anyway, unfortunately, the word "class" in English is ambiguous. It may mean class, as in a teaching class. I may also say "class," as in a class of objects.
The PHP Classes site is about Object Oriented Programming because organizing code as classes of objects makes your applications a better organization and promotes the reuse of code.
For instance, you may have two functions with the same name in different classes for different purposes.
In procedural programming, defining two functions in different scripts with the same name would not be allowed by the PHP language because it would be ambiguous, and the PHP runtime engine would not be able to figure out which function you mean when applications call a global function with that name.
In Object Oriented Programming, ambiguity does not happen because different classes have different names.
Object Oriented Programming based on classes is good for you because it promotes a better organization of your code and helps you to have your code admired by more developers who want to reuse packages made of classes.
That is why we only approve packages made of classes of objects now.
Specifically, the package's code you sent is a PHP script made of procedural code.
We suggest you improve your code to turn it into a class of objects (Object Oriented Programming). There is a tutorial article to guide you on how to do that.
Mat Jung - 2022-09-21 23:24:52 - In reply to message 2 from Manuel Lemos
oh, I see.
I am glad it did not get rejected because the code is not available in github, composer, pear or pecl.
I did not know that you are about OOP.
I thought you are a student of php who put some study notes of your first php class online.
Well, when I see a trade off between Singleton and Structural code, I go for the structural as it requires less line of code.
How about asking the people for a namespace.
It also reduces the risk that two hello world methods from two authors are interfering with each other.
I can take the code offline if you prefer to keep your infrastructure free from structural code.