1. Go to this page and download the library: Download sirbrillig/phpcs-changed library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sirbrillig / phpcs-changed example snippets
use function PhpcsChanged\getNewPhpcsMessagesFromFiles;
$changedMessages = getNewPhpcsMessagesFromFiles(
$unifiedDiffFileName,
$oldFilePhpcsOutputFileName,
$newFilePhpcsOutputFileName
);
echo $changedMessages->toPhpcsJson();
use function PhpcsChanged\getNewPhpcsMessages;
use function PhpcsChanged\getNewPhpcsMessagesFromFiles;
use PhpcsChanged\PhpcsMessages;
$changedMessages = getNewPhpcsMessagesFromFiles(
$unifiedDiffFileName,
$oldFilePhpcsOutputFileName,
$newFilePhpcsOutputFileName
);
echo $changedMessages->toPhpcsJson();
use function PhpcsChanged\getNewPhpcsMessages;
use function PhpcsChanged\getNewPhpcsMessagesFromFiles;
use PhpcsChanged\PhpcsMessages;
$changedMessagesA = getNewPhpcsMessages(
$unifiedDiffA,
PhpcsMessages::fromPhpcsJson($oldFilePhpcsOutputA),
PhpcsMessages::fromPhpcsJson($newFilePhpcsOutputA)
$changedMessagesB = getNewPhpcsMessagesFromFiles(
$unifiedDiffFileNameB,
$oldFilePhpcsOutputFileNameB,
$newFilePhpcsOutputFileNameB
);
$changedMessages = PhpcsMessages::merge([$changedMessagesA, $changedMessagesB]);
echo $changedMessages->toPhpcsJson();