Skip to content

Commit

Permalink
CS: Work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 17, 2019
1 parent a2fa165 commit 8a44976
Show file tree
Hide file tree
Showing 59 changed files with 489 additions and 456 deletions.
14 changes: 4 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/

root = true

[*.php]
charset = utf-8
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
max_line_length = 80
indent_style = space
indent_size = 4
insert_final_newline = true
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/spec export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
infection.json.dist export-ignore
grumphp.yml.dist export-ignore
phpspec.yml.dist export-ignore
49 changes: 49 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# https://github.com/probot/settings

branches:
- name: master
protection:
enforce_admins: false
required_pull_request_reviews:
dismiss_stale_reviews: true
require_code_owner_reviews: true
required_approving_review_count: 1
required_status_checks:
contexts:
- "Grumphp"
strict: false
restrictions: null

labels:
- name: bug
color: ee0701

- name: dependencies
color: 0366d6

- name: enhancement
color: 0e8a16

- name: question
color: cc317c

- name: security
color: ee0701

- name: stale
color: eeeeee

repository:
allow_merge_commit: true
allow_rebase_merge: false
allow_squash_merge: false
default_branch: master
description: "Generators and iterators, permutations and combinations."
topics: math,numbers,permutations,combinations,iterators,fibonacci,prime numbers,product
has_downloads: true
has_issues: true
has_pages: false
has_projects: false
has_wiki: false
name: phptree
private: false
44 changes: 44 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
- pull_request
- push

name: "Continuous Integration"

jobs:
grumphp:
name: "Grumphp"

runs-on: ubuntu-latest

strategy:
matrix:
php-binary:
- php7.1
- php7.2
- php7.3

steps:
- name: "Checkout"
uses: actions/checkout@master
with:
fetch-depth: 1

- name: "Composer install"
run: ${{ matrix.php-binary }} $(which composer) install --no-interaction --no-progress --no-suggest

- name: "Composer install lowest dependencies"
if: matrix.dependencies == 'lowest'
run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest

- name: "Install Graphviz"
run: sudo apt-get install graphviz

- name: "Run Grumphp"
run: ${{ matrix.php-binary }} vendor/bin/grumphp run
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

- name: "Scrutinizer"
run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
67 changes: 6 additions & 61 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,63 +1,8 @@
# Created by .ignore support plugin (hsz.mobi)
### Composer template
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

/.php_cs.cache
/composer.lock
/vendor
/build
/.php_cs.cache
/example/
/.idea/
/test.php
/build/
/phpspec.yml
11 changes: 10 additions & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
build: false
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

filter:
paths:
Expand All @@ -7,3 +12,7 @@ filter:
tools:
external_code_coverage:
timeout: 600
php_loc: true
php_pdepend: true
php_sim: true
php_changetracking: true
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

46 changes: 0 additions & 46 deletions CODE_OF_CONDUCT.md

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Latest Stable Version](https://img.shields.io/packagist/v/drupol/phpermutations.svg?style=flat-square)](https://packagist.org/packages/drupol/phpermutations)
[![GitHub stars](https://img.shields.io/github/stars/drupol/phpermutations.svg?style=flat-square)](https://packagist.org/packages/drupol/phpermutations)
[![Total Downloads](https://img.shields.io/packagist/dt/drupol/phpermutations.svg?style=flat-square)](https://packagist.org/packages/drupol/phpermutations)
[![Build Status](https://img.shields.io/travis/drupol/phpermutations/master.svg?style=flat-square)](https://travis-ci.org/drupol/phpermutations)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/drupol/phpermutations/Continuous%20Integration?style=flat-square)](https://github.com/drupol/phpermutations/actions)
[![Build Status](https://img.shields.io/appveyor/ci/drupol/phpermutations.svg?style=flat-square)](https://ci.appveyor.com/project/drupol/phpermutations)
[![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)
[![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)
Expand Down Expand Up @@ -44,7 +44,7 @@ objects), the library will still continue to work without any trouble.

## Requirements

* PHP >= 5.6,
* PHP >= 7.1.3,

## How to use

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

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

# Contributing
Expand Down
40 changes: 25 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
{
"name": "drupol/phpermutations",
"description": "Generators and iterators, permutations and combinations.",
"type": "library",
"description": "Generators and iterators, permutations and combinations.",
"keywords": [
"math",
"numbers",
"permutations",
"combinations",
"iterators",
"fibonacci",
"prime numbers",
"product"
],
"homepage": "https://github.com/drupol/phpermutations",
"keywords": ["math", "numbers", "permutations", "combinations", "iterators", "fibonacci", "prime numbers", "product"],
"license": "GPL-3.0-only",
"support": {
"issues": "https://github.com/drupol/phpermutations/issues",
"source": "https://github.com/drupol/phpermutations"
},
"authors": [
{
"name": "Pol Dellaiera",
"email": "[email protected]"
}
],
"require": {
"php": ">= 5.6"
"php": ">= 7.1.3"
},
"require-dev": {
"drupol/php-conventions": "^1.3",
"phpunit/phpunit": "^5 || ^6",
"phpunit/php-code-coverage": "^4 || ^5"
"drupol/php-conventions": "^1.6.8",
"phpunit/php-code-coverage": "^4 || ^5",
"phpunit/phpunit": "^6 || ^7",
"symfony/process": "^4.4.1"
},
"scripts": {
"phpunit": "./vendor/bin/phpunit --coverage-clover build/logs/clover.xml -c tests/phpunit.xml tests",
"grumphp": "./vendor/bin/grumphp run"
"config": {
"sort-packages": true
},
"autoload": {
"psr-4": {
"drupol\\phpermutations\\": "src/",
"drupol\\phpermutations\\Tests\\": "tests/src/"
}
},
"config": {
"sort-packages": true
"scripts": {
"grumphp": "./vendor/bin/grumphp run",
"phpunit": "./vendor/bin/phpunit --coverage-clover build/logs/clover.xml -c tests/phpunit.xml tests"
},
"support": {
"issues": "https://github.com/drupol/phpermutations/issues",
"source": "https://github.com/drupol/phpermutations"
}
}
Loading

0 comments on commit 8a44976

Please sign in to comment.