Skip to content

Setup IDE for PHP/Drupal dev and test

Update the following files:

inspectionProfiles/Project_Default.xml

in component/profile

<inspection_tool class="MessDetectorValidationInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PhpCSValidationInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
  <option name="CODING_STANDARD" value="Drupal" />
  <option name="EXTENSIONS" value="php,js,css,inc" />
</inspection_tool>

php.xml

in project

<component name="MessDetector">
  <phpmd_settings>
    <MessDetectorConfiguration tool_path="$PROJECT_DIR$/vendor/bin/phpmd" />
  </phpmd_settings>
</component>
<component name="PhpCodeSniffer">
  <phpcs_settings>
    <PhpCSConfiguration standards="Drupal;DrupalPractice;MySource;PEAR;PSR1;PSR12;PSR2;SlevomatCodingStandard;Squiz;VariableAnalysis;Zend" tool_path="$PROJECT_DIR$/vendor/bin/phpcs" />
  </phpcs_settings>
</component>
<component name="PhpInterpreters">
  <interpreters>
    <interpreter id="7a28abff-18ef-49a4-889e-453241ccddd0" name="php" home="docker-compose://DATA" debugger_id="php.debugger.XDebug">
      <remote_data INTERPRETER_PATH="php" HELPERS_PATH="/opt/.phpstorm_helpers" INITIALIZED="false" VALID="true" RUN_AS_ROOT_VIA_SUDO="false" DOCKER_ACCOUNT_NAME="Docker" DOCKER_COMPOSE_SERVICE_NAME="php" DOCKER_REMOTE_PROJECT_PATH="/opt/project">
        <type_data command="EXEC" />
        <dockerComposeConfigurationPaths>
          <item value="$PROJECT_DIR$/docker-compose.yml" />
        </dockerComposeConfigurationPaths>
        <envs />
      </remote_data>
    </interpreter>
  </interpreters>
</component>
<component name="PhpUnit">
  <phpunit_settings>
    <phpunit_by_interpreter interpreter_id="7a28abff-18ef-49a4-889e-453241ccddd0" configuration_file_path="/var/www/html/tests/phpunit.xml.dist" custom_loader_path="/var/www/html/vendor/autoload.php" phpunit_phar_path="" use_configuration_file="true" />
  </phpunit_settings>
</component>

php-test-framework.xml

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="PhpTestFrameworkVersionCache">
    <tools_cache>
      <tool tool_name="PHPUnit">
        <cache>
          <versions>
            <info id="interpreter-7a28abff-18ef-49a4-889e-453241ccddd0" version="9.5.20" />
          </versions>
        </cache>
      </tool>
    </tools_cache>
  </component>
</project>
Edited by jurgenhaas