-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBundledPhpExtensionRefusal.php
More file actions
36 lines (29 loc) · 1.08 KB
/
BundledPhpExtensionRefusal.php
File metadata and controls
36 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace Php\Pie\DependencyResolver;
use Php\Pie\Platform\TargetPhp\PhpBinaryPath;
use RuntimeException;
use function sprintf;
use const PHP_EOL;
class BundledPhpExtensionRefusal extends RuntimeException
{
public static function forPackage(Package $package): self
{
return new self(sprintf(
'Bundled PHP extension %s should be installed by your distribution, not by PIE.%s%sCombining installation methods of bundled PHP extensions can lead to confusing and unintended consequences.%s%sIf you are really sure, you want to install %s using PIE, re-run the command with the --force flag.',
$package->name(),
PHP_EOL,
PHP_EOL,
PHP_EOL,
PHP_EOL,
$package->name(),
));
}
public static function forPhpExtraVersion(PhpBinaryPath $phpBinaryPath): self
{
return new self(sprintf(
'Cannot install bundled PHP extension for non-stable versions of PHP (detected: %s)',
$phpBinaryPath->phpVersionWithExtra(),
));
}
}