Measure PHP Code Quality With Static Analysis Using PHPStan

Ғылым және технология

Measure PHP Code Quality With Static Analysis Using PHPStan to check coding standards. (see shortcuts below to key points) Adam Culp of Beachcasts php programming videos shows how to get clean code with PHPStan for static code analysis for code quality.
Please * LIKE, COMMENT, AND SUBSCRIBE * - and share with others!
Key Topics:
- What is static analysis and sniffing for code smells
- Using PHPStan for static code analysis
- Setting up PHPStan run level, and outputting results to a file
Support the channel with this Cloudways affiliate link: www.cloudways.com/en/?id=1013434 and use the discount code BEACHCASTS to get a free month of hosting.
For a nice list of equipment I use in my studio, and to support the channel if you make any purchases (doesn't cost you a thing), visit my kit at kit.co: kit.co/beachcasts/beachcasts-...
Errata:
Let me know if you notice anything that should be errata
Associated Links:
phpstan.org/
hub.docker.com/repository/doc...
beachcasts.com
Timeline:
00:00 Video start
02:18 Introduction to the video sponsor Cloudways
03:00 Introduction to PHPStan for static code analysis
04:05 The Composer command to include PHPStan in a project
05:28 How to launch PHPStan to analyze code
06:47 Example output from PHPStan
07:45 Change the run level for PHPStan to analyze code
08:25 How to output results from PHPStan to a file
09:00 Instruct PHPStan to format output in various formats
10:49 Bonus: Running PHPStan using the php-code-quality Docker image
Other Beachcasts videos you might find interesting:
True Cost of Software Errors • Shocking True Cost of ...
Define Technical Debt • Define Technical Debt ...
Conference Talk Preparation In 8 Steps for Programmers • Must Follow 8-Step Gui...
How to understand code written by someone else • Secrets of how to unde...
Ways to advance your programming skills and improve as a developer • Ways to advance your p...
Make your local DEV environment available on the internet • Make your local DEV en...
AWS Elastic Load Balancer (ELB) Tutorial How-To • AWS Elastic Load Balan...
Laravel Model Factory Tutorial using Artisan make:model • Laravel Model Factory ...
Authentication in Laravel Tutorial • Authentication in Lara...
Top 5 skills to be a better software developer • Top 5 skills to be a b...
Install Laravel in Docker container on Ubuntu for beginners • Install Laravel in Doc...
Getters and Setters accessors in object-oriented programming • Getters and Setters ac...
Critical programming issues preventing a PHP 7 upgrade • Critical programming i...
Behat for beginners functional REST API testing tutorial • Behat for beginners fu...
Doctrine ORM one-to-many bi-directional association • Doctrine ORM one-to-ma...
PHP Mess Detector static analysis to find PHP code smells • PHP Mess Detector stat...
Doctrine ORM one-to-many self-referencing association • PHP DoctrineORM one-to...
10 reasons to become a consultant in a consulting business • Top 10 Reasons To Be a...
Zend Framework becomes Laminas project at Linux Foundation • Zend Framework becomes...
10 bad things about consulting • Top 10 bad things abou...
How to get lines of code in PHP • PHPLoc Lines of code s...
Make a List handler middleware • List handler middlewar...
Make a Delete handler middleware • Delete handler middlew...
Make an Update handler middleware • Update handler middlew...
Use UUID with Doctrine ORM for DB keys • UUID with Doctrine ORM...
Make a Create handler middleware • Create Handler middlew...
Automate Hypermedia creation for PHP REST API • Automate Hypermedia PH...
Learn about Hypermedia and how to create it • Creating Hypermedia (H...
Doctrine ORM Paginator for PHP REST API • Doctrine ORM Paginator...
Doctrine ORM Entity how to • Create Doctrine ORM En...
Configure Doctrine ORM • Configure Doctrine ORM...
Create PHP middleware with Zend Expressive • Create PHP middleware ...
Configure PhpStorm for PHP development with Docker • PhpStorm setup for PHP...
Create PHP development environment with docker • PHP web development en...
Help through referrals:
I use TubeBuddy to help me manage my KZread channel. If you're interested, click the following link to check it out. www.tubebuddy.com/beachcasts
#php #phpstan #beachcasts

Пікірлер: 25

  • @Beachcasts
    @Beachcasts2 жыл бұрын

    To learn more about technical debt, see this video: kzread.info/dash/bejne/jH5pw5amqKXIh9o.html

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Or view my entire playlist on code quality at kzread.info/head/PL6_nF0awZMoPxqSUuYM1Pawa8CR1kV_2t

  • @MarcelloPato
    @MarcelloPato Жыл бұрын

    Great job man!

  • @keithlamontdavis8047
    @keithlamontdavis8047 Жыл бұрын

    Very helpful. Thx!

  • @sophiebeaupuis9753
    @sophiebeaupuis97532 жыл бұрын

    Long time no see Adam !! Very interesting tool ! Thanks for the video !

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Thanks for watching! Glad you found it helpful. Great to see you here.

  • @manuakasam
    @manuakasam2 жыл бұрын

    We just started to use PHPStan in a pretty big application. Needless to say that even on a mere level 6 we had roughly 1000 errors to start with (6.5k basefile lines). Rule of thumb is that whenever we touch a file we just gonna improve upon it. We're down to 4k lines in baseline file which is just great. Code does become way more stable using tools like this. It does catch issues that - when just writing down code - you simply don't catch.

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Thanks for sharing, and glad you're starting to see great results. Are you using other tools like PHP Mess Detector and PHP Codesniffer as well? I talked about phpmd here: kzread.info/dash/bejne/app5yKp-g9WxZag.html

  • @juniorWeb247
    @juniorWeb2472 жыл бұрын

    best lecture i have sceen on phpstan

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Thank you.

  • @lostcarpark
    @lostcarpark8 ай бұрын

    I develop mainly for Drupal, and find PHPStan essential.

  • @azdcxdf
    @azdcxdf2 жыл бұрын

    Great explanation. Thank you.

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Glad it was helpful!

  • @DevCastOficial
    @DevCastOficial2 жыл бұрын

    Thanks for sharing!

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Thank you for watching.

  • @Abc-sl1nf
    @Abc-sl1nf Жыл бұрын

    Thx from AZPHP

  • @jeferson-guedes
    @jeferson-guedes2 жыл бұрын

    Hello !! Hi, I really like a lot of your videos. About code quality I'm implementing some commit verification routines with their own hooks, for that I needed to add a development dependency on nodejs with npm the husky, with it I can only validate code that is on stage. I would like to know if you know any tools in PHP that fill this need.

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Thanks for watching, and happy you're finding the videos helpful. One way to validate might be to create a small shell script to call with a hook. I'll give this some thought and provide more details when I'm not traveling.

  • @Abc-sl1nf
    @Abc-sl1nf Жыл бұрын

    Would you be interested in presenting via Zoom in January?

  • @irfnrdh
    @irfnrdh2 жыл бұрын

    mantul

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Thank you, and thanks for watching.

  • @markcuello5
    @markcuello5 Жыл бұрын

    HELP

  • @zbynekriha
    @zbynekriha2 жыл бұрын

    if we are talking about something five years old as new thing, we have a problem

  • @Beachcasts

    @Beachcasts

    2 жыл бұрын

    Um, it just went version 1 recently. ;-) But I understand what you're trying to say.

Келесі