Skip to content

Commit fb11c9a

Browse files
committed
init project
0 parents  commit fb11c9a

14 files changed

+329
-0
lines changed

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = false
10+
11+
[*.{vue,js,scss}]
12+
charset = utf-8
13+
indent_style = space
14+
indent_size = 2
15+
end_of_line = lf
16+
insert_final_newline = true
17+
trim_trailing_whitespace = true
18+
19+
[*.md]
20+
trim_trailing_whitespace = false

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto
2+
3+
/tests export-ignore
4+
.gitattributes export-ignore
5+
.gitignore export-ignore
6+
.scrutinizer.yml export-ignore
7+
.travis.yml export-ignore
8+
phpunit.php export-ignore
9+
phpunit.xml.dist export-ignore
10+
phpunit.xml export-ignore
11+
.php_cs export-ignore

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
.idea/
3+
vendor
4+
composer.phar
5+
phpunit.xml
6+
composer.lock
7+
.php_cs.cache
8+
.hg
9+
.phpunit.result.cache
10+
clover.xml
11+
.phplint.cache

.php_cs

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
$header = <<<EOF
4+
5+
This file is part of the ti-ecdh/php-ecdh package.
6+
7+
(c) Panda <[email protected]>
8+
9+
This source file is subject to the MIT license that is bundled
10+
with this source code in the file LICENSE.
11+
EOF;
12+
13+
$finder = PhpCsFixer\Finder::create()
14+
->files()
15+
->name('*.php')
16+
->exclude('Fixtures')
17+
->in(__DIR__.'/src')
18+
->in(__DIR__.'/tests')
19+
;
20+
21+
return PhpCsFixer\Config::create()
22+
->setUsingCache(true)
23+
->setRiskyAllowed(true)
24+
->setRules(array(
25+
'@PSR2' => true,
26+
// some rules disabled as long as 1.x branch is maintained
27+
'binary_operator_spaces' => array(
28+
'default' => null,
29+
),
30+
'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'return', 'throw', 'try']],
31+
'cast_spaces' => ['space' => 'single'],
32+
'header_comment' => [
33+
'commentType' => 'PHPDoc',
34+
'header' => $header,
35+
'separate' => 'none'
36+
],
37+
'include' => true,
38+
'class_attributes_separation' => ['elements' => ['method']],
39+
'no_blank_lines_after_class_opening' => true,
40+
'no_blank_lines_after_phpdoc' => true,
41+
'no_empty_statement' => true,
42+
'no_extra_consecutive_blank_lines' => true,
43+
'no_leading_import_slash' => true,
44+
'no_leading_namespace_whitespace' => true,
45+
'no_trailing_comma_in_singleline_array' => true,
46+
'no_unused_imports' => true,
47+
'no_whitespace_in_blank_line' => true,
48+
'object_operator_without_whitespace' => true,
49+
'phpdoc_align' => true,
50+
'phpdoc_indent' => true,
51+
'phpdoc_no_access' => true,
52+
'phpdoc_no_package' => true,
53+
'phpdoc_order' => true,
54+
'phpdoc_scalar' => true,
55+
'phpdoc_trim' => true,
56+
'phpdoc_types' => true,
57+
'psr0' => true,
58+
'array_syntax' => [
59+
'syntax' => 'short'
60+
],
61+
'declare_strict_types' => true,
62+
'single_blank_line_before_namespace' => true,
63+
'standardize_not_equals' => true,
64+
'ternary_operator_spaces' => true,
65+
'trailing_comma_in_multiline_array' => true,
66+
))
67+
->setFinder($finder)
68+
;

.phplint.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
path: ./
2+
jobs: 10
3+
cache: ./.phplint.cache
4+
extensions:
5+
- php
6+
exclude:
7+
- vendor

