Skip to content

Commit

Permalink
Add VSCode devenv configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 committed Jan 24, 2024
1 parent 7cb49a4 commit e5efd38
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php

$finder = PhpCsFixer\Finder::create()
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;

$config = (new PhpCsFixer\Config())
$config = (new Config())
->setRules([
'@PhpCsFixer' => true,
'@PSR2' => true,
Expand Down
20 changes: 20 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
// For intellisense and navigation in code:
"bmewburn.vscode-intelephense-client",

// For formatting and linting:
"junstyle.php-cs-fixer",

// For exploring and running tests:
"hbenl.vscode-test-explorer",
"recca0120.vscode-phpunit",

// For debugging:
"xdebug.php-debug" // to make this work, you need xdebug installed - see the description of the extension
],

// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
// To debug tests, you need to launch this configuration first, then run the test to debug from the test explorer.
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9003
}
]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"intelephense.environment.phpVersion": "8.1.0",
"phpunit.args": [
"-c",
"${workspaceFolder}/phpunit.xml"
],
"php-cs-fixer.executablePath": "php-cs-fixer",
"php-cs-fixer.executablePathWindows": "${workspaceFolder}/vendor/bin/php-cs-fixer.bat",
"[php]": {
"editor.defaultFormatter": "junstyle.php-cs-fixer"
}
}

0 comments on commit e5efd38

Please sign in to comment.