Skip to content

Conversation

Copy link

Copilot AI commented Nov 27, 2025

Adds documentation for an alternative Mac setup using Homebrew and Composer, as shared by @christophboecker. This approach is simpler than the existing Windows-focused guide—no custom loader code needed since Homebrew's CLI PHP respects Composer's autoload.

Changes

  • New section: "PHP - REDAXO-Coding-Standards via Homebrew (Mac)" with step-by-step setup
  • Updated TOC: Added navigation link to new section
  • Updated timestamp: Reflects current documentation state

Key configuration

"php-cs-fixer.executablePath": "~/vendor/friendsofphp/php-cs-fixer/php-cs-fixer",
"php-cs-fixer.config": ".php-cs-fixer.php;.php-cs-fixer.dist.php;~/vendor/redaxo/php-cs-fixer-config/.php-cs-fixer.dist.php",
"[php]": {
    "editor.defaultFormatter": "junstyle.php-cs-fixer"
}

Uses executable directly instead of .phar for better performance. Config chain falls back to REDAXO standards when no project-specific config exists.

Original prompt

This section details on the original issue you should resolve

<issue_title>VSCode und Redaxos PHP_CS_FIXER_CONFIG (auf dem Mac)</issue_title>
<issue_description>Ich bin mir nicht so sicher, ob das hier wirklich eine für alle funktionierende Lösung ist, oder ob es eher durch Zufall funktioniert. Ich gebe sie trotzdem mal weiter, weil es ein sehr einfacher Prozess ist ohne zusätzlichen Code. Und vieleicht hat jemand eine einfache Adaption für Windows-Systeme ....

Abweichend von der Beschreibung hier aus @aeberhard´s Feder habe ich auf dem Mac eine Variante basierend auf Homebrew aufgesetzt:

Vorarbeit auf System-Ebene

  1. Brew bzw. Homebrew muss installiert sein. Ggf. CakeBrew als Dialog-Tool.
  2. Über Brew ist PHP für die Command-Line installiert. (Bei mir kommen auch Apache/MySQL/SAPI-PHP über Brew)

Redaxos PHP_CS_FIXER_CONFIG bereitstellen

  1. Über Brew Composer installieren. Composer wird später seine geladenen Pakete in ~/vendorablegen.
  2. Im Terminal den Composer-Befehl composer require --dev redaxo/php-cs-fixer-config gemäß https://github.com/redaxo/php-cs-fixer-config eingeben. Dann werden alle notwendigen Komponenen geladen; inkl. php_cs_fixer.

in VSCode junstyle.php-cs-fixer installieren

  1. junstyle.php-cs-fixer als Extension installieren
  2. In den Settings folgende Einstellungen tätigen (ggf. direkt in der Settings-Datei):
    • "php-cs-fixer.executablePath": "~/vendor/friendsofphp/php-cs-fixer/php-cs-fixer"
      Grund: Performance, denn dann muss junstyle.php-cs-fixer nicht immer die mitgebrachte .phar entpacken.
    • "php-cs-fixer.config": ".php-cs-fixer.php;.php-cs-fixer.dist.php;~/vendor/redaxo/php-cs-fixer-config/.php-cs-fixer.dist.php",
      Ruft, wenn es keine individuelle Konfigurations-Datei im Workspace gibt, die Redaxo-Konfiguration auf.
    • "[php]": {"editor.defaultFormatter": "junstyle.php-cs-fixer"}
      Macht junstyle.php-cs-fixer zum Default-Formatter

Updates

  1. Im Terminal eingeben: composer update

Läuft bei mir auf dem Mac ohne Probleme. Es muss auch kein zusätzlicher Ladecode geschrieben werden, da das CLI-PHP von Brew die Autoload-Datei von Composer berücksichtigt.

</issue_description>

Comments on the Issue (you are @copilot in this section)

@aeberhard @christophboecker hau das doch als eigene Section mit rein. Ist auf jeden Fall hilfreich!

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update PHP CS Fixer configuration for Mac setup Add Mac/Homebrew setup guide for PHP CS Fixer with REDAXO config Nov 27, 2025
Copilot AI requested a review from skerbis November 27, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VSCode und Redaxos PHP_CS_FIXER_CONFIG (auf dem Mac)

2 participants