PHPackages                             uuf6429/php-cs-fixer-blockstring - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. uuf6429/php-cs-fixer-blockstring

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

uuf6429/php-cs-fixer-blockstring
================================

A PHP-CS-Fixer extension for formatting the contents of PHP heredoc and nowdoc string blocks.

1.0.0(1mo ago)210[4 issues](https://github.com/uuf6429/php-cs-fixer-blockstring/issues)MITPHPPHP ^7.4 || ^8.0CI passing

Since Mar 16Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/uuf6429/php-cs-fixer-blockstring)[ Packagist](https://packagist.org/packages/uuf6429/php-cs-fixer-blockstring)[ RSS](/packages/uuf6429-php-cs-fixer-blockstring/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (2)Used By (0)

🧹 PHP-CS-Fixer Heredoc/Nowdoc Content Formatter
===============================================

[](#-php-cs-fixer-heredocnowdoc-content-formatter)

[![CI](https://github.com/uuf6429/php-cs-fixer-blockstring/actions/workflows/ci.yml/badge.svg)](https://github.com/uuf6429/php-cs-fixer-blockstring/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/08c33141348568c87bec07d767f22a7621c884ffdb0bf43149a67ecb1552329c/68747470733a2f2f636f6465636f762e696f2f67682f757566363432392f7068702d63732d66697865722d626c6f636b737472696e672f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/uuf6429/php-cs-fixer-blockstring)[![Minimum PHP Version](https://camo.githubusercontent.com/091c5fe4143f6d3aee38fc19c54dbd8419d950a9c3803f460e4fb0fd50be67ce/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e34253230253743253743253230253545382d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/6c2cb2870b7bdf5791b8fc25d9731855d7d1ce7c55bed68fcf791036f7a95a6a/68747470733a2f2f706f7365722e707567782e6f72672f757566363432392f7068702d63732d66697865722d626c6f636b737472696e672f6c6963656e7365)](https://packagist.org/packages/uuf6429/php-cs-fixer-blockstring)[![Latest Stable Version](https://camo.githubusercontent.com/1f20d3b4ad6bb86598766e19b6b44366cbb8602c0482068ced2e90c66a7f922e/68747470733a2f2f706f7365722e707567782e6f72672f757566363432392f7068702d63732d66697865722d626c6f636b737472696e672f76)](https://packagist.org/packages/uuf6429/php-cs-fixer-blockstring)[![Latest Unstable Version](https://camo.githubusercontent.com/17fcf029db048ad5d62fa326c9612feac39a23aeebb47ee4c9345d6ddef68ba1/68747470733a2f2f706f7365722e707567782e6f72672f757566363432392f7068702d63732d66697865722d626c6f636b737472696e672f762f756e737461626c65)](https://packagist.org/packages/uuf6429/php-cs-fixer-blockstring)

This project extends [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) to be able to format the contents of PHP [Heredoc](https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) and [Nowdoc](https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc) strings (aka *Block Strings*).

Note that **no language-specific formatters** are provided by design - this project instead provides the capability to integrate any type of formatters with minimal code (mainly in your PHP-CS-Fixer configuration file).

While this might sound like a weakness, it in fact makes it possible to integrate virtually any formatter for any language.

🔌 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require uuf6429/php-cs-fixer-blockstring --dev
```

Finally, register a custom fixer in your `.php-cs-fixer.php` config file (1️⃣) and then set up formatters (2️⃣):

```
