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

Поделиться
HTML-код
  • Опубликовано: 11 окт 2021
  • 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/38b935ad74e5
    Domains on Namecheap - namecheap.pxf.io/rnRjdQ
    Envato Elements - 1.envato.market/c/2937311/298...
    LESSON 3.4
    Course Outline - github.com/ggelashvili/learnp...
    Course Playlist - • Learn PHP The Right Wa...
    RESOURCES
    Lesson 3.3 (Dependency Injection) - • Dependency Injection &...
    Source Repo - github.com/ggelashvili/learnp...
    Reflection API - www.php.net/manual/en/book.re...
    PSR-11 - www.php-fig.org/psr/psr-11/
    PHP-DI - php-di.org/
    Laravel's Service Container - laravel.com/docs/container
    ** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

Комментарии • 182

  • @pauldiez2696
    @pauldiez2696 Год назад +16

    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 Год назад +15

    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

  • @mortezaayashi9581
    @mortezaayashi9581 Год назад +3

    Was a hard lesson but I finally understood DI Containers, thanks Gio

  • @IvanStipic_Stiiv
    @IvanStipic_Stiiv Год назад +7

    Wow, I wish I had high quality tutorials like these back in a day. Great job!

  • @BenjaminDLarsen
    @BenjaminDLarsen Год назад +11

    Yo this is freaking amazing, thank you so much for doing this. Super clear, concise content.

  • @Danny-lf4ny
    @Danny-lf4ny Год назад +4

    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.

  • @JRCSalter
    @JRCSalter 7 месяцев назад +1

    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  7 месяцев назад

      That's awesome, really happy to hear this 💙

  • @emekatimothyiloba699
    @emekatimothyiloba699 11 месяцев назад

    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  11 месяцев назад +1

      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 6 месяцев назад +1

    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.

  • @AhmedMwafi
    @AhmedMwafi 2 года назад +2

    Clear and smooth, nailed it

  • @bimg3158
    @bimg3158 Год назад

    Wow, i have been trying to undestard how DI work and how to be implemented, now i get the point. Thanks alot.

  • @DonatoBencosme
    @DonatoBencosme 8 месяцев назад

    Thanks you! You have a really simple way of explaining things.

  • @user-zh2oz9fe4m
    @user-zh2oz9fe4m 10 месяцев назад

    You definitely went the extra mile explaining this topic. Thanks a million!

  • @devnullex
    @devnullex Год назад +1

    Thank you. Your PHP series help me a lot

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      Glad to hear that, thank you so much 💙💙

  • @saqlainmustaqdurjoy7043
    @saqlainmustaqdurjoy7043 Год назад +1

    This is exactly what I was searching for. Thank you so much brother💙

  • @ntdash2153
    @ntdash2153 Год назад +3

    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... 👍

  • @MrRajaoui49
    @MrRajaoui49 Год назад +3

    What a great explanation!!!
    Good job!

  • @badrjeddab4549
    @badrjeddab4549 10 месяцев назад

    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  10 месяцев назад

      That's awesome, happy to hear 💙

  • @jean-francoisgelinas2172
    @jean-francoisgelinas2172 2 года назад +1

    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 🙌

  • @kenjohnsiosan9707
    @kenjohnsiosan9707 8 месяцев назад

    Sheesh, what a straightforward explanation about DI. thanks for sharing this knowledge to the community.

  • @Armando-px8hi
    @Armando-px8hi 10 месяцев назад

    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  10 месяцев назад

      Yes, difficulty increases the more you progress through the course which is expected

  • @benjaminiduwe2958
    @benjaminiduwe2958 Год назад +1

    Thanks alot, great content on DI and reflection classes!

  • @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.

  • @rodrigoum
    @rodrigoum 2 года назад +2

    Thanks, this is a really awesome tutorial.

  • @montser1994
    @montser1994 2 года назад +1

    Thanks a lot @Gio

  • @koomooboo
    @koomooboo 9 месяцев назад

    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  9 месяцев назад

      Glad to hear it was helpful, thank you

  • @topalek
    @topalek Год назад

    awesome explanation, thanx a lot

  • @guillermofernandez2247
    @guillermofernandez2247 Год назад

    Excellente way of explaining how it works under the hood, the why, and not just doing some tutorial of the magic of a framework

  • @sadhakbj
    @sadhakbj 2 года назад +2

    Was waiting it from long time. Hope to see more videos sooner bro.

    • @ProgramWithGio
      @ProgramWithGio  2 года назад +3

      Yea, I wish I could upload faster. Not enough time unfortunately.

    • @sadhakbj
      @sadhakbj 2 года назад +1

      @@ProgramWithGio it's fine Gio. It's really great to have your contents to broaden my knowledge.

  • @user-er5tf7lx9x
    @user-er5tf7lx9x 5 месяцев назад

    Greate explanation, thank you

  • @hamidreza-mozhdeh
    @hamidreza-mozhdeh 6 месяцев назад

    Wow, I was surprised. you teach it amazingly. I wish I could do the same as you. I'll try my best.

  • @invgreat5608
    @invgreat5608 Год назад

    You are super great ❤️

  • @malikyo1263
    @malikyo1263 28 дней назад

    Vraiment extraordinaire

  • @federicobau8651
    @federicobau8651 2 года назад

    Fantastic video, thanks

  • @MRbYemma
    @MRbYemma 2 года назад

    Wow! Thank you!

  • @saeedrasooli5931
    @saeedrasooli5931 Год назад +1

    this is obvious that you are so qualified in php, i have not ever watched a lesson like your lesson, Thank You 👋👋👌

  • @michielstornebrink
    @michielstornebrink Год назад +1

    Bedankt

  • @QorashyTech
    @QorashyTech 9 месяцев назад +1

    Thanks!

  • @issaissifou3579
    @issaissifou3579 Год назад

    Thank you so much

  • @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.

  • @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 года назад +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

  • @memack101
    @memack101 2 года назад

    Thank you.

  • @MePeterNicholls
    @MePeterNicholls Год назад

    This is starting to make sense to me

  • @ferripradana4265
    @ferripradana4265 7 месяцев назад

    Before, i used to wonder. how does laravel do autowiring. And You explained to me. Thanks a lot 😢

  • @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.

  • @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  Год назад +1

      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.

  • @kotyk-obormotyk
    @kotyk-obormotyk Год назад +1

    Дякую!💙💛

  • @2008rol
    @2008rol 2 года назад +1

    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 года назад +4

      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 года назад +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.

  • @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  Год назад +1

      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.

  • @ahzamlathiya6367
    @ahzamlathiya6367 2 года назад +3

    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 года назад +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 2 месяца назад

    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  2 месяца назад

      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

  • @donjoes3750
    @donjoes3750 9 месяцев назад

    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  9 месяцев назад

      Do you mean interfaces? There is another video covering interface injection

  • @Armando-px8hi
    @Armando-px8hi 10 месяцев назад

    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?

  • @expresscoding3525
    @expresscoding3525 8 месяцев назад

    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  8 месяцев назад

      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

  • @weak5205
    @weak5205 Месяц назад

    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  25 дней назад

      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

  • @Zubbee
    @Zubbee Год назад

    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  Год назад

      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 Год назад

      @@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.

  • @TomiBorchert
    @TomiBorchert 11 месяцев назад

    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  11 месяцев назад

      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.

  • @liym-ntairaylangdji3441
    @liym-ntairaylangdji3441 6 месяцев назад

    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 6 месяцев назад

      And please, how can I reach to you privately and how do I send the codes for the exercises?

    • @ProgramWithGio
      @ProgramWithGio  6 месяцев назад

      ReflectionNamedType is related to named arguments, ReflectionUnionTypes is related to union types & ReflectionIntersectionType related to intersection types :). I can be reached via Twitter (X)

  • @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

  • @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

  • @guillermofernandez2247
    @guillermofernandez2247 Год назад

    1:24 Why do you say to not use it production? security issues? performance?... 🤔

    • @ProgramWithGio
      @ProgramWithGio  Год назад +1

      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.

  • @bakosyy
    @bakosyy 7 месяцев назад

    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  6 месяцев назад +1

      Hey, because the container instance is passed into the closure. Its already a proper container instance

  • @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

  • @faramarztayyari3734
    @faramarztayyari3734 2 года назад

    Hi
    Approximately how many parts is this tutorial supposed to be?

    • @ProgramWithGio
      @ProgramWithGio  2 года назад +1

      Hello. I don't have the exact number but there are few more topics I want cover before ending the series

  • @mortezaayashi9581
    @mortezaayashi9581 Год назад

    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

    • @mortezaayashi9581
      @mortezaayashi9581 Год назад

      @@ProgramWithGio got it, thanks

  • @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  Год назад +1

      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  Год назад +1

      @@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

  • @elmarzougui
    @elmarzougui 2 года назад

    After that vedio i think that i can build my slim framwork 😄😄😄

  • @mdrakibrizan2648
    @mdrakibrizan2648 2 года назад

    What's your laptop/desktop configuration?

    • @ProgramWithGio
      @ProgramWithGio  2 года назад

      Not sure I understand the question. What configuration are you referring to?

  • @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 года назад +2

      The truth is, I don't speak English, I see your videos and I understand them.

  • @LuisSilva-kf9iy
    @LuisSilva-kf9iy Год назад

    How and where do you get all those informations?

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      Documentation, source code, articles & experience

    • @LuisSilva-kf9iy
      @LuisSilva-kf9iy Год назад

      @@ProgramWithGio Do you You give private training?

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      @@LuisSilva-kf9iy not at the moment

    • @LuisSilva-kf9iy
      @LuisSilva-kf9iy Год назад

      @@ProgramWithGio witch email can I contact you, I would like to keep in contact with you.

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      @@LuisSilva-kf9iy you can stay in touch on Twitter.

  • @benjaminspinola1788
    @benjaminspinola1788 5 месяцев назад

    I have trouble understanding why that works: ruclips.net/video/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  5 месяцев назад

      Because it is not resolved until its needed, notice its inside closure. The code does not execute until its needed

  • @stefanfischer2205
    @stefanfischer2205 3 месяца назад

    I was wondering why in most of these Tutorials, Gio discourages us from using the code he produced in our own code. So I don't really see the Problem in using this DI-Container for my projects.

    • @ProgramWithGio
      @ProgramWithGio  3 месяца назад

      Because it's not tested, doesn't have all the features you would need. There are much better open source DI containers available that have been battle tested and have a lot of features. You are free to use it but I discourage it because there are better alternatives. Here I just show how it works and how it's typically implemented in its basic form, if that's enough for your project then sure

  • @user-iy1iq3by1o
    @user-iy1iq3by1o 10 месяцев назад

    is it magic?

  • @dnkmvp
    @dnkmvp 9 месяцев назад

    can u add vietnamese subtitle, please !!!!!

    • @ProgramWithGio
      @ProgramWithGio  9 месяцев назад

      RUclips adds subtitles automatically

  • @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 3 месяца назад

    if you are using composer, you have already lost control of your code.

    • @ProgramWithGio
      @ProgramWithGio  3 месяца назад

      Disagree but whatever works for you 👍

  • @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  Год назад +1

      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 Год назад +1

      @@ProgramWithGio I skimmed thru PHP-DI and looking forward to that video, Will progress each step, as you advised. Tq.

  • @abdfadee8267
    @abdfadee8267 6 месяцев назад

  • @QorashyTech
    @QorashyTech 8 месяцев назад

    Thanks!

    • @ProgramWithGio
      @ProgramWithGio  8 месяцев назад

      Thanks alot for the support 🙏💙