Top 12 VScode Extensions for PHP

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello guys what's up the cotellic is here in this video I'm going to show you top visual studio code extensions for PHP development recently I started a research trying to find out how good Visual Studio code can be when working with PHP and I found out these extensions to be very good so I decided to share this with you okay let's start in the very first extension is PHP intelligence so we need auto-completion we need to like detect method signature by the editor go to definition and things like that this extension gives us all these basic things what we need like Auto completion method reading the method signature and so on so I'm going to create right here I'm a collapsed on the left side I'm going to create right here a DB variable for example which will be an instance of PDO Nino PDO and atella completes the PDO class and all the PDO starting classes so we help you right here and let's call method prepare on this it also detects that this prepare method returns PDO statement and if I hit on this and type parenthesis it detects also the arguments this prepare method accepts and with some description which is very good let's check this on this class Eve Abe application class this is a really large class so these class has couple of properties and methods so let's try controller yeah it finds this controller it finds all the methods what we need also it has a great feature to go to the definition of the class so if I hit the ctrl on my keyboard and mouse on this application first of all if I mouse over on this application it gives me this text what is this class about the description of the class basically in fact control hit the control and mouse it opens the class declaration which is absolutely necessary and very useful in any in any project in any editor so that's that's very good feature also if I hit the control and mouse on this application it finds all the usages right now it's showing their structure applications oops let's say it once again huh yeah it finds this one so it's a little bit buggy but it finds this one on the right side we see all the files where these TV application Clause is used we can expand just have a preview on these we'll just double click and go to the usage where this application is used so it's an excellent and necessary tool second one is PHP Intel offense so this Intel offense is really similar to a PHP intellisense in fact most of the features are the same but this intelligence is much more complex it has also premium version it has also support for a formatting of the code some code folding paned phpdoc feature as well so let's try try this one but I'm gonna uninstall intellisense because they may conflict each other so I'm gonna reload my vs code and let's have a look ok so this isn't elephants so it has all the way out to completion so I'm gonna show this to you but if I mouse over on the application I see right here a much large description of the class ok so this is a very good better than the intelligence has also if I hit the ctrl and click it also opens the reference but it doesn't navigate to the class first it shows you the reference where how it is used the definition basically if I click on this class then it navigates right there the same thing happens if I want to find out all the references where this application is used it's really similar also great feature is to find the properties in methods in the application that's an excellent feature just type ctrl + P and right here we just like its symbol for example if we if we just want to find the methods in properties in the current file for example default world or some bootstrap method ok so it now agates too method area highlights the method which is an excellent excellent feature if I want to find the properties and methods in the application not in the current file only I type hash tag right there and for example a Paint time stamp and it finds that this property is available in this IVA asset manager just highlight this one and it opens this property which is a cool tool this the searching the properties and the the methods is also available in the intelligence but it's a limited for me it's it's not working as perfect as for PHP in telephones and it has also code formatting features as I mentioned so if I unform at my code in the video controller and I just right-click on this and format document you can also set it on your desired shortcut then it formats the document is you want okay that's a really good feature other features are available in the in the premium so definitely check out these extensions I will put the just all the links in the video description ok next one is PHP formatter so if you decided not to using telephones but to use intellisense probably you need some kind of formatting so PHP fmt is the very good choice so let's install this one test couple of options you can specify how we want it to be formatted with the to format unsaved and things like that and it also has some more options you can check out in the readme file of this extension so the formatting basically is the is the same so we just our format it just like this then right-click and format document but we need to also choose what's the default formatter and that indicates on the bottom bottom right corner of the screen that it's PHP fmt at the moment ok next one is PHP namespace a resolver let's install this extension PHP namespace resolver at this one it has a lot of downloads no not this one I'm sorry it has a lot of downloads it's very good rating by the way so let's install this one and it's very necessary tool if you want to easily import some classes for example I have access control class used right here if I scroll up this is the use statement I'm going to delete the you statement and right here if I mouse over and right click on this I can hit this import class or you can set your keyboard shortcut for example out and enter I have this one out and enter and then if I out and enter then I see that the class was imported successfully that's it all about this extension it's very helpful also next one is PHP tip back so PHP debug is an excellent extension if you are using debugger in your PHP recently I made a video about how to debug applications using Visual Studio code and this extension with XD bug so definitely check out this video and I'm not gonna mention right here but it's an excellent extension I'm gonna show this to you right here but the link of this extension will be in the description okay the next one is PHP setters and getters ok PHP caters and setters where it is it's right here so let's install this one that's that's not perfect extension I would say but it's a very good if you want to generate getters and setters for your application for example I have a property name right here and I'd say that I want to generate getters and setters for this extension the cursor should be inside the inside the property name then ctrl + P and right here I tap roll this greater then and insert insert PHP cater and setter the bad thing is that its first of all it needs to reload your views code when you install this all it gives this extension this exception okay so let's just reload okay and then if I click inside the property control P and insert PHP Gator and setter this one creates getters and setters at the bottom of the file so the getters contain some documentation it's it's good it's not bad but putting this at the very bottom is not very good and if I have several properties by five properties and I want to generate getters and setters for all of them I have to repeat this step for each of them which is not very convenient so probably better would be if I just choose I want to generate getters and setters for which file for which properties excuse me and then it would put together and setters in the in the place where the cursor is at the moment but anyway this is the best extension about generating getters and setters for vias code so here it is the next one is to generate constructor easily PHP constructor so let's install this extension just click in cell button right here I think I have already installed and then right here I'm going to tie ctrl + P arrow and then insert constructor property this one creates a constructor with property with multiple cursor so that I can call the property whatever I want age for example and I have this constructor with age property if I want to create a second property for example personal ID it will not of course create new constructor but it will aid the constructor property in the in the constructor in this gap in the constructor method so let's just call it personal ID okay just like this I think I did something incorrectly so let's just do this once again insert constructor property personal ID okay here it is again this is not perfect extension for me because sometimes I already have extent are the the properties and I want to generate constructor for all of them so I couldn't find a way to do this using this extension the next one is phpdoc blocker okay let's install this one it's to easily generate the the talk stock blocks of the method basically it's what the name says so if I go to the controller for example and I hit the slash asterisk two times and hit the enter he generates this document and it also has possibility to specify the author of the method or alpha of the class so it generates this for both class and methods and basically these can be changed from the settings of the extension okay so we can go to the extension settings it's also written right here in this extension documentation down below what properties it has okay and down below we can find that in the in the settings we can specify the author to be whatever we want and on every method and on every class we can specify separately it generates this output okay next one is PHP code sniffer PHP CS okay there are two extensions basically PHP CS they are identical the second one which has lower downloads is basically a forked version of this which has higher downloads I couldn't find in difference so I recommend this one which has much more downloads so that's just called sniffer which you can specify the like the biggest advantage of this is that you can specify the formatting formatting templates let's say like this so yeah formatting standard that WordPress for example and it will run the code sniffing like WordPress WordPress would be okay so that's the next one tool you can also specify your own standard if you have for your in your organization and that's an excellent excellent tool okay next one is PHP files let's search for this it doesn't have much downloads but it's it can be sometimes very good extension it has also its disadvantages let's see what it is actually so it gives you a possibility to create interfaces classes or trays inside your application so for example if I go to this front-end folder and I want to create like a new controller in the controllers so right click and PHP new class okay so and I can specify right here the class name for example main Haller what it extends from so we need to specify the full what's the extends from and then what it implements from in that's basically it but it doesn't detect the namespace out of the box so for this we need to actually create these PHP files JSON in the project root directory and specifying what are the namespaces and that they are going to provide ability to retrieve namespaces from composer JSON but that's not done yet so it's not it's not like very useful for me but it might be useful for you if you don't use namespaces and yeah I just decided to show this to you okay next one is PHP server so PHP server thatës can be useful if you don't want to run the application on your apache installation so you can easily open your any file using this PHP server so let's go to the front end babe index.php for example which is the entry script of the application and I just right-click and serve project and that creates that opens the project in this yeah just like this so it works fine for me okay the next one is MySQL so if you are working with PHP probably you need some kind of tool to work with MySQL and people are using phpMyAdmin so let's let's search for MySQL okay so there are two extensions basically with worth worth to check one is this one which has a lot of downloads but the second one I found it more useful for me so I'm going to show this to you you can check out the other one as well but this one has like auto completion in the SQL file reading the tables and schemas the columns as well and it has also good editing interface better than the other one it's not perfect but better than the other one and it creates this MySQL table right here on the left side with all you need to basically connect to the MySQL so you you click this plus button connect to MySQL and click this connect button and that's it then you have all the databases so let's choose one of the database this one for example and I'm going to create I'm going to write in the SQL right here select everything from video for example and run the query and it gives me all this output I'm going to move this down ok and close this it gives me all these outputs of this select everything from video down below we see all the videos I have a possibility to copy edit and delete each record and I also have a possibility to create new record using this modal I'm going to open this right here to have a larger view and this is how it looks like so it has an interface really nice crud interface to easily delete update or create records in in MySQL MA but more importantly it has these Auto completion features which is I think very necessary when working with MySQL ok that's it for this video guys I hope you enjoyed it let me know in the comments section if you have any extensions like you're using on PHP which I haven't mentioned I would like to know this information so again thumbs up if you liked subscribe if you love it and see you in the next time
Info
Channel: The Codeholic
Views: 112,272
Rating: undefined out of 5
Keywords: TheCodeholic, vscode, vscode extensions, vscode php, php vscode, php vscode setup, php vscode extensions, vscode php extension, vscode php extensions, top 12 vscode extenions, top vscode extensions, top vscode extensions 2020, top vscode php extensions, vscode php debug, vscode top 10 extensions, vscode top extensions, best php extensions for vs code, best php extension for visual studio code, vscode best extensions, vscode best php formatter, vscode php autocomplete
Id: v9dWFbiir9Q
Channel Id: undefined
Length: 17min 1sec (1021 seconds)
Published: Thu May 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.