Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
svenluijten committed Jul 10, 2023
0 parents commit b01bf0e
Show file tree
Hide file tree
Showing 14 changed files with 381 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

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

[*.md]
trim_trailing_whitespace = false

[composer.json]
indent_size = 4
indent_style = space
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* text=auto

/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
/CONTRIBUTING.md export-ignore
/phpunit.xml.dist export-ignore
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
30 changes: 30 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Tests
on: [push, pull_request]

jobs:
test:
name: PHP ${{ matrix.php }} on ${{ matrix.os }} (${{ matrix.dependency-version }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
php: [8.0]
dependency-version: [highest, lowest]
steps:
- uses: actions/[email protected]

- name: Configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, fileinfo
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependency-version }}
composer-options: "--prefer-dist"

- name: Execute tests
run: vendor/bin/phpunit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/composer.phar
/composer.lock
/vendor
10 changes: 10 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
preset: laravel

risky: false

enabled:
- phpdoc_order
- phpdoc_separation

disabled:
- not_operator_with_successor_space
93 changes: 93 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# How to contribute
Thank you for considering to contribute to this repository! This file will walk you through all the steps to ensure both
you and I have a good time submitting and reviewing your contribution. First off, some basic rules and reading material:

- Submit your work in a new branch and make the PR to the master branch.
- [Write a short & descriptive commit message](http://chris.beams.io/posts/git-commit/).
- Rebase before committing the final change.
- Stick to [PSR-2](http://www.php-fig.org/psr/psr-2/).
- Add tests if necessary and ensure all the tests are green on the final commit.
- Make sure the CI tools used by the repository are all in order. If one fails, you should make it pass.

## Contributing
Here are the steps to follow to contribute to this repository:

- [Fork this repository on GitHub](#fork-this-repository).
- [Clone your fork to your local machine](#clone-your-fork).
- [Create a feature branch](#create-a-branch).
- [Add an 'upstream' remote](#add-a-remote).
- [Regularly pull & rebase from the upstream remote](#pull-and-rebase).
- [Work on feature branch](#working-on-branch).
- [Make tests pass](#make-tests-pass)
- [Submit a pull request to the master branch](#submitting-pull-request).

### Fork this repository
Fork the repository right here on GitHub. To learn more about forking a repository, visit
[GitHub's help article](https://help.github.com/articles/fork-a-repo/).

### Clone your fork
Clone your repository on your local machine to start work on your pull request.

```bash
$ git clone [email protected]:<USERNAME>/<REPOSITORY>.git
# Or if you prefer HTTPS:
$ git clone https://github.com/<USERNAME>/<REPOSITORY>.git

$ cd <REPOSITORY>
```

### Create a branch
Make your own feature branch in order not to clutter up master.

```bash
# Think of a good name for your branch:
# fix/typo-in-readme
# feature/some-feature
# bug/some-bug-you-are-fixing
$ git checkout -b <BRANCH_NAME>
```

### Add a remote
Add an 'upstream' remote to pull from and to stay up to date with the work being done in there.

```bash
# List all current remotes
$ git remote -v
origin [email protected]/<USERNAME>/<REPOSITORY>.git (fetch)
origin [email protected]/<USERNAME>/<REPOSITORY>.git (push)

# Add a new remote called 'upstream'
$ git remote add upstream [email protected]:svenluijten/<REPOSITORY>.git
# Or if you prefer HTTPS:
$ git remote add upstream https://github.com/svenluijten/<REPOSITORY>.git

# The new remote should now be in the list
$ git remote -v
origin [email protected]/<USERNAME>/<REPOSITORY>.git (fetch)
origin [email protected]/<USERNAME>/<REPOSITORY>.git (push)
upstream [email protected]/svenluijten/<REPOSITORY>.git (fetch)
upstream [email protected]/svenluijten/<REPOSITORY>.git (push)
```

### Pull and rebase
Pull from upstream to stay up to date with what others might be doing in this repository. Any merge conflicts that arise
are your responsibility to resolve.

```bash
$ git pull --rebase upstream master
```

### Working on branch
Do your magic and make your fix. I can't help you with this 😉. Once you're happy with the result and all tests pass,
go ahead and push to your feature branch.

```bash
$ git push origin <BRANCH_NAME>
```

### Make tests pass
You can run `composer check` to see if the tests & static analysis pass. Feel free to only run the static analyses at the
very end, this could take a while on bigger projects. To only run the tests, run `composer test`.

### Submitting pull request
Now, let's head back over to this repository on GitHub and submit the pull request!
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The MIT License (MIT)

Copyright (c) Sven Luijten

> 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.
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
![:package](:hero)

# :package

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-downloads]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-build]][link-build]
[![StyleCI][ico-styleci]][link-styleci]

Short description of the package. What does it do and why should people download
it? Brag a bit but don't exaggerate. Talk about what's to come and tease small
pieces of functionality.

> :namespace
> :package
> :styleci
> :hero
## Installation
You'll have to follow a couple of simple steps to install this package.

### Downloading
Via [composer](http://getcomposer.org):

```bash
$ composer require sven/:package
```

Or add the package to your dependencies in `composer.json` and run
`composer update` on the command line to download the package:

```json
{
"require": {
"sven/:package": "*"
}
}
```


### Registering the service provider
> Is this a Laravel package?
Next, add the `ServiceProvider` to your `providers` array in `config/app.php`:

```php
'providers' => [
...
Sven\:namespace\ServiceProvider::class,
];
```

If you would like to load this package in certain environments only, take a look
at [sven/env-providers](https://github.com/svenluijten/env-providers).

## Usage
Some examples of the code. How should people use it, what options does this package
provide? Should people be wary of some functionality?

```php
Maybe some code?
```

## Contributing
All contributions (pull requests, issues and feature requests) are
welcome. Make sure to read through the [CONTRIBUTING.md](CONTRIBUTING.md) first,
though. See the [contributors page](../../graphs/contributors) for all contributors.

## License
`sven/:package` is licensed under the MIT License (MIT). Please see the
[license file](LICENSE.md) for more information.

[ico-version]: https://img.shields.io/packagist/v/sven/:package.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/sven/:package.svg?style=flat-square
[ico-build]: https://img.shields.io/github/workflow/status/svenluijten/:package/Tests?style=flat-square
[ico-styleci]: https://styleci.io/repos/:styleci/shield

[link-packagist]: https://packagist.org/packages/sven/:package
[link-downloads]: https://packagist.org/packages/sven/:package
[link-build]: https://github.com/svenluijten/:package/actions/workflows/run-tests.yml
[link-styleci]: https://styleci.io/repos/:styleci
42 changes: 42 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "sven/:package",
"description": "",
"keywords": [],
"license": "MIT",
"authors": [
{
"name": "Sven Luijten",
"email": "[email protected]",
"homepage": "https://svenluijten.com"
}
],
"require": {
"php": "^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"Sven\\:namespace\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Sven\\:namespace\\Tests\\": "tests/"
}
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Sven\\:namespace\\ServiceProvider"
],
"aliases": {
":namespace": "Sven\\:namespace\\Facades\\:namespace"
}
}
}
}
18 changes: 18 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
verbose="true"
>
<testsuites>
<testsuite name=":package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
8 changes: 8 additions & 0 deletions src/Package.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Sven\:namespace;

class Package
{
//
}
28 changes: 28 additions & 0 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Sven\:namespace;

use Illuminate\Support\ServiceProvider as LaravelProvider;

class ServiceProvider extends LaravelProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}

/**
* Register the application services.
*
* @return void
*/
public function register()
{
//
}
}
11 changes: 11 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Sven\:namespace\Tests;

use PhpUnit\Framework\TestCase as BaseTestCase;
use Sven\:namespace\ServiceProvider;

abstract class TestCase extends BaseTestCase
{
//
}

0 comments on commit b01bf0e

Please sign in to comment.