Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli authored Oct 28, 2024
0 parents commit 548854f
Show file tree
Hide file tree
Showing 14 changed files with 230 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# .gitattributes
tests/ export-ignore
.github/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.phpcs.xml export-ignore
phpunit.xml export-ignore

# Auto detect text files and perform LF normalization
* text=auto
13 changes: 13 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributing

First of all, **thank you** for contributing!

Here are a few rules to follow in order to ease code reviews and merging:

- follow the coding standard of the project
- run the test suite
- write (or update) tests when applicable
- write documentation for new features
- use [commit messages that make sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

When creating your pull request on GitHub, please write a description which gives the context and/or explains why you are creating it.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: mnapoli # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
Please explain the motivation behind the changes.
In other words, explain **WHY** instead of **WHAT**.
-->
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches: ['main']
pull_request:
branches: ['*']

jobs:

tests:
name: Tests - PHP ${{ matrix.php }} ${{ matrix.dependency-version }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
dependency-version: [ '' ]
include:
- php: '8.1'
dependency-version: '--prefer-lowest'
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-${{ matrix.php }}-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php }}-composer-locked-
- name: Install PHP dependencies
run: composer update ${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --no-suggest
- name: PHPUnit
run: vendor/bin/phpunit

cs:
name: Coding standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: cs2pr
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-composer-locked-
- name: Install PHP dependencies
run: composer install --no-interaction --no-progress --no-suggest
- name: PHP CS
run: vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr
- name: PHPStan
run: vendor/bin/phpstan
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/
/composer.phar
/composer.lock
/.phpunit.result.cache
9 changes: 9 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<ruleset>
<arg name="basepath" value="."/>

<file>src</file>
<file>tests</file>

<rule ref="HardMode"/>
</ruleset>
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Matthieu Napoli

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# My Awesome Project

This is the catchphrase: what does this project do and how is it unique?

[![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)
[![Latest Version](https://img.shields.io/github/release/PHP-DI/PHP-DI.svg?style=flat-square)](https://packagist.org/packages/PHP-DI/php-di)
[![Total Downloads](https://img.shields.io/packagist/dt/PHP-DI/PHP-DI.svg?style=flat-square)](https://packagist.org/packages/PHP-DI/php-di)

Here is an additional quick introduction, if necessary.

## Why?

Why does this project exist? Come on, don't delete this part. Fill it.
Yes it's hard, but it's perhaps the most important part of the README.

As to why *this* project exist, it's to serve as a template for future open
source PHP projects. Of course, feel free to fork it and make your own recipe.

## Installation

Describe how to install the project/library/framework/…

Make sure your installation instructions work by testing them!

## Usage

Describe how to use the project. A gif or a short code example is the best
way to show how it works. Also keep paragraphs short and sentences simple: not
everybody speaks english well.

For the sake of the example here is how you can use this project template
as a basis for your own repository:

```bash
git clone https://github.com/mnapoli/project-template.git my-project
cd my-project
# Remove the git repository metadata
rm -rf .git/
# Start a brand new repository
git init
git add .
```

Easy peasy! Now you just have to code.

Make sure your examples work by testing them! I didn't test mine and I should feel ashamed.
30 changes: 30 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "mnapoli/myproject",
"description": "Give it a nice description!",
"keywords": [],
"license": "MIT",
"type": "library",
"autoload": {
"psr-4": {
"MyProject\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MyProject\\Test\\": "tests/"
}
},
"require": {
"php": ">=8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"mnapoli/hard-mode": "^0.3.0",
"phpstan/phpstan": "^1"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 6
paths:
- src
- tests
13 changes: 13 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Test suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
Empty file added src/.gitkeep
Empty file.
Empty file added tests/.gitkeep
Empty file.

0 comments on commit 548854f

Please sign in to comment.