Skip to content

Commit

Permalink
Fix GPG key (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored Aug 13, 2024
1 parent bf36c83 commit ac11c63
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 32 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/phar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,17 @@ jobs:
run: bin/twig-cs-fixer.phar lint -c tests/Binary/Fixtures/.twig-cs-fixer.php tests/Binary/Fixtures/file.twig

- name: Import GPG key
if: github.event_name == 'release'
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_KEY_AC0E7FD8858D80003AA88FF8DEBB71EDE9601234 }}
passphrase: ${{ secrets.GPG_KEY_AC0E7FD8858D80003AA88FF8DEBB71EDE9601234_PASSPHRASE }}
gpg_private_key: ${{ secrets.GPG_KEY_6371FDC534E47BD979208B6F21A10B2F4F0488C9 }}
passphrase: ${{ secrets.GPG_KEY_6371FDC534E47BD979208B6F21A10B2F4F0488C9_PASSPHRASE }}

- name: Sign the PHAR
if: github.event_name == 'release'
run: |
gpg --local-user [email protected] \
gpg --local-user 6371FDC534E47BD979208B6F21A10B2F4F0488C9 \
--batch \
--yes \
--passphrase="${{ secrets.GPG_KEY_AC0E7FD8858D80003AA88FF8DEBB71EDE9601234_PASSPHRASE }}" \
--passphrase="${{ secrets.GPG_KEY_6371FDC534E47BD979208B6F21A10B2F4F0488C9_PASSPHRASE }}" \
--detach-sign \
--output bin/twig-cs-fixer.phar.asc \
bin/twig-cs-fixer.phar
Expand Down
14 changes: 7 additions & 7 deletions tests/Binary/Fixtures/.twig-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@
use TwigCsFixer\Standard\StandardInterface;
use TwigCsFixer\Token\Tokens;

$rule = new class() extends AbstractRule {
$rule = new class extends AbstractRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
}
};

