Skip to content

Commit 880eb08

Browse files
committed
Change requirements to PHP 7.2
1 parent 59f4b4a commit 880eb08

File tree

321 files changed

+6737
-6126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+6737
-6126
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
tab_width = 4
33
end_of_line = lf
44

5-
[*.{php}]
5+
[*.{php,json,xml.dist}]
66
indent_style = space

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# export
22
.git* export-ignore
33
.*.yml export-ignore
4+
.php_cs* export-ignore
45
test/ export-ignore
56
phpunit.* export-ignore
67
.editorconfig export-ignore

.gitignore

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
# eclipse project files
1+
# Eclipse project files
22
/.settings/
33
/.buildpath
44
/.project
55
/.pydevproject
66

7-
# build
7+
# VS Code
8+
/.vscode
9+
10+
# build files
811
/build/
12+
/.*.cache
913

10-
# composer
14+
# Composer
1115
/vendor/
1216
/composer.lock
1317

18+
# non-dist files
19+
/phpunit.xml
20+
/.php_cs
21+
1422
# sandbox
1523
/demo/

.php_cs.dist

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
$finder = PhpCsFixer\Finder::create()
6+
->in(__DIR__);
7+
8+
return PhpCsFixer\Config::create()
9+
->setRules([
10+
'@PSR2' => true,
11+
'@PhpCsFixer' => true,
12+
'multiline_whitespace_before_semicolons' => [
13+
'strategy' => 'no_multi_line',
14+
],
15+
'declare_equal_normalize' => [
16+
'space' => 'single',
17+
],
18+
'method_argument_space' => [
19+
'on_multiline' => 'ignore',
20+
],
21+
'blank_line_before_statement' => [
22+
'statements' => [],
23+
],
24+
'concat_space' => [
25+
'spacing' => 'one',
26+
],
27+
'list_syntax' => [
28+
'syntax' => 'short',
29+
],
30+
'php_unit_test_class_requires_covers' => false,
31+
'phpdoc_types' => false,
32+
])
33+
->setFinder($finder);

.scrutinizer.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
build:
2+
nodes:
3+
analysis:
4+
tests:
5+
override:
6+
- php-scrutinizer-run
7+
tests-and-coverage:
8+
requires:
9+
- node: analysis
10+
tests:
11+
override:
12+
- command: vendor/bin/phpunit
13+
coverage:
14+
format: clover
15+
file: build/logs/clover.xml
216
environment:
317
php:
4-
version: 7.0.20
5-
tests:
6-
override:
7-
- command: vendor/bin/phpunit
8-
coverage:
9-
format: php-clover
10-
file: build/logs/clover.xml
18+
version: 7.2
19+
filter:
20+
excluded_paths:
21+
- test/
22+
- examples/
23+
dependency_paths:
24+
- vendor/
1125
checks:
1226
php:
1327
code_rating: true
1428
duplication: false
15-
filter:
16-
excluded_paths:
17-
- test/

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
language: php
22
php:
3-
- "7.0"
4-
- "7.1"
53
- "7.2"
6-
- "nightly"
4+
- "7.3"
75
before_script:
86
- "composer install"
9-
- "composer require satooshi/php-coveralls"
7+
- "composer require php-coveralls/php-coveralls"
108
after_success:
11-
- "travis_retry php vendor/bin/coveralls -v"
9+
- "travis_retry php vendor/bin/php-coveralls -v"

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016 Joni Eskelinen
3+
Copyright (c) 2016-2019 Joni Eskelinen
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Also implements unencoded payload option
4747

4848
## Requirements
4949

