for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the box project.
*
* (c) Kevin Herrera <[email protected]>
* Théo Fidry <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace KevinGH\Box\Compactor;
use Humbug\PhpScoper\Console\Configuration as PhpScoperConfiguration;
use KevinGH\Box\Compactor;
use Humbug\PhpScoper\Scoper;
final class PhpScoper implements Compactor
{
private $scoper;
private $config;
public function __construct(Scoper $scoper, PhpScoperConfiguration $config)
$this->scoper = $scoper;
$this->config = $config;
}
/**
* @inheritdoc
public function compact(string $file, string $contents): string
return $this->scoper->scope(
$file,
$contents,
'TODOAllowNullPrefix',
$this->config->getPatchers(),
$this->config->getWhitelist(),
$this->config->getGlobalNamespaceWhitelister()
);
public function getConfiguration(): PhpScoperConfiguration
return $this->config;