Symfony Xdebug Phpstorm



  1. In order to run/debug a Symfony application within PHPStorm, we need to create a new configuration under “Run/Debug Configurations”. The new configuration will be based as a “PHP script”.
  2. Symfony 5 ES CQRS Boilerplate. A boilerplate for DDD, CQRS, Event Sourcing applications using Symfony as framework and running with php7. Symfony 4 still available in symfony-4 branch. Creating an Application Use Case. Adding Projections. Async executions. Xdebug configuration. Kubernetes Deployment.

In versions of Xdebug before version 3 setting up step debugging for code inside Docker containers has often been challenging to say the least. However, in version 3 it’s become almost trivial. In this short tutorial, I’ll step you through what you need to do, regardless of the (supported) text editor or IDE you’re using.

Getting the most out of PHPStorm for Drupal 8

Xdebug phpstorm cli

Presentation by Kyle Einecker

  • currently using phpstorm?

Phpstorm Xdebug Not Working

About me

ctrlADel
  • Senior Developer, 4yrs drupal
  • prefer backend

About you

Currently using PHPStorm?

Currently using XDebug?

Using automated code testing or sniffing?

Plugins

Git

Tool window

View > Tools Windows > Version control

  • Press the grey box in the bottom left of the window
  • Select Version control on bottom bar

History

Local history

Diff

Select any blue file in the git log view or git local changes view

ctrl+d

Linting and Sniffing

phpcs

Installation instructions
vs

stylelint

Drupal change recordPhpstorm xdebug docker cli
Will be available to contrib modules and themes eventually

eslint

sass-lint

Alternative to stylelint

Configure Xdebug Phpstorm

vs

Navigating code

Search everywhere

Hierarchy view

ctrl+h

Copy path

ctrl+shift+c
ctrl+shift+alt+c

Function definition

ctrl+q

Go to function deceleration

ctrl+click

Find usages

Most actions

Gutter icons

Shows implementations of parent methods or children implementing a method.
Shows if a method is overriding a parent or is overridden by a child.
Shows hook documentation in *api.php, all implementations of the hook, and where the hook is called.

Code completion and boiler plates

Drupal console

Implement interface methods

Implement interface methods #2

alt+enter

Use statements

Auto added when code competition is used
alt+enter

Patching

Patching with composer

composer-patches
Applies patches through composer

Apply patches

VCS > Apply patch from clipboard

Symfony 4 Xdebug Phpstorm

Quick patches for contrib modules

  1. File > Settings > Version control
  2. Changes to the address module now show in the Version Control window
  3. Use your favorite patching method to create a patch for address

XDebug

Configuring XDebug

Enabling XDebug

Turn on listening in PHPStorm

Set breakpoints

XDebug interface

Evaluate code

or right click > evaluate expression

Vendor mapping

Make sure vendor directories are mapped correctly in
File > Settings > Languages & Frameworks > PHP > Servers

phpcbf

Phpstorm Xdebug Docker Cli

Configuration

Setup instructions

Single File

Php Docker Xdebug Phpstorm

Current directory

Other things PHPStorm does