PHP OOP Tutorial | What is a PHP interface



A PHP tutorial demonstrating how to use interfaces to make your code cleaner, reusable and adhere to certain solid principles. This PHP tutorial is aimed at PHP developers at a beginner level who are learning object orientated programming (OOP)

==== GET EARLY ACCESS TO FUTURE VIDEOS & TUTORIALS ====

Patron:

======== RECOMMENDED PROGRAMMING RESOURCES ========

Manning programming books and courses:

PHP Books:

PHP Hosting from Cloudways:

======== MY PROGRAMMING COURSES ========

Docker in Motion:
Skillshare courses:
Udemy courses:

======== WEB HOSTING DEALS ========

Cloudways: = 20% off first 6 months
Digital Ocean: = $10 off
Linode:

======== SUBSCRIBE TO THE NEWSLETTER ========

Join the Newsletter:

======== FOLLOW ME ========

Blog:
Facebook:
Instagram:
Twitter:
Pintrest:
Twitch:

======== MY TALKS ========

How to put your Docker image on a diet:

======== SUPPORT THE CHANNEL ========

Become a Patron:
Donate:
Help translate the videos:

======== VIDEO SETUP ========

Nikon D5300 Camera:
Logitech HD Pro Webcam C920
CRAPHY Photography Studio Lights:
Rode Procaster Microphone:
Rode VideoMic Pro:
Zoom H4NPro:

Nguồn: https://svdpch.org/

Xem thêm bài viết khác: https://svdpch.org/cong-nghe/

32 thoughts on “PHP OOP Tutorial | What is a PHP interface”

  1. 2020 and PHP is not dead and it's more alive than some other technologies! Has anyone heard anything of ruby for a while?!

    Reply
  2. I have tried to understand bits of "oop" whenever I came accross them. Most high level presentations left me with "When would I ever want THAT?".

    This particular film took me to the point I was really interested in.

    It just remains to say "Thanks for publishing it"

    Reply
  3. What I captured very well in this tutorial is that interfaces are mainly setting rules for your classes, but from the code you wrote about the payment gateway, don't you think I can decide not to use interface as I will write all the methods that is needed for the different classes and call the methods inside the process method for each of the classes. I will now call the process method for any of the classes in the paymentGateway Class because they already all have process

    Reply
  4. @Peter Fisher I wonder if is a good idea to use a trait instead of 2 more interfaces to give the extra functionality FraudCheck to the class that need it ? I would appreciate it if you reply me

    Reply
  5. Thank You Peter Fisher, I do very rarely subscribe to channels. But this video forced me to subscribe to your channel because this explained me in a simple and practical way of using interfaces in the real world environment. Thank you Jesus for leading me to this beautiful tutorial. God bless you. 🙂

    Reply
  6. I watched much tutorial for interface multi languages .. and i never understand why be should to use interface expect your tutorial I understand now, thank you so much ❤️

    Reply
  7. You actually helped me a lot in understanding not only interface.. But the true purpose of it which focusses on cohesion and coupling. I knew a good principle of design is to have high cohesion, low coupling.. but still don’t know how to implement it in a system… thank you for your explanation. By doing this way, it will be easier to modify the system in the future. Better lecturer than my university’s lol

    Reply
  8. In the case of shapes, couldnt you just use an abstract inheritance with abstract functions instead of interface?

    Reply
  9. Thanks for the great tutorial. There is a confusion I am having about the object you declared for the payment gateway example. Since you created an object only for mintfee and passed it how will other 2 class methods will be code. I tried to run the code you have given and only the mintfee class methods are called. Can you explain that and clear the doubt?

    Reply
  10. you know you use an interface to be able to swap between different classes… wouldnt a drop down menu on the users side do the same? or is this what the interface allows you to do on the users side?

    Reply
  11. i thought duplication was a bad thing..is there a better way to put the three shapes in the same class or call them with the same attributes somehow? i like the format of code and you on same screen..alot easier to concentrate. thx

    Reply
  12. I'm just seeing this video and I appreciate your simplified explanation, I just read a source on Dependency Injection and how ir eliminates tight coupling. This looks quite similar to what was implemented in the source I read. Could your example be likened to a somewhat implementation of Dependency Injection.

    Reply
  13. This is a great explanation. Just one thing. In the first 10 minutes with the shape example, you added ‘shape interface’ as a parameter in the addShape method. What does this do as I believe this would still work with only $shape as the argument?

    Reply

Leave a Comment