PHP Classes

How to get a class approved?

Recommend this page to a friend!

      Top level forums  >  Site  >  Features  >  How to get a class approved?  >  (Un) Subscribe thread alerts  
Subject:How to get a class approved?
Summary:12090 is still unapproved
Messages:10
Author:Mat Jung
Date:2022-09-17 11:19:15
Update:2022-10-28 00:22:09
 

  1. How to get a class approved?   Reply   Report abuse  
Picture of Mat Jung Mat Jung - 2022-09-18 11:58:44
phpclasses.org/package/12090-PHP-Zi ...

Some time ago or even longer, I uploaded a class.
In view My Classes it is listed as Unapproved.

What do I need to do, to progress in the Approval process?

  2. Re: How to get a class approved?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-09-18 13:54:59 - In reply to message 1 from Mat Jung
Hello Mat,

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.

phpclasses.org/blog/post/178-Why-is ...

Would you like to convert your package code to a class so we can approve it quickly?

  3. Re: How to get a class approved?   Reply   Report abuse  
Picture of Mat Jung Mat Jung - 2022-09-21 23:24:52 - In reply to message 2 from Manuel Lemos
Hi Manuel
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.
Just kidding.
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.

  4. Re: How to get a class approved?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-09-21 23:45:29 - In reply to message 3 from Mat Jung
Hello Mat,

Your package it was not rejected. It is still pending review.

We need more time developing a new state that would be pending contributor improvements.

That would allow making changes to the code so we can still approve it.

There are a few other package submissions in that state of pending a review for the same reason yours is pending.

Adding a namespace could avoid name collision. It would still not make the package code be done in object-oriented programming.

Would it be difficult for you to convert your code into a class?

  5. Re: How to get a class approved?   Reply   Report abuse  
Picture of Mat Jung Mat Jung - 2022-09-30 16:10:54 - In reply to message 4 from Manuel Lemos
It provably would not.
But why turn something into OOP, when the OOP does not add value in the particular case.

  6. Re: How to get a class approved?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-09-30 22:48:32 - In reply to message 5 from Mat Jung
Hello Mat,

Thank you for asking. OOP is a good practice to promote better reuse and organization of the code of your projects.

If you use OOP, it increases the interest of others to use your package in their projects.

I explained that in more detail in the article below at the end of this message.

So the OOP requirement is a rule for acceptance of all packages. We need to have laws that all contributors follow to give equal opportunities to all contributors.

It is up to you to decide to benefit from the exposure they can give you if you comply with the rules. Whatever you decide is okay for us. We respect your decision.

If you have a better suggestion to improve the site, we would undoubtedly be very interested in listening.

phpclasses.org/blog/post/178-Why-is ...

  7. Re: How to get a class approved?   Reply   Report abuse  
Picture of Mat Jung Mat Jung - 2022-10-05 16:31:08 - In reply to message 6 from Manuel Lemos
Hi Manuel
I was having a quick look into the source code.
phpclasses.org/package/12090-PHP-Zi ...

The code is an use case / demonstration to work with two default classes: RecursiveDirectoryIterator and ZipArchive

Maybe the content fits better into Blog Post or Tutorial then Class.

There is no point to wrap that code into another class.

  8. Re: How to get a class approved?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-10-05 16:36:13 - In reply to message 7 from Mat Jung
That is OK. Would you like me to remove that package?

  9. Re: How to get a class approved?   Reply   Report abuse  
Picture of Mat Jung Mat Jung - 2022-10-27 21:33:54 - In reply to message 8 from Manuel Lemos
Sorry for the late response. Was busy with other stuff.
Go ahead, move it to where it fits better.

  10. Re: How to get a class approved?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-10-28 00:22:09 - In reply to message 9 from Mat Jung
Hello Matt,

I plan a new state for packages that will allow future improvements if you change your mind. So I will no longer remove packages not to upset any developer.