Skip to content

Commit

Permalink
Thanks, Mika Tuupola & contributors
Browse files Browse the repository at this point in the history
> This was a fork of [tuupola/slim-jwt-auth](https://github.com/tuupola/slim-jwt-auth) by [Mika Tuupola](https://github.com/tuupola). The fork was taken from `3.x` branch (at [this state](https://github.com/tuupola/slim-jwt-auth/tree/a4d6b3857daccb393f885473a08b2ea25874ae6b)).
>
> Thanks to Mika Tuupola & the package's contributors for their hard work.
>
> We forked it because we wanted to use [firebase/php-jwt](https://github.com/firebase/php-jwt) version 6 which had not supported at that time. Related [issue](tuupola/slim-jwt-auth#217).
  • Loading branch information
contactjavas committed Sep 28, 2022
1 parent 77be88e commit 56c4e5f
Show file tree
Hide file tree
Showing 24 changed files with 2,951 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8

[*.{css,scss,js,ts,tsx}]
indent_size = 2

[package.json]
indent_size = 2
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/CONTRIBUTING.md export-ignore
/Makefile export-ignore
/README.md export-ignore
/codecov.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/package.json export-ignore
/phpunit.xml export-ignore
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/node_modules/
/vendor/
/report/
composer.lock
.parcel-cache
.env
.phplint-cache
coverage.xml
package-lock.json
Empty file added CHANGELOG.md
Empty file.
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributing

## Thanks for contributing!

Following these guidelines improves the possibility of your pull request to get accepted. They also help to save everyones time.

## Only one feature or change per pull request

Pull request should contain only one feature or change. For example you have fixed a bug and optimized some code. Optimization is not related to the bug. These should be submitted as two separate pull requests.

## Discuss new features first

Before sending a totally new feature it is a good idea to discuss it first. If you have an idea open an issue about it. Maybe there already is a way to achieve what you are after.

## Write meaningful commit messages

Proper commit message is a full sentence. It starts with capital letter but does not end with period. The GitHub default `Update filename.js` is not enough. When needed include also longer explanation what the commit does.

```
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
```

When in doubt see Tim Pope's blogpost [A Note About Git Commit Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

## Follow the existing coding standards

Code should look like it is written by one person. Follow the original coding standard. It might be different than yours but it is not a holy war. This project uses **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)**.

## Include tests

New features and bugfixes should have an accompanying tests. This single thing greatly improves the possibility of pull request being approved.

## Test before committing

You can run tests either manually or automatically on every code change. Automatic tests require [entr](http://entrproject.org/) to work.

``` bash
$ make test
```
``` bash
$ brew install entr
$ make watch
```

## Send coherent history

Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.DEFAULT_GOAL := help

help:
@echo ""
@echo "Available tasks:"
@echo " test Run all tests and generate coverage"
@echo " watch Run all tests and coverage when a source file is upaded"
@echo " lint Run only linter and code style checker"
@echo " unit Run unit tests and generate coverage"
@echo " static Run static analysis"
@echo " vendor Install dependencies"
@echo " clean Remove vendor and composer.lock"
@echo ""

vendor: $(wildcard composer.lock)
composer install --prefer-dist

lint: vendor
vendor/bin/phplint . --exclude=vendor/
vendor/bin/phpcs -p --standard=PSR2 --extensions=php --encoding=utf-8 --ignore=*/vendor/*,*/benchmarks/* .

unit: vendor
phpdbg -qrr vendor/bin/phpunit --testdox --coverage-text --coverage-clover=coverage.xml --coverage-html=./report/

static: vendor
vendor/bin/phpstan analyse src --level max

watch: vendor
find . -name "*.php" -not -path "./vendor/*" -o -name "*.json" -not -path "./vendor/*" | entr -c make test

test: lint unit static

clean:
rm -rf vendor
rm composer.lock

.PHONY: help lint unit watch test clean
Loading

0 comments on commit 56c4e5f

Please sign in to comment.