$nodeRule = new class() extends AbstractNodeRule {
$nodeRule = new class extends AbstractNodeRule {
public function enterNode(Node $node, Environment $env): Node
{
return $node;
}
};

$standard = new class() implements StandardInterface {
$standard = new class implements StandardInterface {
public function getRules(): array
{
return [];
}
};

$reporter = new class() implements ReporterInterface {
$reporter = new class implements ReporterInterface {
public function display(
OutputInterface $output,
Report $report,
Expand All @@ -55,7 +55,7 @@ public function getName(): string
}
};

$twigExtension = new class() implements ExtensionInterface {
$twigExtension = new class implements ExtensionInterface {
public function getTokenParsers(): array
{
return [];
Expand Down Expand Up @@ -87,7 +87,7 @@ public function getOperators(): array
}
};

$tokenParser = new class() implements TokenParserInterface {
$tokenParser = new class implements TokenParserInterface {
public function setParser(Parser $parser): void
{
}
Expand All @@ -103,7 +103,7 @@ public function getTag(): string
}
};

$nodeVisitor = new class() implements NodeVisitorInterface {
$nodeVisitor = new class implements NodeVisitorInterface {
public function enterNode(Node $node, Environment $env): Node
{
return $node;
Expand Down
2 changes: 1 addition & 1 deletion tests/Cache/SignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testSignatureFromRuleset(): void
$rule = self::createStub(RuleInterface::class);
$ruleset->addRule($rule);

$configurableRule = new class() extends AbstractRule implements ConfigurableRuleInterface {
$configurableRule = new class extends AbstractRule implements ConfigurableRuleInterface {
public function getConfiguration(): array
{
return ['a' => 1];
Expand Down
2 changes: 1 addition & 1 deletion tests/Environment/StubbedEnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function testParseWithCustomNodeVisitor(): void
$content = file_get_contents(__DIR__.'/Fixtures/node_visitor.html.twig');
static::assertNotFalse($content);

$visitor = new class() implements NodeVisitorInterface {
$visitor = new class implements NodeVisitorInterface {
public int $called = 0;

public function enterNode(Node $node, Environment $env): Node
Expand Down
2 changes: 1 addition & 1 deletion tests/Report/ReporterFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testGetUnsupporterReporter(): void

public function testGetCustomReporter(): void
{
$fooReporter = new class() implements ReporterInterface {
$fooReporter = new class implements ReporterInterface {
public function getName(): string
{
return 'foo';
Expand Down
6 changes: 3 additions & 3 deletions tests/Rules/Node/NodeRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testEnterNodeRule(): void
{
$report = new Report([new \SplFileInfo('fakeFile.html.twig')]);

$rule = new class() extends AbstractNodeRule {
$rule = new class extends AbstractNodeRule {
public function enterNode(Node $node, Environment $env): Node
{
$this->addWarning('Fake Warning', $node);
Expand All @@ -50,7 +50,7 @@ public function testLeaveNodeRule(): void
{
$report = new Report([new \SplFileInfo('fakeFile.html.twig')]);

$rule = new class() extends AbstractNodeRule {
$rule = new class extends AbstractNodeRule {
public function leaveNode(Node $node, Environment $env): Node
{
$this->addWarning('Fake Warning', $node);
Expand Down Expand Up @@ -81,7 +81,7 @@ public function testRuleName(): void

public function testNodeVisitorPriority(): void
{
$rule = new class() extends AbstractNodeRule {};
$rule = new class extends AbstractNodeRule {};
static::assertSame(0, $rule->getPriority());
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Rules/RuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testRuleWithReport(): void
{
$report = new Report([new \SplFileInfo('fakeFile.html.twig')]);

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
$token = $tokens->get($tokenIndex);
Expand Down Expand Up @@ -55,7 +55,7 @@ public function testRuleWithReport2(): void
{
$report = new Report([new \SplFileInfo('fakeFile.html.twig')]);

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
$token = $tokens->get($tokenIndex);
Expand Down
2 changes: 1 addition & 1 deletion tests/Rules/SpacingRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class SpacingRuleTest extends TestCase
{
public function testSpacingRule(): void
{
$rule = new class() extends AbstractSpacingRule {
$rule = new class extends AbstractSpacingRule {
protected function getSpaceBefore(int $tokenIndex, Tokens $tokens): ?int
{
$token = $tokens->get($tokenIndex);
Expand Down
4 changes: 2 additions & 2 deletions tests/Ruleset/RulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public function testAllowNonFixableRules(): void
{
$ruleset = new Ruleset();

$rule1 = new class() extends AbstractRule {
$rule1 = new class extends AbstractRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
}
};
$rule2 = new class() extends AbstractFixableRule {
$rule2 = new class extends AbstractFixableRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
}
Expand Down
16 changes: 8 additions & 8 deletions tests/Runner/FixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testReplaceToken(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
private bool $isAlreadyExecuted = false;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand Down Expand Up @@ -97,7 +97,7 @@ public function testReplaceTokenIsDesignedAgainstInfiniteLoop(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
$fixer = $this->addFixableError('Error', $tokens->get($tokenIndex));
Expand All @@ -122,7 +122,7 @@ public function testReplaceTokenIsDesignedAgainstConflict(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule1 = new class() extends AbstractFixableRule {
$rule1 = new class extends AbstractFixableRule {
private bool $isAlreadyExecuted = false;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand All @@ -140,7 +140,7 @@ protected function process(int $tokenIndex, Tokens $tokens): void
$fixer->replaceToken($tokenIndex, 'rule');
}
};
$rule2 = new class() extends AbstractFixableRule {
$rule2 = new class extends AbstractFixableRule {
private int $error = 0;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand Down Expand Up @@ -172,7 +172,7 @@ protected function process(int $tokenIndex, Tokens $tokens): void
$fixer->endChangeSet();
}
};
$rule3 = new class() extends AbstractFixableRule {
$rule3 = new class extends AbstractFixableRule {
private bool $isAlreadyExecuted = false;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand Down Expand Up @@ -210,7 +210,7 @@ public function testIgnoredViolations(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
public function getShortName(): string
{
return 'Rule';
Expand Down Expand Up @@ -247,7 +247,7 @@ public function testAddContentMethods(string $content, string $expected): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
private bool $isAlreadyExecuted = false;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand Down Expand Up @@ -313,7 +313,7 @@ public function testNonFixableRulesAreSkipped(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractRule {
$rule = new class extends AbstractRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
throw new \LogicException('Should be skipped');
Expand Down

0 comments on commit ac11c63

Please sign in to comment.