Most of my coding have been personal projects. Several are big, such as dating website.
I learned PHP handwriting everything from scratch. So I've maintained that habit. Development is slower, but I'm not tethered to any external entities for upgrades.
Whenever a new version of PHP comes out, I just clone my existing website into a subdomain, and start testing with the latest version of PHP. Usually I get through fixing bugs in a matter hours. It's never that easy with frameworks. You must wait for them to upgrade the framework first.
Once I used Kohana framework for a project. Kohana died in 2017. If my project needs latest PHP, the entire application would have to be re-written. A real nightmare and waste of time and money. This very reason is why I don't use frameworks.
More discussions here...
https://www.quora.com/Why-do-some-people-still-use-pure-PHP-if-there-are-so-many-incredible-PHP-frameworks-like-Laravel
How do PHP devs today feel about using frameworks vs pure PHP?
Videos
The rules() method has fixed (better say "side effects free") result -- it uses fixed values only. Sure, it calls getPhoneNumberRules() from a trait but it also returns fixed array (always the same). It does not make changes anywhere else (internal state or external storage).
The messages() method calls a method from a trait that calls __() to get translated message... that can come from a different source (a DB, a file) and therefore potentially can throw exceptions if a storage (file/DB) is not readable. The IDE does not know for sure if __() makes changes to a file/DB -- it's not annotated as pure and PhpStorm cannot make such decision from the methods that it uses.
P.S. If this inspection annoys you (which I can understand) then I suggest you just ignore such inspection and lower its severity in PhpStorm Settings to "No highlighting, only fix" (Settings (Preferences on macOS) | Editor | Inspections | PHP | Attributes | '#[Pure]' attribute can be added)
If a function only depends on other pure functions, then it is also pure. Since getPhoneNumberRules() just returns a fixed array, it's pure, so rules() is also pure.
But messages() calls getPhoneNumberMessage(), which calls the __() function that can return a different localized message if the location state changes, so it's not pure.
Writing a complex application from scratch, I would definitly not use "bare PHP" : I would certainly use a framework : they provide :
- a large number of useful classes/methods
- some set of rules -- like "in which directory should controllers be saved", "how to write a view", ...
- MVC -- i.e. they help with better structuration of the project
Note that this answer is valid for both personnal projects, and professionnal projects.
There are several great Frameworks in PHP, like :
- Zend Framework
- Symfony
- CakePHP
- Code Igniter
- Kohana
One thing to remember : learning how to use a framework well will take some time : starting with a small project, before going for a big one, would probably be a good idea ;-)
Now, when you're asking yourself the question of "which framework should I choose", it's mostly a matter of personnal preferences... And here are a couple of questions/answers that might help a bit :
- PHP Framework Decision - Analysis paralysis!
- To use a PHP framework or not?
- PHP - MVC framework?
- Which PHP Framework is right for this project?
- Best PHP framework for an experienced PHP developer?
As you're asking me which Framework I would choose ; well :
- I really like Zend Framework, and often use Doctrine as ORM (it's the default ORM of Symfony, but can be used very easily with ZF)
- If I had to choose another one, I would probably go with Symfony, as I've seen it used on a couple of projects at work, and know many people who work with it and like it
If you already know that language, you should most definitely use a framework (unless you're a masochist).
For me, besides that fact that they're usually bundled with all sorts of great libraries, using a framework is all about using time effectively.
Most importantly, it will save you time. You're freed from the nitty-gritty of worrying about the foundation/architecture and are able to spend your time of the features of the application itself.
Also, it will save others time; especially since you plan on being all open sourcey.