50-
- PHP >=7.0
50+
- PHP >=7.2
5151
- openssl
5252
- hash
5353
- [sop/crypto-types](https://github.com/sop/crypto-types)

composer.json

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,61 @@
11
{
2-
"name": "sop/jwx",
3-
"description": "A PHP library for JSON web tokens (JWT) with signature (JWS) and encryption (JWE) support.",
4-
"homepage": "https://github.com/sop/jwx",
5-
"license": "MIT",
6-
"type": "library",
7-
"keywords": [
8-
"jwt",
9-
"json web token",
10-
"jws",
11-
"json web signature",
12-
"jwe",
13-
"json web encryption",
14-
"jwk",
15-
"json web key",
16-
"json",
17-
"token",
18-
"jose"
19-
],
20-
"authors": [
21-
{
22-
"name": "Joni Eskelinen",
23-
"email": "[email protected]",
24-
"role": "Developer"
25-
}
26-
],
27-
"require": {
28-
"php": ">=7.0",
29-
"ext-openssl": "*",
30-
"ext-hash": "*",
31-
"sop/crypto-types": "^0.2.1",
32-
"sop/crypto-encoding": "^0.2.0",
33-
"sop/aes-kw": "^2.0.0",
34-
"sop/gcm": "^2.0.0"
35-
},
36-
"require-dev": {
37-
"phpunit/phpunit": "^6.5",
38-
"ietf-jose/cookbook": "*"
39-
},
40-
"autoload": {
41-
"psr-4": {
42-
"JWX\\": "lib/JWX/"
43-
}
44-
},
45-
"repositories": [
46-
{
47-
"type": "package",
48-
"package": {
49-
"name": "ietf-jose/cookbook",
50-
"version": "1.0.0",
51-
"source": {
52-
"url": "https://github.com/ietf-jose/cookbook.git",
53-
"type": "git",
54-
"reference": "master"
55-
}
56-
}
57-
}
58-
]
2+
"name": "sop/jwx",
3+
"description": "A PHP library for JSON web tokens (JWT) with signature (JWS) and encryption (JWE) support.",
4+
"homepage": "https://github.com/sop/jwx",
5+
"license": "MIT",
6+
"type": "library",
7+
"keywords": [
8+
"jwt",
9+
"json web token",
10+
"jws",
11+
"json web signature",
12+
"jwe",
13+
"json web encryption",
14+
"jwk",
15+
"json web key",
16+
"json",
17+
"token",
18+
"jose"
19+
],
20+
"authors": [
21+
{
22+
"name": "Joni Eskelinen",
23+
"email": "[email protected]",
24+
"role": "Developer"
25+
}
26+
],
27+
"minimum-stability": "dev",
28+
"prefer-stable": true,
29+
"require": {
30+
"php": ">=7.2",
31+
"ext-openssl": "*",
32+
"ext-hash": "*",
33+
"sop/crypto-types": "dev-php72 as 0.2.1",
34+
"sop/crypto-encoding": "dev-php72 as 0.2.0",
35+
"sop/aes-kw": "dev-php72 as 2.0.0",
36+
"sop/gcm": "dev-php72 as 2.0.0"
37+
},
38+
"require-dev": {
39+
"phpunit/phpunit": "^8.1",
40+
"ietf-jose/cookbook": "*"
41+
},
42+
"autoload": {
43+
"psr-4": {
44+
"Sop\\JWX\\": "lib/JWX/"
45+
}
46+
},
47+
"repositories": [
48+
{
49+
"type": "package",
50+
"package": {
51+
"name": "ietf-jose/cookbook",
52+
"version": "1.0.0",
53+
"source": {
54+
"url": "https://github.com/ietf-jose/cookbook.git",
55+
"type": "git",
56+
"reference": "master"
57+
}
58+
}
59+
}
60+
]
5961
}

examples/arbitrary-decrypt.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
* php arbitrary-decrypt.php $(php arbitrary-encrypt.php)
88
*/
99

10-
use JWX\JWE\JWE;
11-
use JWX\JWK\Symmetric\SymmetricKeyJWK;
10+
declare(strict_types = 1);
1211

13-
require dirname(__DIR__) . "/vendor/autoload.php";
12+
use Sop\JWX\JWE\JWE;
13+
use Sop\JWX\JWK\Symmetric\SymmetricKeyJWK;
14+
15+
require dirname(__DIR__) . '/vendor/autoload.php';
1416

1517
// create a JSON Web Key from password
16-
$jwk = SymmetricKeyJWK::fromKey("MySecretPassword");
18+
$jwk = SymmetricKeyJWK::fromKey('MySecretPassword');
1719
// read JWE token from the first argument
1820
$jwe = JWE::fromCompact($argv[1]);
1921
// decrypt the payload using a JSON Web Key
2022
$payload = $jwe->decryptWithJWK($jwk);
21-
echo "$payload\n";
23+
echo "{$payload}\n";

0 commit comments

Comments
 (0)