1 / 12

PHPStan: static code analysis Drupal GovCon , July 25 or 26, 2019

PHPStan: static code analysis Drupal GovCon , July 25 or 26, 2019. Dear organizers: I’ll be on GovCon Thursday and Friday only. These slides are a first draft only. What is PHPStan?. “ PHP Static Analysis Tool – discover bugs in your code without running it ”. Who is creating PHPStan?.

heidiw
Download Presentation

PHPStan: static code analysis Drupal GovCon , July 25 or 26, 2019

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHPStan: static code analysisDrupal GovCon, July 25 or 26, 2019 Dear organizers: I’ll be on GovCon Thursday and Friday only. These slides are a first draft only.

  2. What is PHPStan? “PHP StaticAnalysis Tool –discover bugs in your code without running it”

  3. Who is creating PHPStan? • OndřejMirtes: PHP in general • Matt Glaman: Drupal integration

  4. Structure of the presentation For a public contrib module: Drupal 7 first, then Drupal 8 For your drupal-composer/drupal-project GitLab integration

  5. First install

  6. First install Source is in the Nagios module

  7. phpstan.neon The configuration file # How to run PHPStan# 1. $ cd your_Drupal_7_root# 2. $ composer require phpstan/phpstandrush/drush:^8.0 --dev# 3. $ cd sites/all/modules/nagios# 4. $ ../../../../vendor/bin/phpstananalyze --level 4 .parameters:autoload_files: - %rootDir%/../../../includes/bootstrap.inc...- %rootDir%/../../../vendor/drush/drush/includes/output.inc - tests/phpstan-bootstrap.php - nagios.drush.inc - nagios.install - nagios.modulefileExtensions: - php - module - inc - installexcludes_analyse: - *.api.php

  8. Now Drupal 8 contrib Source is in the Nagios module

  9. For your drupal-composer/drupal-project Running on Ubuntu

  10. .gitlab.yml Runs on every push

  11. phpstan.neon Runs on every push

  12. How to reach me I’m @Gogowitsch on Drupal.org and Twitter Mail: Blaeul@quodata.de Also: Don’t be shy with questions, anytime!

More Related