Skip to content

Commit 8a44976

Browse files
committed
CS: Work in progress.
1 parent a2fa165 commit 8a44976

Some content is hidden

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

59 files changed

+489
-456
lines changed

.editorconfig

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
# This file is for unifying the coding style for different editors and IDEs
2-
# editorconfig.org
3-
4-
# PHP PSR-2 Coding Standards
5-
# http://www.php-fig.org/psr/psr-2/
6-
71
root = true
82

9-
[*.php]
10-
charset = utf-8
3+
[*]
114
end_of_line = lf
12-
insert_final_newline = true
13-
trim_trailing_whitespace = true
5+
charset = utf-8
6+
max_line_length = 80
147
indent_style = space
158
indent_size = 4
9+
insert_final_newline = true

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/spec export-ignore
2+
.editorconfig export-ignore
3+
.gitattributes export-ignore
4+
.gitignore export-ignore
5+
.scrutinizer.yml export-ignore
6+
.travis.yml export-ignore
7+
phpunit.xml.dist export-ignore
8+
infection.json.dist export-ignore
9+
grumphp.yml.dist export-ignore
10+
phpspec.yml.dist export-ignore

.github/settings.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# https://github.com/probot/settings
2+
3+
branches:
4+
- name: master
5+
protection:
6+
enforce_admins: false
7+
required_pull_request_reviews:
8+
dismiss_stale_reviews: true
9+
require_code_owner_reviews: true
10+
required_approving_review_count: 1
11+
required_status_checks:
12+
contexts:
13+
- "Grumphp"
14+
strict: false
15+
restrictions: null
16+
17+
labels:
18+
- name: bug
19+
color: ee0701
20+
21+
- name: dependencies
22+
color: 0366d6
23+
24+
- name: enhancement
25+
color: 0e8a16
26+
27+
- name: question
28+
color: cc317c
29+
30+
- name: security
31+
color: ee0701
32+
33+
- name: stale
34+
color: eeeeee
35+
36+
repository:
37+
allow_merge_commit: true
38+
allow_rebase_merge: false
39+
allow_squash_merge: false
40+
default_branch: master
41+
description: "Generators and iterators, permutations and combinations."
42+
topics: math,numbers,permutations,combinations,iterators,fibonacci,prime numbers,product
43+
has_downloads: true
44+
has_issues: true
45+
has_pages: false
46+
has_projects: false
47+
has_wiki: false
48+
name: phptree
49+
private: false
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
name: "Continuous Integration"
8+
9+
jobs:
10+
grumphp:
11+
name: "Grumphp"
12+
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
php-binary:
18+
- php7.1
19+
- php7.2
20+
- php7.3
21+
22+
steps:
23+
- name: "Checkout"
24+
uses: actions/checkout@master
25+
with:
26+
fetch-depth: 1
27+
28+
- name: "Composer install"
29+
run: ${{ matrix.php-binary }} $(which composer) install --no-interaction --no-progress --no-suggest
30+
31+
- name: "Composer install lowest dependencies"
32+
if: matrix.dependencies == 'lowest'
33+
run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest
34+
35+
- name: "Install Graphviz"
36+
run: sudo apt-get install graphviz
37+
38+
- name: "Run Grumphp"
39+
run: ${{ matrix.php-binary }} vendor/bin/grumphp run
40+
env:
41+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
42+
43+
- name: "Scrutinizer"
44+
run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml

.gitignore

Lines changed: 6 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,8 @@
1-
# Created by .ignore support plugin (hsz.mobi)
2-
### Composer template
3-
composer.phar
4-
/vendor/
5-
6-
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
7-
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
8-
# composer.lock
9-
### JetBrains template
10-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
11-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
12-
13-
# User-specific stuff:
14-
.idea/**/workspace.xml
15-
.idea/**/tasks.xml
16-
.idea/dictionaries
17-
18-
# Sensitive or high-churn files:
19-
.idea/**/dataSources/
20-
.idea/**/dataSources.ids
21-
.idea/**/dataSources.xml
22-
.idea/**/dataSources.local.xml
23-
.idea/**/sqlDataSources.xml
24-
.idea/**/dynamic.xml
25-
.idea/**/uiDesigner.xml
26-
27-
# Gradle:
28-
.idea/**/gradle.xml
29-
.idea/**/libraries
30-
31-
# CMake
32-
cmake-build-debug/
33-
34-
# Mongo Explorer plugin:
35-
.idea/**/mongoSettings.xml
36-
37-
## File-based project format:
38-
*.iws
39-
40-
## Plugin-specific files:
41-
42-
# IntelliJ
43-
out/
44-
45-
# mpeltonen/sbt-idea plugin
46-
.idea_modules/
47-
48-
# JIRA plugin
49-
atlassian-ide-plugin.xml
50-
51-
# Cursive Clojure plugin
52-
.idea/replstate.xml
53-
54-
# Crashlytics plugin (for Android Studio and IntelliJ)
55-
com_crashlytics_export_strings.xml
56-
crashlytics.properties
57-
crashlytics-build.properties
58-
fabric.properties
59-
60-
/.php_cs.cache
611
/composer.lock
2+
/vendor
3+
/build
4+
/.php_cs.cache
5+
/example/
6+
/.idea/
627
/test.php
63-
/build/
8+
/phpspec.yml

