Тёмный

Dependency Injection Container With & Without Reflection API Autowiring - Full PHP 8 Tutorial 

Program With Gio
Подписаться 54 тыс.
Просмотров 33 тыс.
50% 1

In this video, we implement a basic PSR-11 DI container. You will learn how DI containers work behind the scenes, what is autowiring & how to implement reflection API based autowiring.
SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments, any feedback is greatly appreciated
⭐ Become a Patreon: / programwithgio
THANK YOU!
🛠️ TOOLS & SERVICES I USE
Digital Ocean Hosting - Get 100$ credit - m.do.co/c/38b9...
Domains on Namecheap - namecheap.pxf....
Envato Elements - 1.envato.marke...
LESSON 3.4
Course Outline - github.com/gge...
Course Playlist - • Learn PHP The Right Wa...
RESOURCES
Lesson 3.3 (Dependency Injection) - • Dependency Injection &...
Source Repo - github.com/gge...
Reflection API - www.php.net/ma...
PSR-11 - www.php-fig.or...
PHP-DI - php-di.org/
Laravel's Service Container - laravel.com/do...
** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

Опубликовано:

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 182   
@pauldiez2696
@pauldiez2696 Год назад
Dude, your ability to simply breakdown each step, articulate and visually demonstrate, especially over a topic that can seem complex at the beginning, is amazing. Having knowledge and experience is one thing, but having the ability to explain it, like you just did, is a gift. Well done, good sir.
@ProgramWithGio
@ProgramWithGio Год назад
Thank you so much, this means a lot to me. I appreciate it 💙
@mwaas
@mwaas Год назад
what a great explanation. no one ever explain DI smooth like that. honestly you should be the main reference to who wants to dive deep in programing in right way
@ProgramWithGio
@ProgramWithGio Год назад
Thank you, appreciate it 🙌
@morteza55510
@morteza55510 Год назад
Was a hard lesson but I finally understood DI Containers, thanks Gio
@ProgramWithGio
@ProgramWithGio Год назад
Yay that's awesome 🙌
@benderbg
@benderbg 7 дней назад
Presented, chopped, cooked, served on a platter. Masterpiece.
@ProgramWithGio
@ProgramWithGio 5 дней назад
💙💙
@IvanStipic_Stiiv
@IvanStipic_Stiiv Год назад
Wow, I wish I had high quality tutorials like these back in a day. Great job!
@ProgramWithGio
@ProgramWithGio Год назад
Thank you 🙌
@BenjaminDLarsen
@BenjaminDLarsen Год назад
Yo this is freaking amazing, thank you so much for doing this. Super clear, concise content.
@ProgramWithGio
@ProgramWithGio Год назад
Glad you like it, thank you 🙌
@Danny-lf4ny
@Danny-lf4ny Год назад
I've been struggling to get my head around DI for a while, but the way you break this down is just brilliant. Thanks for this.
@ProgramWithGio
@ProgramWithGio Год назад
Happy to hear, thank you 💙💙
@JRCSalter
@JRCSalter 10 месяцев назад
So for the past week or so I have been trying to wrap my head around this concept. I have searched and read many articles about it, asked on a forum and received many replies, but nobody has explained it as well as this video. It has pretty much answered all the questions I have on the subject.
@ProgramWithGio
@ProgramWithGio 10 месяцев назад
That's awesome, really happy to hear this 💙
@emekatimothyiloba699
@emekatimothyiloba699 Год назад
Nice Job Gio. From the comments, i see that people understand what you are doing. but honestly i am lost. I think i need to go back to the previous videos
@ProgramWithGio
@ProgramWithGio Год назад
That's ok, sometimes it takes a bit longer to grasp the concept. You can try watching it again or go back to previous lesson. Feel free to ask questions if something doesn't make sense
@joshuasabac2389
@joshuasabac2389 8 месяцев назад
This is my 2nd week of the course and man, there's always something precious knowledge I gained from you. By far you are the only channel in youtube that I dont skip ads. Thanks a lot Gio.
@ProgramWithGio
@ProgramWithGio 8 месяцев назад
Thank you, I appreciate that 🙌
@bimg3158
@bimg3158 Год назад
Wow, i have been trying to undestard how DI work and how to be implemented, now i get the point. Thanks alot.
@ProgramWithGio
@ProgramWithGio Год назад
Glad it was helpful, thank you
@ntdash2153
@ntdash2153 2 года назад
It was awesome. First time I encounter DI techniques and I know for sure that I will start using them extensively. And thanks again for your awesome videos... 👍
@ProgramWithGio
@ProgramWithGio 2 года назад
Glad you like it, thank you
@koomooboo
@koomooboo Год назад
I was upgrading Symfony to v4.4 three months ago and got so confused with the DI and auto-wiring changes. I read most of their docs and still get confused. This is the best explanation ever!!! Thank you!
@ProgramWithGio
@ProgramWithGio Год назад
Glad to hear it was helpful, thank you
@Armando-px8hi
@Armando-px8hi Год назад
I think Learning this lessons well I can go from trying to get into internship to get to the senior at once. This is the type of the lessons that are hard but I have not watched to any other courses as well. Well done, Top G!
@ProgramWithGio
@ProgramWithGio Год назад
Yes, difficulty increases the more you progress through the course which is expected
@cichy86
@cichy86 Год назад
It is the best explanation of DI Container I ever saw, Wit tutorials like Yours going further with modern frameworks like symfony is a piece of cake.
@ProgramWithGio
@ProgramWithGio Год назад
Thank you 💙💙
@badrjeddab4549
@badrjeddab4549 Год назад
great work dude, now i have idea how the DI in frameworks work , and that awesome, using something and having the knowledge how it work behind scene it really great.thanks a lot
@ProgramWithGio
@ProgramWithGio Год назад
That's awesome, happy to hear 💙
@jean-francoisgelinas2172
@jean-francoisgelinas2172 2 года назад
This is by far the clearest explanation I've ever seen of how DI container works. It look like I'll have to watch the others 87 videos of yours :P
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you so much, glad you like it. Have fun :) more videos on the way 🙌
@user-zh2oz9fe4m
@user-zh2oz9fe4m Год назад
You definitely went the extra mile explaining this topic. Thanks a million!
@ProgramWithGio
@ProgramWithGio Год назад
Glad it was helpful
@saeedrasooli5931
@saeedrasooli5931 Год назад
this is obvious that you are so qualified in php, i have not ever watched a lesson like your lesson, Thank You 👋👋👌
@ProgramWithGio
@ProgramWithGio Год назад
Thank you, glad my videos are helpful 🙌
@MrRajaoui49
@MrRajaoui49 2 года назад
What a great explanation!!! Good job!
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you
@kenjohnsiosan9707
@kenjohnsiosan9707 11 месяцев назад
Sheesh, what a straightforward explanation about DI. thanks for sharing this knowledge to the community.
@ProgramWithGio
@ProgramWithGio 11 месяцев назад
Glad it was helpful, thank you
@hamidreza-mozhdeh
@hamidreza-mozhdeh 9 месяцев назад
Wow, I was surprised. you teach it amazingly. I wish I could do the same as you. I'll try my best.
@ProgramWithGio
@ProgramWithGio 9 месяцев назад
Thank you 🩵
@saqlainmustaqdurjoy7043
@saqlainmustaqdurjoy7043 Год назад
This is exactly what I was searching for. Thank you so much brother💙
@ProgramWithGio
@ProgramWithGio Год назад
Glad I could help, you're welcome 🙌
@AhmedMwafi
@AhmedMwafi 2 года назад
Clear and smooth, nailed it
@guillermofernandez2247
@guillermofernandez2247 2 года назад
Excellente way of explaining how it works under the hood, the why, and not just doing some tutorial of the magic of a framework
@ProgramWithGio
@ProgramWithGio 2 года назад
Glad you like it, thank you 💙
@DonatoBencosme
@DonatoBencosme 11 месяцев назад
Thanks you! You have a really simple way of explaining things.
@ProgramWithGio
@ProgramWithGio 11 месяцев назад
Thank you 🙏
@devnullex
@devnullex Год назад
Thank you. Your PHP series help me a lot
@ProgramWithGio
@ProgramWithGio Год назад
Glad to hear that, thank you so much 💙💙
@sadhakbj
@sadhakbj 2 года назад
Was waiting it from long time. Hope to see more videos sooner bro.
@ProgramWithGio
@ProgramWithGio 2 года назад
Yea, I wish I could upload faster. Not enough time unfortunately.
@sadhakbj
@sadhakbj 2 года назад
@@ProgramWithGio it's fine Gio. It's really great to have your contents to broaden my knowledge.
@rodrigoum
@rodrigoum 2 года назад
Thanks, this is a really awesome tutorial.
@ProgramWithGio
@ProgramWithGio 2 года назад
Glad you like it, thank you
@azzazkhansiddiqui
@azzazkhansiddiqui Год назад
Loved your video, your video was the only one which thoroughly explained how to make a custom DI container. I use Laravel a lot and love it's DI container but it's implementation goes way above my head. I have a request, can you please make videos to extend the DI container topic to support shared/singlton bindings, instance bindings, aliasing and caching? It would be very interesting and fun to learn. Once again thanks for the amazing content!
@ProgramWithGio
@ProgramWithGio Год назад
Thank you & thanks for the suggestion. I'll keep that in mind. I would also advise to use PHP-DI, it has a lot of useful features. That is what we use later in the series.
@ferripradana4265
@ferripradana4265 9 месяцев назад
Before, i used to wonder. how does laravel do autowiring. And You explained to me. Thanks a lot 😢
@ProgramWithGio
@ProgramWithGio 9 месяцев назад
That's great, happy to hear that
@benjaminiduwe2958
@benjaminiduwe2958 2 года назад
Thanks alot, great content on DI and reflection classes!
@ProgramWithGio
@ProgramWithGio 2 года назад
You're very welcome 💙
@expresscoding3525
@expresscoding3525 11 месяцев назад
Sir, I've to watch this specific videos multiple times to get better understanding, as I've to notice smaller things happening, like [this] captured by closure confused me for a longer time, and I've to use ChatGPT which informed. that closure captures surrounding environment, and because it's new topic for me, I've a request if you don't mind, like could you create a full-fledged DI. container things in a separate playlist again for all of us?? It would be much more helpful, because you've explained things, but about union types and other things, you skipped, as I'm the type of person who likes to go in-depth, it would be great if you add another playlist and make video on DI container only, like which we can use in production. Thank you for the course again... I'm still learning ☺😀
@ProgramWithGio
@ProgramWithGio 11 месяцев назад
Thanks for the suggestion. Btw this course I think has pretty much everything that you would need to learn PHP including union types. I would just watch it from beginning
@MePeterNicholls
@MePeterNicholls 2 года назад
This is starting to make sense to me
@ProgramWithGio
@ProgramWithGio 2 года назад
Awesome 👍
@topalek
@topalek Год назад
awesome explanation, thanx a lot
@ProgramWithGio
@ProgramWithGio Год назад
You're welcome 💙
@ibrahemmohammad8332
@ibrahemmohammad8332 Год назад
thank you for an amazing content, just one thing about this video in the container resolve function step 4 in case one of the $dependencies has constructor with builtin type for example: class SalesTaxService { public function __construct(protected float $x) { } } this will result to an exception, i don't know if it's intentional but i can think in a lot of cases where this will cause a problem ... shouldn't we handle it in different way and thanks again.
@ProgramWithGio
@ProgramWithGio Год назад
Yup its intentional, I mentioned that I think in the video that if you want to support scalar values then you need to modify the container implementation. Later in the series we use a well established container implementation PHP-DI, this lesson is just to prepare you on how container works behind the scenes in its basic form.
@QorashyTech
@QorashyTech 11 месяцев назад
Thanks!
@ProgramWithGio
@ProgramWithGio 11 месяцев назад
Thank you for your support 💙
@2008rol
@2008rol 2 года назад
I spent almost whole day watching your videos, have gained a lot. I hope you can make some other videos Laravel and React. If you have videos on Udemy etc, I am willing to pay for your lessons... (I really want to learn deeper in Laravel and what happens in laravel behind the scene )
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you. Glad you like my videos & find then helpful. Once we finish with this series I'll be making more Laravel content. I don't have any paid content at the moment but thank you for your interest 🙌
@berkayb7053
@berkayb7053 2 года назад
@@ProgramWithGio waiting for laravel & vue or TALL stack content. much appreciated to your php series.
@julienSibille
@julienSibille 2 года назад
@@ProgramWithGio If you want to produce paid content, don't forget to make a poll on which tehcnologies are most wanted ^^. If the ones you choose are mine, i would pay too, it's fair to get remuneration for so many time of investment.
@montser1994
@montser1994 2 года назад
Thanks a lot @Gio
@user-er5tf7lx9x
@user-er5tf7lx9x 8 месяцев назад
Greate explanation, thank you
@ProgramWithGio
@ProgramWithGio 8 месяцев назад
Glad it was helpful
@malikyo1263
@malikyo1263 3 месяца назад
Vraiment extraordinaire
@ProgramWithGio
@ProgramWithGio 3 месяца назад
Thank you
@zubayer1093
@zubayer1093 2 года назад
I love your videos, they are very detailed. I have a question how many videos are going to be in this series in total?
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you. I don't have the exact number since I plan on keeping this series updated with new PHP versions & changes. I would say at least 5-10 more videos for the third section before the project & then it will just be update videos
@michielstornebrink
@michielstornebrink 2 года назад
Bedankt
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 💙💙
@ahzamlathiya6367
@ahzamlathiya6367 2 года назад
Thanks for this amazing Content. I'm stuck on one issue though, how to resolve a dependency if it is a scalar data type. Also, how to pass some value nested down if the dependency has some scalar dependencies.
@ProgramWithGio
@ProgramWithGio 2 года назад
Yea that's a bit tricky. You will need to modify the reflection part in the Container & add the checks to see if its a built-in (scalar) type, if it is add it to the arguments list but also check if it has the default value. Without default values it will be trickier to implement it, you will have to play around with it. If I find time I might make a follow-up video on this towards the end of the series
@obadaalzidi6452
@obadaalzidi6452 5 месяцев назад
Thanks for the great explanation. You've mentioned that the ContainerInterface doesn't define set method because it may have many different implementations. But why the interface doesn't provide the method anyway ? at the end it's only an abstract method and any framewrok can provide it's own implementation and any class that implements this interface has to provide an implementation to the set method or it has no meaning. So, In my opinion there is no problem adding the set definition to the interface and adding union type to the ($concrete param) or am i missing something ?
@ProgramWithGio
@ProgramWithGio 5 месяцев назад
It's explained in the PSR documentation. Set method is up to the implementor, they don't want to enforce a specific contract on parameters or its return
@invgreat5608
@invgreat5608 Год назад
You are super great ❤️
@ProgramWithGio
@ProgramWithGio Год назад
Thank you 💙
@Alex-3XL
@Alex-3XL Год назад
Thank you for your video course. Please advise - this lesson missing index.php, but in your example it works on localhost:8000 just by reloading the page. What is in the index.php? Thanks!
@ProgramWithGio
@ProgramWithGio Год назад
You can check it in the source code, public/index.php. In the description of the video there is a link to the source repository.
@weak5205
@weak5205 4 месяца назад
Greate video! but can you explain how these instances can be resolved? If im not wrong your resolve method will call get() but the get() also call resolve(), can you explain this?
@ProgramWithGio
@ProgramWithGio 3 месяца назад
Resolve uses reflection to inspect the class its trying to resolve, it only calls the get method if one of the dependencies of the class its trying to resolve is also a class that needs to be resolved, so its like a recursion traversing through the tree
@issaissifou3579
@issaissifou3579 2 года назад
Thank you so much
@ProgramWithGio
@ProgramWithGio 2 года назад
You're welcome
@donjoes3750
@donjoes3750 Год назад
Maybe I am understanding it wrong but... how do you handle the base types? If I understand this tutorial right (which maybe I do not...) they will throw an exception within the container? Thank you for your explanations!
@ProgramWithGio
@ProgramWithGio Год назад
Do you mean interfaces? There is another video covering interface injection
@devnullex
@devnullex Год назад
Thank you. Great video. But what if in the constructor, apart from dependencies, we have other parameters, e.g. an array or an int ?
@ProgramWithGio
@ProgramWithGio Год назад
Then you'll have to pass them down, scalar values can't be passed down via container.
@Zubbee
@Zubbee 2 года назад
Wow. This was a lot tougher. I've noted again and again that you hardly use the "else if" and "else" keywords. Which I think is pretty cool. But is there any technical reason why you don't use them? Generally, I would have to go through this again (even after going through it twice) and I would have to read up on Reflection APIs and it's methods cause it's all new to me (except one time you used it to break the encapsulation even though a property was set to private). Thanks for these lessons Gio.
@ProgramWithGio
@ProgramWithGio 2 года назад
It's totally normal, so don't worry about it. Yes I don't usually use else or else if unless I really need it. No technical reason, just preference.
@Zubbee
@Zubbee 2 года назад
@@ProgramWithGio oh, okay Gio. Thanks
@guillermofernandez2247
@guillermofernandez2247 Год назад
A university professor once told me to not use else or else if to make different paths, only if statements to return some false condition or to throw exceptions. That I should have a main "happy" course until the end of the method and exits on undesired or unexpected conditions. Like a highway and its exits, it doesn't usually have branches or splits in two highways, there are always exceptions I know, but it's usually one main highway path with exits on the sides. As @@ProgramWithGio said, it is more a readable code reason than technical one.
@federicobau8651
@federicobau8651 2 года назад
Fantastic video, thanks
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 🙌
@Armando-px8hi
@Armando-px8hi Год назад
Also please let me know if I understand it correctly Gio, So the Dependency Injection is a design pattern where dependencies of a class are provided from the outside, rather than created internally. The Dependency Injection Container is a tool that automates the management of object dependencies within a software system?
@ProgramWithGio
@ProgramWithGio Год назад
Yes pretty much
@truthteachers
@truthteachers Год назад
Bro, I going through the whole of section 3 only this time i checkout the complete documentation on the subject and also other example videos. Re-visting this video, at timestamp 5:41, throwing NotFoundException you used the term "binding". In my opinion raised a question "binding to what?". Correct me if i am wrong, what is meant here is that it should be "is not found in the container entries".
@ProgramWithGio
@ProgramWithGio Год назад
Class can have a binding or an entry which binds it to another class or a concrete implementation. It's just a term, "not found in container entries" is also correct, up to you how you word your errors/exceptions
@truthteachers
@truthteachers Год назад
@@ProgramWithGio I agree with you in that its up to us what we want the message should be but sane and good quality assurance practice is to the throw user-meaningful message. That way when a developer, at some later date, who get hits by this error will know exactly where to debug from. I have a test crm system (open source) which throws all sorts of cryptic messages like this and when we report the problem they themselves dont know and all they do is keep quiet.
@ProgramWithGio
@ProgramWithGio Год назад
@@truthteachers This is not cryptic though, its a legit error message and has a meaning. "Binding" has other meanings too, Laravel also uses this term a lot so not sure what the confusion is. This error message is not meant for user first of all & is meant to be logged, but the word "binding" makes perfect sense in this scenario.
@truthteachers
@truthteachers Год назад
@@ProgramWithGio Pls don't get me wrong. This just an intellectual discussion of different points of view. Thank you for being patient with me and taking the effort to reply.
@ProgramWithGio
@ProgramWithGio Год назад
@@truthteachers No worries, that's why I said that either wording makes sense, whether it's "binding" or "entry" they both deliver the same meaning at the end, for some "entry" might be more clearer while for some "binding" might be more clearer, it's up to the developer to decide what makes more sense for their app
@kotyk-obormotyk
@kotyk-obormotyk 2 года назад
Дякую!💙💛
@ProgramWithGio
@ProgramWithGio 2 года назад
You're welcome & thank you 💙💛
@liym-ntairaylangdji3441
@liym-ntairaylangdji3441 9 месяцев назад
Hi Sir, will wish to know the difference between ReflectionNamedType and ReflectionUnionTypes. And as of php 8.1, ReflectionIntersectionType has been added. Will wish to know the difference between them
@liym-ntairaylangdji3441
@liym-ntairaylangdji3441 9 месяцев назад
And please, how can I reach to you privately and how do I send the codes for the exercises?
@ProgramWithGio
@ProgramWithGio 9 месяцев назад
ReflectionNamedType is related to named arguments, ReflectionUnionTypes is related to union types & ReflectionIntersectionType related to intersection types :). I can be reached via Twitter (X)
@MRbYemma
@MRbYemma 2 года назад
Wow! Thank you!
@lahoucineoldakdim7778
@lahoucineoldakdim7778 Год назад
Great tuto ✅ What if we have for example to co configure Database class How to inject it in controller
@ProgramWithGio
@ProgramWithGio Год назад
Thank you. You would bind implementation in container and then inject it like a regular class. We do that in one of the later videos, if you keep watching you'll get to it
@lahoucineoldakdim7778
@lahoucineoldakdim7778 Год назад
@@ProgramWithGio I confused in case when i set a string value in container case 1 : set(DB::class, DB::class); case 2 set("version" , "1.1");
@ProgramWithGio
@ProgramWithGio Год назад
@@lahoucineoldakdim7778 what is the version for?
@lahoucineoldakdim7778
@lahoucineoldakdim7778 Год назад
@@ProgramWithGio It is Just a setting keys for the application
@ProgramWithGio
@ProgramWithGio Год назад
@@lahoucineoldakdim7778 you don't need that in the container, that can just be a config file & environment variable. Keep watching the series and you'll get to the point where we start building app using proper DI implementation & config files
@bakosyy
@bakosyy 9 месяцев назад
Hey Gio. Can you explain how can we use methods like ->get() for `Container $c` function parameter if we did not instantiate it first? The code is following: static::$container->set(InvoiceService::class, function (Container $c) { return new InvoiceService( $c->get(SalesTaxService::class), $c->get(PaymentGatewayService::class), $c->get(EmailService::class)); });
@ProgramWithGio
@ProgramWithGio 9 месяцев назад
Hey, because the container instance is passed into the closure. Its already a proper container instance
@TomiBorchert
@TomiBorchert Год назад
13:00 what is that when the whole line is surrounded in parenthesis? seems like you are not assign it to a variable. the new container
@ProgramWithGio
@ProgramWithGio Год назад
That way you dont have to assign to a variable & just call methods on it. When you instantiate a new class its just an object right? So you can either assign it to a variable & then call methods on that variable or call methods directly on it.
@memack101
@memack101 2 года назад
Thank you.
@ProgramWithGio
@ProgramWithGio 2 года назад
You're welcome 💙
@guillermofernandez2247
@guillermofernandez2247 Год назад
1:24 Why do you say to not use it production? security issues? performance?... 🤔
@ProgramWithGio
@ProgramWithGio Год назад
Because it does not have all the necessary features & does not account for edge cases. For production you should use a well maintained community package like PHP-DI which we cover later in the series as well. This lesson is just to understand how Container works in a nutshell.
@elmarzougui
@elmarzougui 2 года назад
After that vedio i think that i can build my slim framwork 😄😄😄
@ProgramWithGio
@ProgramWithGio 2 года назад
That's great 👍
@borisbar4148
@borisbar4148 Год назад
I’m running into the problem that I can’t use promoted properties as constructor parameters in my Controller classes anymore. It says the params are invalid. Could you tell me if that’s intended? Thanks a lot!
@ProgramWithGio
@ProgramWithGio Год назад
What PHP version are you using? Can you paste in exact error message?
@borisbar4148
@borisbar4148 Год назад
@@ProgramWithGio Sorry for the very late response! I’m using PHP 8.1.4 on my development server and the error message says: Failed to resolve class "App\Controllers\Pages\Games\ReleasesController" because invalid param "test". The first condition $type instanceof ReflectionNamedType returns true, but the second condition !$type -> isBuiltin() returns false. As far as I can tell the array_map function that defines the $dependencies variable is built in a way that it always throws an error when the type is something other than a Class name. Or am I getting something wrong?
@ProgramWithGio
@ProgramWithGio Год назад
@@borisbar4148 no worries. I would need to see the code to be able to help. You can DM me on Twitter and sende screenshots or link to GitHub repo and I can take a look
@morteza55510
@morteza55510 Год назад
Why did we make the container property static? 6:35
@ProgramWithGio
@ProgramWithGio Год назад
So that it's one instance per app & easily accessible. It's just an example of how Container works behind the scenes, later we use a package & don't use the static, so it's just a temporary measure
@morteza55510
@morteza55510 Год назад
@@ProgramWithGio got it, thanks
@atakansenturk563
@atakansenturk563 Год назад
Do you work with facade design ?
@ProgramWithGio
@ProgramWithGio Год назад
If you mean Facade pattern that is used in Laravel then most of the time no. I prefer dependency injection
@faramarztayyari3734
@faramarztayyari3734 2 года назад
Hi Approximately how many parts is this tutorial supposed to be?
@ProgramWithGio
@ProgramWithGio 2 года назад
Hello. I don't have the exact number but there are few more topics I want cover before ending the series
@LuisSilva-kf9iy
@LuisSilva-kf9iy 2 года назад
How and where do you get all those informations?
@ProgramWithGio
@ProgramWithGio 2 года назад
Documentation, source code, articles & experience
@LuisSilva-kf9iy
@LuisSilva-kf9iy 2 года назад
@@ProgramWithGio Do you You give private training?
@ProgramWithGio
@ProgramWithGio 2 года назад
@@LuisSilva-kf9iy not at the moment
@LuisSilva-kf9iy
@LuisSilva-kf9iy 2 года назад
@@ProgramWithGio witch email can I contact you, I would like to keep in contact with you.
@ProgramWithGio
@ProgramWithGio 2 года назад
@@LuisSilva-kf9iy you can stay in touch on Twitter.
@mdrakib-m1m5v
@mdrakib-m1m5v 2 года назад
What's your laptop/desktop configuration?
@ProgramWithGio
@ProgramWithGio 2 года назад
Not sure I understand the question. What configuration are you referring to?
@benjaminspinola1788
@benjaminspinola1788 8 месяцев назад
I have trouble understanding why that works: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-78Vpg97rQwE.html My question is, that the invoice service depends upon the SalesTaxService, PaymentService and EmailService, which are set LATER in the code. Why is it no resulting in an error, since the InvoiceService asks for these Service EARLIER in the code.
@ProgramWithGio
@ProgramWithGio 8 месяцев назад
Because it is not resolved until its needed, notice its inside closure. The code does not execute until its needed
@beticohernandez9536
@beticohernandez9536 2 года назад
Hi there. What project do you have in mind?
@ProgramWithGio
@ProgramWithGio 2 года назад
I talked a little bit about that in the end of section 1 video. It's going to be a very simple budgeting/expense tracking app but it might change but so far that is what I think we'll be building.
@beticohernandez9536
@beticohernandez9536 2 года назад
The truth is, I don't speak English, I see your videos and I understand them.
@truthteachers
@truthteachers Год назад
Gio, although there was a lot in here that i needed to digest, this is fantastic. It gave me great understanding of PHP. My only worry is that if i used all these advanced stuff in my app, my other co-developers will have a hard time understanding the app 😀
@ProgramWithGio
@ProgramWithGio Год назад
Glad to hear that, you don't have to incorporate this into your existing codebase, it's there for you to understand how DI containers work, for your codebase if you need a good working DI container use PHP-DI, we cover that later in this course
@truthteachers
@truthteachers Год назад
@@ProgramWithGio I skimmed thru PHP-DI and looking forward to that video, Will progress each step, as you advised. Tq.
@dnkmvp
@dnkmvp Год назад
can u add vietnamese subtitle, please !!!!!
@ProgramWithGio
@ProgramWithGio Год назад
RU-vid adds subtitles automatically
@user-iy1iq3by1o
@user-iy1iq3by1o Год назад
is it magic?
@ProgramWithGio
@ProgramWithGio Год назад
Yup, sort of 🙂
@tomassylt
@tomassylt Год назад
nette framework have better di container
@ProgramWithGio
@ProgramWithGio Год назад
Haven't used that framework so I wouldn't know. Anything specific that's better?
@kevdev123
@kevdev123 6 месяцев назад
if you are using composer, you have already lost control of your code.
@ProgramWithGio
@ProgramWithGio 6 месяцев назад
Disagree but whatever works for you 👍
@abdfadee8267
@abdfadee8267 9 месяцев назад
@ProgramWithGio
@ProgramWithGio 9 месяцев назад
👋
@QorashyTech
@QorashyTech 11 месяцев назад
Thanks!
@ProgramWithGio
@ProgramWithGio 11 месяцев назад
Thanks alot for the support 🙏💙
Далее
Mastering Dependency Injection In Golang
14:29
Просмотров 48 тыс.
Cute kitty gadget 💛💕
00:23
Просмотров 14 млн
Аруси Точики ❤️❤️❤️
00:13
Просмотров 353 тыс.
10 React Antipatterns to Avoid - Code This, Not That!
8:55
How Senior Programmers ACTUALLY Write Code
13:37
Просмотров 1,5 млн
What’s new in Angular v18
20:08
Просмотров 120 тыс.
Rust For PHP Developers
59:42
Просмотров 25 тыс.
Cute kitty gadget 💛💕
00:23
Просмотров 14 млн