Skip to content

Commit ecef0aa

Browse files
authored
Initial commit
0 parents  commit ecef0aa

14 files changed

+235
-0
lines changed

Diff for: .gitattributes

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# .gitattributes
2+
tests/ export-ignore
3+
.github/ export-ignore
4+
.gitattributes export-ignore
5+
.gitignore export-ignore
6+
.phpcs.xml export-ignore
7+
phpunit.xml export-ignore
8+
9+
# Auto detect text files and perform LF normalization
10+
* text=auto

Diff for: .github/CONTRIBUTING.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributing
2+
3+
First of all, **thank you** for contributing!
4+
5+
Here are a few rules to follow in order to ease code reviews and merging:
6+
7+
- follow the coding standard of the project
8+
- run the test suite
9+
- write (or update) tests when applicable
10+
- write documentation for new features
11+
- use [commit messages that make sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
12+
13+
When creating your pull request on GitHub, please write a description which gives the context and/or explains why you are creating it.

Diff for: .github/FUNDING.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: mnapoli # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

Diff for: .github/pull_request_template.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!--
2+
Please explain the motivation behind the changes.
3+
4+
In other words, explain **WHY** instead of **WHAT**.
5+
-->

Diff for: .github/workflows/ci.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['*']
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
jobs:
12+
13+
tests:
14+
name: Tests - PHP ${{ matrix.php }} ${{ matrix.dependency-version }}
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
strategy:
18+
matrix:
19+
php: [ '7.4', '8.0' ]
20+
dependency-version: [ '' ]
21+
include:
22+
- php: '7.4'
23+
dependency-version: '--prefer-lowest'
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
tools: composer:v2
32+
coverage: none
33+
- name: Cache Composer dependencies
34+
uses: actions/cache@v2
35+
with:
36+
path: ~/.composer/cache
37+
key: php-${{ matrix.php }}-composer-locked-${{ hashFiles('composer.lock') }}
38+
restore-keys: php-${{ matrix.php }}-composer-locked-
39+
- name: Install PHP dependencies
40+
run: composer update ${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --no-suggest
41+
- name: PHPUnit
42+
run: vendor/bin/phpunit
43+
44+
cs:
45+
name: Coding standards
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v2
50+
- name: Setup PHP
51+
uses: shivammathur/setup-php@v2
52+
with:
53+
php-version: 7.4
54+
tools: composer:v2, cs2pr
55+
coverage: none
56+
- name: Cache Composer dependencies
57+
uses: actions/cache@v2
58+
with:
59+
path: ~/.composer/cache
60+
key: php-composer-locked-${{ hashFiles('composer.lock') }}
61+
restore-keys: php-composer-locked-
62+
- name: Install PHP dependencies
63+
run: composer install --no-interaction --no-progress --no-suggest
64+
- name: PHP CodeSniffer
65+
run: vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr
66+
- name: PHPStan
67+
run: vendor/bin/phpstan

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor/
2+
/composer.phar
3+
/composer.lock
4+
/.phpunit.result.cache

Diff for: .phpcs.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0"?>
2+
<ruleset>
3+
<arg name="basepath" value="."/>
4+
5+
<file>src</file>
6+
<file>tests</file>
7+
8+
<rule ref="HardMode"/>
9+
</ruleset>

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Matthieu Napoli
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
13+
all 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
21+
THE SOFTWARE.

Diff for: README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# My Awesome Project
2+
3+
This is the catchphrase: what does this project do and how is it unique?
4+
5+
[![Build Status](https://img.shields.io/travis/com/PHP-DI/PHP-DI/master.svg?style=flat-square)](https://travis-ci.com/PHP-DI/PHP-DI)
6+
[![Latest Version](https://img.shields.io/github/release/PHP-DI/PHP-DI.svg?style=flat-square)](https://packagist.org/packages/PHP-DI/php-di)
7+
[![Total Downloads](https://img.shields.io/packagist/dt/PHP-DI/PHP-DI.svg?style=flat-square)](https://packagist.org/packages/PHP-DI/php-di)
8+
9+
Here is an additional quick introduction, if necessary.
10+
11+
## Why?
12+
13+
Why does this project exist? Come on, don't delete this part. Fill it.
14+
Yes it's hard, but it's perhaps the most important part of the README.
15+
16+
As to why *this* project exist, it's to serve as a template for future open
17+
source PHP projects. Of course, feel free to fork it and make your own recipe.
18+
19+
## Installation
20+
21+
Describe how to install the project/library/framework/…
22+
23+
Make sure your installation instructions work by testing them!
24+
25+
## Usage
26+
27+
Describe how to use the project. A gif or a short code example is the best
28+
way to show how it works. Also keep paragraphs short and sentences simple: not
29+
everybody speaks english well.
30+
31+
For the sake of the example here is how you can use this project template
32+
as a basis for your own repository:
33+
34+
```bash
35+
git clone https://github.com/mnapoli/project-template.git my-project
36+
cd my-project
37+
# Remove the git repository metadata
38+
rm -rf .git/
39+
# Start a brand new repository
40+
git init
41+
git add .
42+
```
43+
44+
Easy peasy! Now you just have to code.
45+
46+
Make sure your examples work by testing them! I didn't test mine and I should feel ashamed.

Diff for: composer.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "mnapoli/myproject",
3+
"description": "Give it a nice description!",
4+
"keywords": [],
5+
"license": "MIT",
6+
"type": "library",
7+
"autoload": {
8+
"psr-4": {
9+
"MyProject\\": "src/"
10+
}
11+
},
12+
"autoload-dev": {
13+
"psr-4": {
14+
"MyProject\\Test\\": "tests/"
15+
}
16+
},
17+
"require": {
18+
"php": ">=7.4"
19+
},
20+
"require-dev": {
21+
"phpunit/phpunit": "^9.0",
22+
"mnapoli/hard-mode": "^0.3.0",
23+
"phpstan/phpstan": "^1"
24+
},
25+
"config": {
26+
"allow-plugins": {
27+
"dealerdirect/phpcodesniffer-composer-installer": true
28+
}
29+
}
30+
}

Diff for: phpstan.neon

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 6
3+
paths:
4+
- src
5+
- tests

Diff for: phpunit.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="./vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">src</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="Test suite">
10+
<directory>./tests/</directory>
11+
</testsuite>
12+
</testsuites>
13+
</phpunit>

Diff for: src/.gitkeep

Whitespace-only changes.

Diff for: tests/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)