Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Oct 29, 2020
0 parents commit 3b7be73
Show file tree
Hide file tree
Showing 33 changed files with 2,007 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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,inc,module}]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{json,json.dist,yml,yml.dist}]
indent_size = 4
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/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
/docker export-ignore
docker-composer.yaml export-ignore
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @loophp
46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
29 changes: 29 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CONTRIBUTING

We're using [Travis CI](https://travis-ci.com) as a continuous integration system.

For details, see [`.travis.yml`](../.travis.yml).

## Tests

We're using [`grumphp/grumphp`](https://github.com/phpro/grumphp) to drive the development.

Run

```bash
./vendor/bin/grumphp run
```

to run all the tests.

## Coding Standards

We are using [`drupol/php-conventions`](https://github.com/drupol/php-conventions) to enforce coding standards.

Run

```bash
./vendor/bin/grumphp run
```

to automatically detect/fix coding standard violations.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: drupol
custom: ["https://www.paypal.me/drupol"]
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Steps required to reproduce the problem

1.
2.
3.

## Expected Result

*

## Actual Result

*
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This PR

* [x]
* [ ]
* [ ]

Follows #.
Related to #.
Fixes #.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
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: "A PHPSpec extension providing matchers for measuring time in tests."
topics: phpspec-extension
has_downloads: true
has_issues: true
has_pages: false
has_projects: false
has_wiki: false
name: phpspec-time
private: false
10 changes: 10 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
daysUntilStale: 60

daysUntilClose: 7

staleLabel: stale

markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
75 changes: 75 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
- pull_request
- push

name: "Continuous Integration"

jobs:
run:
name: "Grumphp"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.4']

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: gd,mbstring,xdebug

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Run Grumphp
run: vendor/bin/grumphp run --no-ansi -n
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

- name: Send PSALM data
run: vendor/bin/psalm --shepherd --stats
continue-on-error: true

- name: Send Scrutinizer data
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
continue-on-error: true

- name: Infection score report
run: |
vendor/bin/infection run -j 2
continue-on-error: true

- name: PHP Insights report
run: |
rm -rf composer.lock vendor
composer require nunomaduro/phpinsights --dev
vendor/bin/phpinsights analyse src/ -n
continue-on-error: true
33 changes: 33 additions & 0 deletions .github/workflows/prune.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://docs.github.com/en/actions

name: "Prune"

on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 12 * * *"

env:
DAYS_BEFORE_CLOSE: 5
DAYS_BEFORE_STALE: 5

jobs:
prune:
name: "Issues"

runs-on: "ubuntu-latest"

steps:
- name: "Prune issues and pull requests"
uses: "actions/[email protected]"
with:
days-before-close: "${{ env.DAYS_BEFORE_CLOSE }}"
days-before-stale: "${{ env.DAYS_BEFORE_STALE }}"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
stale-issue-label: "stale"
stale-issue-message: |
Since this issue has not had any activity within the last ${{ env.DAYS_BEFORE_STALE }} days, I have marked it as stale.
I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_CLOSE }} days.
stale-pr-label: "stale"
stale-pr-message: |
Since this pull request has not had any activity within the last ${{ env.DAYS_BEFORE_STALE }} days, I have marked it as stale.
I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_CLOSE }} days.
44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://docs.github.com/en/actions

name: "Release"

on: # yamllint disable-line rule:truthy
push:
tags:
- "**"

jobs:
release:
name: "Release"

runs-on: "ubuntu-latest"

steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 1

- name: Determine tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
shell: bash

- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md

- name: "Create release"
uses: "actions/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
release_name: "${{ steps.tag_name.outputs.current_version }}"
tag_name: "${{ steps.tag_name.outputs.current_version }}"
body: ${{ steps.changelog_reader.outputs.changes }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/composer.lock
/vendor
/build
/.php_cs.cache
/example/
/.idea/
/test.php
/phpspec.yml
/examples/
/node_modules/
/benchmarks/
Loading

0 comments on commit 3b7be73

Please sign in to comment.