.scrutinizer.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
build: false
1+
build:
2+
nodes:
3+
analysis:
4+
tests:
5+
override:
6+
- php-scrutinizer-run
27

38
filter:
49
paths:
@@ -7,3 +12,7 @@ filter:
712
tools:
813
external_code_coverage:
914
timeout: 600
15+
php_loc: true
16+
php_pdepend: true
17+
php_sim: true
18+
php_changetracking: true

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Latest Stable Version](https://img.shields.io/packagist/v/drupol/phpermutations.svg?style=flat-square)](https://packagist.org/packages/drupol/phpermutations)
22
[![GitHub stars](https://img.shields.io/github/stars/drupol/phpermutations.svg?style=flat-square)](https://packagist.org/packages/drupol/phpermutations)
33
[![Total Downloads](https://img.shields.io/packagist/dt/drupol/phpermutations.svg?style=flat-square)](https://packagist.org/packages/drupol/phpermutations)
4-
[![Build Status](https://img.shields.io/travis/drupol/phpermutations/master.svg?style=flat-square)](https://travis-ci.org/drupol/phpermutations)
4+
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/drupol/phpermutations/Continuous%20Integration?style=flat-square)](https://github.com/drupol/phpermutations/actions)
55
[![Build Status](https://img.shields.io/appveyor/ci/drupol/phpermutations.svg?style=flat-square)](https://ci.appveyor.com/project/drupol/phpermutations)
66
[![Scrutinizer code quality](https://img.shields.io/scrutinizer/quality/g/drupol/phpermutations/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/drupol/phpermutations/?branch=master)
77
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/drupol/phpermutations/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/drupol/phpermutations/?branch=master)
@@ -44,7 +44,7 @@ objects), the library will still continue to work without any trouble.
4444

4545
## Requirements
4646

47-
* PHP >= 5.6,
47+
* PHP >= 7.1.3,
4848

4949
## How to use
5050

@@ -166,7 +166,7 @@ of each combinations having a length of 3 of that array.
166166

167167
Each Generators and Iterators are tested using the same values as input. I try to be as much complete as possible with
168168
the [tests](https://github.com/drupol/phpermutations/tree/master/tests/fixtures).
169-
Every time the sources are modified, [Travis](https://travis-ci.org/drupol/phpermutations), the continuous integration
169+
Every time the sources are modified, [Github](https://github.com/drupol/phpermutations/actions), the continuous integration
170170
service, tests the code against those tests, this way you are aware if the changes that you are introducing are valid.
171171

172172
# Contributing

composer.json

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,49 @@
11
{
22
"name": "drupol/phpermutations",
3-
"description": "Generators and iterators, permutations and combinations.",
43
"type": "library",
4+
"description": "Generators and iterators, permutations and combinations.",
5+
"keywords": [
6+
"math",
7+
"numbers",
8+
"permutations",
9+
"combinations",
10+
"iterators",
11+
"fibonacci",
12+
"prime numbers",
13+
"product"
14+
],
515
"homepage": "https://github.com/drupol/phpermutations",
6-
"keywords": ["math", "numbers", "permutations", "combinations", "iterators", "fibonacci", "prime numbers", "product"],
716
"license": "GPL-3.0-only",
8-
"support": {
9-
"issues": "https://github.com/drupol/phpermutations/issues",
10-
"source": "https://github.com/drupol/phpermutations"
11-
},
1217
"authors": [
1318
{
1419
"name": "Pol Dellaiera",
1520
"email": "pol.dellaiera@protonmail.com"
1621
}
1722
],
1823
"require": {
19-
"php": ">= 5.6"
24+
"php": ">= 7.1.3"
2025
},
2126
"require-dev": {
22-
"drupol/php-conventions": "^1.3",
23-
"phpunit/phpunit": "^5 || ^6",
24-
"phpunit/php-code-coverage": "^4 || ^5"
27+
"drupol/php-conventions": "^1.6.8",
28+
"phpunit/php-code-coverage": "^4 || ^5",
29+
"phpunit/phpunit": "^6 || ^7",
30+
"symfony/process": "^4.4.1"
2531
},
26-
"scripts": {
27-
"phpunit": "./vendor/bin/phpunit --coverage-clover build/logs/clover.xml -c tests/phpunit.xml tests",
28-
"grumphp": "./vendor/bin/grumphp run"
32+
"config": {
33+
"sort-packages": true
2934
},
3035
"autoload": {
3136
"psr-4": {
3237
"drupol\\phpermutations\\": "src/",
3338
"drupol\\phpermutations\\Tests\\": "tests/src/"
3439
}
3540
},
36-
"config": {
37-
"sort-packages": true
41+
"scripts": {
42+
"grumphp": "./vendor/bin/grumphp run",
43+
"phpunit": "./vendor/bin/phpunit --coverage-clover build/logs/clover.xml -c tests/phpunit.xml tests"
44+
},
45+
"support": {
46+
"issues": "https://github.com/drupol/phpermutations/issues",
47+
"source": "https://github.com/drupol/phpermutations"
3848
}
3949
}

0 commit comments

Comments
 (0)