* * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace Symfony\CS\Fixer\PSR2; use Symfony\CS\AbstractFixer; /** * Fixer for rules defined in PSR2 ΒΆ2.2. * * @author Fabien Potencier */ class LinefeedFixer extends AbstractFixer { /** * {@inheritdoc} */ public function fix(\SplFileInfo $file, $content) { // [Structure] Use the linefeed character (0x0A) to end lines return str_replace("\r\n", "\n", $content); } /** * {@inheritdoc} */ public function getDescription() { return 'All PHP files must use the Unix LF (linefeed) line ending.'; } /** * {@inheritdoc} */ public function getPriority() { return 50; } }