Skip to content

Commit

Permalink
Add PHAR compactors (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored Jul 20, 2024
1 parent a58ce7e commit e5a32e1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ composer.lock
## Infection
infection.log
infection.html

## Box
bin/twig-cs-fixer.phar
7 changes: 6 additions & 1 deletion box.json.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"compression": "GZ"
"compression": "GZ",
"compactors": [
"KevinGH\\Box\\Compactor\\Php",
"KevinGH\\Box\\Compactor\\PhpScoper",
"KevinGH\\Box\\Compactor\\Json"
]
}
1 change: 1 addition & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
__DIR__.'/tests',
__DIR__.'/.php-cs-fixer.php',
__DIR__.'/rector.php',
__DIR__.'/scoper.inc.php',
]);

$rectorConfig->sets([
Expand Down
28 changes: 28 additions & 0 deletions scoper.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
use Twig\Environment;
use Twig\Extension\ExtensionInterface;
use Twig\NodeVisitor\NodeVisitorInterface;
use Twig\Source;
use Twig\TokenParser\TokenParserInterface;

return [
'exclude-namespaces' => ['TwigCsFixer'],
'expose-global-constants' => false,
'expose-global-classes' => false,
'expose-global-functions' => false,
'expose-namespaces' => ['Twig\Node'],
'expose-classes' => [
OutputInterface::class,
Finder::class,
Environment::class,
ExtensionInterface::class,
NodeVisitorInterface::class,
Source::class,
TokenParserInterface::class,
],
];

0 comments on commit e5a32e1

Please sign in to comment.