Skip to content

Commit 98529ee

Browse files
authored
Sign PHARs (#124)
1 parent 3f8a6cb commit 98529ee

File tree

7 files changed

+26
-22
lines changed

7 files changed

+26
-22
lines changed

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/bin/php-scoper.phar
2-
/bin/php-scoper.phar.pubkey
3-
/bin/php-scoper-old.phar
4-
/bin/php-scoper-old.phar.pubkey
5-
/bin/php-scoper.phar.temp.pubkey
1+
/bin/php-scoper*.phar
2+
/bin/php-scoper*.phar.pubkey
3+
/bin/php-scoper.phar*.pubkey
64
/box.json
7-
/dist/
85
/build/
6+
/dist/
97
/fixtures/set004/scoper.inc.php
108
/fixtures/*/vendor
119
/vendor/
1210
/vendor-bin/box/vendor/
11+
/.travis/
12+
!/.travis/.gitkeep

.travis.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,19 @@ script:
3535
make tu
3636
fi
3737
38+
deploy:
39+
provider: releases
40+
api_key:
41+
secure: zFEfQrogmKsNB+6Y3B8df4cDtfOhaH7DpdOY6AzV9l/YnCVsO8zkFXdNUOynC4FxN82KSjEK9jP8dX9FgS4O8gdLMfWxp4eutvrxBYDazdiFJxRQMiE9O77jAnpcmxpsvNxzY+tNqUduAkaj3dj0uRuD5yttBhaVArosUEyRuhdIoGorfzooY3Q0zqzEy/dpm2EqJ2orXOvVmxreKyVgybalkHktEGNaPDaMgEMsfoIRNeHPP8yRmUw7uIYzbXOvIRXzeulNrBpe2GFhs9fwf3QjDJGDBJG1/Xw39+PV2elJDIQDLMUNQcQu/Uw+gpoUwXzr5VSL+HVgPizzSpvkcBU2YxoY6d3EAcjb0gH9RPC3qP/Kvy9qdON1kEBUarI3WiIpYTMPbatjB2KAIpo6x9njHqbkwKtzrfTBr2QaC72/vUJ0+HmOnJEtrqffqbUDCdltbuQr1P/mJ3RoIkMHZLJtlBzMmgBMA6q1XoGJ7z9ZJINvKc8FBsBoDMTH8Hyr2fNMLWogvEcNW44CmiQXqOuoyg/OCRA0zGaZ6nr7zGWn7PdhfkauWWIwZYZmDnb4Gbibj4Q97E9p8ZFE3jCWXgqCdiVfDyQX4CdrJsRgSFlQl5dm75uh5VJg24dqQLt4qeLWlBpwpI9CWJZNseQpblYxoH8RwhdDr4LLgMUrrK0=
42+
file:
43+
- bin/php-scoper.phar
44+
- bin/php-scoper.phar.pubkey
45+
skip_cleanup: true
46+
on:
47+
tags: true
48+
repo: humbug/php-scoper
49+
php: '7.1'
50+
condition: "$COVERAGE"
51+
3852
notifications:
39-
email: false
53+
email: false

.travis/.gitkeep

Whitespace-only changes.

box.json.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"in": "."
2323
}
2424
],
25+
"algorithm": "OPENSSL",
26+
"key": ".travis/php-scoper-private.pem",
2527
"compression": "GZ",
2628
"compactors": [
2729
"Herrera\\Box\\Compactor\\Json",

src/NodeVisitor/Resolver/FullyQualifiedNameResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private function resolveNodeName(Name $name, ?Name $namespace, ?Name $use): Name
6868

6969
if (
7070
($parentNode instanceof ConstFetch || $parentNode instanceof FuncCall)
71-
&& count($name->parts) === 1
71+
&& 1 === count($name->parts)
7272
) {
7373
// Ambiguous name, cannot determine the FQ name
7474
return $name;

src/NodeVisitor/UseStmt/UseStmtPrefixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ private function shouldPrefixUseStmt(UseUse $use): bool
7070

7171
if (1 === count($use->name->parts)) {
7272
return
73-
$useType !== Use_::TYPE_NORMAL
73+
Use_::TYPE_NORMAL !== $useType
7474
|| ($this->globalWhitelister)($use->name->getFirst())
7575
;
7676
}
7777

7878
return false === (
79-
$useType === Use_::TYPE_NORMAL
79+
Use_::TYPE_NORMAL === $useType
8080
&& in_array((string) $use->name, $this->whitelist)
8181
);
8282
}

src/functions.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,6 @@ function create_application(): SymfonyApplication
7474
*/
7575
function get_version(): string
7676
{
77-
if ('phar:' === substr(__FILE__, 0, 5)) {
78-
$gitVersion = '@git-version@';
79-
$semanticVersion = preg_replace(
80-
["/\.\d\-/", "/\-/"],
81-
['-', '-dev+'],
82-
$gitVersion,
83-
1
84-
);
85-
86-
return $semanticVersion;
87-
}
88-
8977
$rawVersion = Versions::getVersion('humbug/php-scoper');
9078

9179
list($prettyVersion, $commitHash) = explode('@', $rawVersion);

0 commit comments

Comments
 (0)