Skip to content

Commit

Permalink
basic package
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Jul 21, 2020
1 parent 6de0876 commit 0d9f0be
Show file tree
Hide file tree
Showing 15 changed files with 355 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; 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
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/.editorconfig export-ignore
26 changes: 26 additions & 0 deletions .github/workflows/composer-normalize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: normalize composer.json

on:
push:
paths:
- 'composer.json'

jobs:
normalize:
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Validate Composer configuration
run: composer validate --strict

- name: Normalize composer.json
run: |
composer global require ergebnis/composer-normalize
composer normalize
- uses: stefanzweifel/[email protected]
with:
commit_message: normalize composer.json
19 changes: 19 additions & 0 deletions .github/workflows/markdown-normalize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: normalize markdown

on:
push:
paths:
- '*.md'

jobs:
normalize:
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Prettify markdown
uses: creyD/[email protected]
with:
prettier_options: --write **/*.md
41 changes: 41 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: run-tests

on: push

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [7.4]
laravel: [7.*, 6.*]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
composer-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-
composer-laravel-${{ matrix.laravel }}-php-
composer-laravel-
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: phpunit
run: vendor/bin/phpunit
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build
composer.lock
docs
vendor
coverage
3 changes: 3 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
preset: laravel

risky: true
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

All notable changes to `laravel-addressable` will be documented in this file

## 0.1.0 - 2020-XX-XX

- initial release
55 changes: 55 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

Please read and understand the contribution guide before creating an issue or pull request.

## Etiquette

This project is open source, and as such, the maintainers give their free time to build and maintain the source code
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
extremely unfair for them to suffer abuse or anger for their hard work.

Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
world that developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.

## Viability

When requesting or submitting new features, first consider whether it might be useful to others. Open
source projects are used by many developers, who may have entirely different needs to your own. Think about
whether or not your feature is likely to be used by other users of the project.

## Procedure

Before filing an issue:

- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.

Before submitting a pull request:

- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.

## Requirements

If the project maintainer has any additional requirements, you will find them listed here.

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **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](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

**Happy coding**!
File renamed without changes.
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,53 @@
# laravel-addressable
# Laravel Addressable

[![Latest Version](http://img.shields.io/packagist/v/elbgoods/laravel-addressable.svg?label=Release&style=for-the-badge)](https://packagist.org/packages/elbgoods/laravel-addressable)
[![MIT License](https://img.shields.io/github/license/elbgoods/laravel-addressable.svg?label=License&color=blue&style=for-the-badge)](https://github.com/elbgoods/laravel-addressable/blob/master/LICENSE)
[![Offset Earth](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-green?style=for-the-badge&cacheSeconds=600)](https://plant.treeware.earth/elbgoods/laravel-addressable)

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/elbgoods/laravel-addressable/run-tests?label=tests&style=flat-square)](https://github.com/elbgoods/laravel-addressable/actions?query=workflow%3Arun-tests)
[![StyleCI](https://styleci.io/repos/279863918/shield)](https://styleci.io/repos/279863918)
[![Total Downloads](https://img.shields.io/packagist/dt/elbgoods/laravel-addressable.svg?style=flat-square)](https://packagist.org/packages/elbgoods/laravel-addressable)

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

## Installation

You can install the package via composer:

```bash
composer require elbgoods/laravel-addressable
```

## Usage

``` php
// Usage description here
```

### Testing

``` bash
composer test
```

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Credits

- [Tom Witkowski](https://github.com/Gummibeer)
- [Niclas Schirrmeister](https://github.com/eisfeuer)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
63 changes: 63 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "elbgoods/laravel-addressable",
"type": "library",
"description": "",
"keywords": [
"elbgoods",
"laravel-addressable",
"laravel",
"addressable",
"address"
],
"homepage": "https://github.com/elbgoods/laravel-addressable",
"license": "MIT",
"authors": [
{
"name": "Tom Witkowski",
"email": "[email protected]",
"homepage": "https://elbgoods.de",
"role": "Developer"
},
{
"name": "Niclas Schirrmeister",
"email": "[email protected]",
"homepage": "https://elbgoods.de",
"role": "Developer"
}
],
"require": {
"php": "^7.4",
"illuminate/support": "^6.0 || ^7.0"
},
"require-dev": {
"orchestra/testbench": "^4.0 || ^5.0",
"phpunit/phpunit": "^8.0 || ^9.0"
},
"suggest": {
"elbgoods/laravel-country-rule": "Allows to validate countries.",
"elbgoods/laravel-swiss-canton-rule": "Allows to validate swiss cantons."
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Elbgoods\\LaravelAddressable\\AddressableServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Elbgoods\\LaravelAddressable\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Elbgoods\\LaravelAddressable\\Tests\\": "tests"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
}
}
22 changes: 22 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
19 changes: 19 additions & 0 deletions src/AddressableServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Elbgoods\LaravelAddressable;

use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;

class AddressableServiceProvider extends ServiceProvider implements DeferrableProvider
{
public function boot(): void
{

}

public function register(): void
{

}
}
16 changes: 16 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Elbgoods\LaravelAddressable\Tests;

use Orchestra\Testbench\TestCase as OrchestraTestCase;
use Elbgoods\LaravelAddressable\AddressableServiceProvider;

abstract class TestCase extends OrchestraTestCase
{
protected function getPackageProviders($app)
{
return [
AddressableServiceProvider::class,
];
}
}

0 comments on commit 0d9f0be

Please sign in to comment.