Danger runs during your CI process, and gives teams the chance to automate common code review chores. This project ports Danger to PHP. This project is still in the early phase. Feel free to try it out and contribute!
Currently only Github and Gitlab are supported as Platform
Install danger-php using Composer
composer global require shyim/danger-phpEvery release has an phar archive attached
Use the prebuilt Docker image
<?php declare(strict_types=1);
use Danger\Config;
use Danger\Rule\DisallowRepeatedCommitsRule;
return (new Config())
->useRule(new DisallowRepeatedCommitsRule) // Disallows multiple commits with the same message
;<?php declare(strict_types=1);
use Danger\Config;
use Danger\Rule\MaxCommitRule;
return (new Config())
->useRule(new MaxCommitRule(1))
;
<?php declare(strict_types=1);
use Danger\Config;
use Danger\Context;
return (new Config())
->useRule(function (Context $context): void {
if (!$context->platform->pullRequest->getFiles()->has('CHANGELOG.md')) {
$context->failure('Please edit also the CHANGELOG.md');
}
})
;<?php declare(strict_types=1);
use Danger\Config;
use Danger\Context;
return (new Config())
->useRule(function (Context $context): void {
if (count($context->platform->pullRequest->assignees) === 0) {
$context->warning('This PR currently doesn\'t have an assignee');
}
})
;