.scrutinizer.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
checks:
2+
php:
3+
code_rating: true
4+
duplication: true
5+
filter:
6+
excluded_paths:
7+
- tests/*
8+
build:
9+
tests:
10+
override:
11+
- command: ./vendor/bin/phpunit --coverage-clover=clover.xml
12+
coverage:
13+
file: clover.xml
14+
format: php-clover
15+
nodes:
16+
analysis:
17+
tests:
18+
override:
19+
- php-scrutinizer-run

.styleci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
preset: psr2
2+
3+
enabled:
4+
- ordered_use

.travis.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
language: php
2+
3+
matrix:
4+
fast_finish: true
5+
include:
6+
- php: 7.1
7+
- php: 7.2
8+
- php: 7.3
9+
10+
sudo: false
11+
12+
before_install:
13+
- travis_retry composer self-update
14+
- sudo apt-get update
15+
- sudo apt-get install -y redis
16+
17+
install:
18+
- travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest
19+
20+
script:
21+
- ./vendor/bin/phplint
22+
- ./vendor/bin/php-cs-fixer fix $1
23+
- ./vendor/bin/phpunit --coverage-text
24+
25+
after_success:
26+
- bash <(curl -s https://codecov.io/bash)

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 ti-ecdh/php-ecdh
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<h1 align="center">Welcome to php-geo 👋</h1>
2+
<p>
3+
</p>
4+
5+
[![Build Status](https://travis-ci.org/ti-ecdh/php-ecdh.svg?branch=master)](https://travis-ci.org/ti-ecdh/php-ecdh)
6+
[![codecov.io](http://codecov.io/github/ti-ecdh/php-ecdh/coverage.svg?branch=master)](http://codecov.io/github/ti-ecdh/php-ecdh?branch=master)
7+
[![Code Intelligence Status](https://scrutinizer-ci.com/g/ti-ecdh/php-ecdh/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)
8+
[![Latest Stable Version](https://poser.pugx.org/ti-ecdh/php-ecdh/v/stable)](https://packagist.org/packages/ti-ecdh/php-ecdh)
9+
[![Licence](https://poser.pugx.org/ti-ecdh/php-ecdh/license.svg)](https://packagist.org/packages/ti-ecdh/php-ecdh)
10+
[![Total Downloads](https://poser.pugx.org/ti-ecdh/php-ecdh/downloads.svg)](https://packagist.org/packages/ti-ecdh/php-ecdh)
11+
![StyleCI](https://github.styleci.io/repos/194645280/shield?branch=master)
12+
13+
## Install
14+
15+
```sh
16+
composer require ti-ecdh/php-ecdh
17+
```
18+
19+
## Usage
20+
21+
22+
## Show your support
23+
24+
Give a ⭐️ if this project helped you!
25+
26+
***
27+
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

composer.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "ti-ecdh/php-ecdh",
3+
"description": "ECDH (Elliptic Curve Diffie Hellman) algorithm library based on PHP implementation ",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "wujunze",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"php": "^7.1",
14+
"wujunze/support": "^1.0",
15+
"predis/predis": "^1.1",
16+
"wujunze/helper": "^1.0",
17+
"ext-json": "*"
18+
},
19+
"require-dev": {
20+
"wujunze/composer-phpcs-plugin": "^1.1",
21+
"codedungeon/phpunit-result-printer": "^0.23",
22+
"phpunit/phpunit": "^7.5",
23+
"overtrue/phplint": "^1.1"
24+
},
25+
"autoload": {
26+
"psr-4": {
27+
"Ti\\ECDH\\": "src/"
28+
}
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"Ti\\ECDH\\Tests\\": "tests/"
33+
}
34+
},
35+
"scripts": {
36+
"test": [
37+
"./vendor/bin/phpunit -c phpunit.xml.dist --coverage-text"
38+
],
39+
"fix": [
40+
"./vendor/bin/php-cs-fixer fix $1"
41+
],
42+
"lint": [
43+
"./vendor/bin/phplint"
44+
]
45+
}
46+
}

phpunit.xml.dist

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<phpunit printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer" backupGlobals="false"
3+
backupStaticAttributes="false"
4+
colors="true"
5+
convertErrorsToExceptions="true"
6+
convertNoticesToExceptions="true"
7+
convertWarningsToExceptions="true"
8+
processIsolation="false"
9+
stopOnFailure="false"
10+
bootstrap="vendor/autoload.php">
11+
<testsuites>
12+
<testsuite name="default">
13+
<directory suffix="Test.php">./tests</directory>
14+
</testsuite>
15+
16+
<testsuite name="main">
17+
<directory suffix="Test.php">./tests</directory>
18+
<exclude>./tests/repositories</exclude>
19+
</testsuite>
20+
21+
<testsuite name="repo">
22+
<directory suffix="Test.php">./tests/repositories</directory>
23+
</testsuite>
24+
</testsuites>
25+
<filter>
26+
<whitelist processUncoveredFilesFromWhitelist="true">
27+
<directory suffix=".php">./src</directory>
28+
</whitelist>
29+
</filter>
30+
<logging>
31+
<log type="coverage-clover" target="clover.xml"/>
32+
</logging>
33+
</phpunit>

src/ECDH.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php declare(strict_types=1);
2+
/**
3+
*
4+
* This file is part of the ti-ecdh/php-ecdh package.
5+
*
6+
* (c) Panda <[email protected]>
7+
*
8+
* This source file is subject to the MIT license that is bundled
9+
* with this source code in the file LICENSE.
10+
*/
11+
12+
namespace Ti\ECDH;
13+
14+
class ECDH
15+
{
16+
}

tests/TestCase.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php declare(strict_types=1);
2+
/**
3+
*
4+
* This file is part of the ti-ecdh/php-ecdh package.
5+
*
6+
* (c) Panda <[email protected]>
7+
*
8+
* This source file is subject to the MIT license that is bundled
9+
* with this source code in the file LICENSE.
10+
*/
11+
12+
namespace Ti\ECDH\Tests;
13+
14+
class TestCase extends \PHPUnit\Framework\TestCase
15+
{
16+
public function testOne()
17+
{
18+
$this->assertTrue(true);
19+
}
20+
}

0 commit comments

Comments
 (0)