Smart Class in PHP using getter & setter
Hello readers, This article is about smart class in PHP so it will only contain business logic. In another article Clean Code In PHP , I wrote about clean coding in PHP for beginners. But if you want to go for next level then this article is for you. Every developers must try to be smart in coding. If you have mastered some architecture, then don’t stop there thinking that you have learned smart way of coding. Frankly speaking I’m not smart coder, but yes I always try to apply new techniques to make my code simple and smart. Yes, your code must be simple, there is myth in most of the beginners mind that the developer who writes complex code, which is not easy to understand is smart programmer. But it’s not true. I’ll write more about it in another article. Let’s focus on this article. This article is one step to make class simple and more focused towards its business logic. Let’s take example of class file from article Clean Code In PHP . <?php class Student {