Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jul 15, 2019
0 parents commit c9bf91f
Show file tree
Hide file tree
Showing 17 changed files with 410 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
charset = utf-8
max_line_length = 80
indent_style = space
indent_size = 4
insert_final_newline = true
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1 @@
* @drupol
46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at am@localheinz.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
29 changes: 29 additions & 0 deletions .github/CONTRIBUTING.md
@@ -0,0 +1,29 @@
# CONTRIBUTING

We're using [Travis CI](https://travis-ci.com) as a continuous integration system.

For details, see [`.travis.yml`](../.travis.yml).

## Tests

We're using [`grumphp/grumphp`](https://github.com/phpro/grumphp) to drive the development.

Run

```bash
./vendor/bin/grumphp run
```

to run all the tests.

## Coding Standards

We are using [`drupol/php-conventions`](https://github.com/drupol/php-conventions) to enforce coding standards.

Run

```bash
./vendor/bin/grumphp run
```

to automatically detect/fix coding standard violations.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
@@ -0,0 +1 @@
github: drupol
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,13 @@
## Steps required to reproduce the problem

1.
2.
3.

## Expected Result

*

## Actual Result

*
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,9 @@
This PR

* [x]
* [ ]
* [ ]

Follows #.
Related to #.
Fixes #.
10 changes: 10 additions & 0 deletions .github/stale.yml
@@ -0,0 +1,10 @@
daysUntilStale: 60

daysUntilClose: 7

staleLabel: stale

markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
8 changes: 8 additions & 0 deletions .gitignore
@@ -0,0 +1,8 @@
/composer.lock
/vendor
/build
/.php_cs.cache
/example/
/.idea/
/test.php
/phpspec.yml
18 changes: 18 additions & 0 deletions .scrutinizer.yml
@@ -0,0 +1,18 @@
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

filter:
paths:
- 'src/*'

tools:
external_code_coverage:
timeout: 600
php_loc: true
php_pdepend: true
php_sim: true
php_changetracking: true
24 changes: 24 additions & 0 deletions .travis.yml
@@ -0,0 +1,24 @@
language: php

git:
depth: 1

cache:
directories:
- "$HOME/.cache/composer"
- "$HOME/.composer/cache"

php:
- 7.1
- 7.2
- 7.3

install:
- composer install

script:
- composer grumphp

after_success:
- phpenv config-rm xdebug.ini
- composer scrutinizer
21 changes: 21 additions & 0 deletions LICENCE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Pol Dellaiera

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.
37 changes: 37 additions & 0 deletions README.md
@@ -0,0 +1,37 @@
[![Latest Stable Version](https://img.shields.io/packagist/v/drupol/belgian-national-number-faker.svg?style=flat-square)](https://packagist.org/packages/drupol/belgian-national-number-faker)
[![GitHub stars](https://img.shields.io/github/stars/drupol/belgian-national-number-faker.svg?style=flat-square)](https://packagist.org/packages/drupol/belgian-national-number-faker)
[![Total Downloads](https://img.shields.io/packagist/dt/drupol/belgian-national-number-faker.svg?style=flat-square)](https://packagist.org/packages/drupol/belgian-national-number-faker)
[![Build Status](https://img.shields.io/travis/drupol/belgian-national-number-faker/master.svg?style=flat-square)](https://travis-ci.org/drupol/belgian-national-number-faker)
[![Scrutinizer code quality](https://img.shields.io/scrutinizer/quality/g/drupol/belgian-national-number-faker/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/drupol/belgian-national-number-faker/?branch=master)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/drupol/belgian-national-number-faker/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/drupol/belgian-national-number-faker/?branch=master)
[![Mutation testing badge](https://badge.stryker-mutator.io/github.com/drupol/belgian-national-number-faker/master)](https://stryker-mutator.github.io)
[![License](https://img.shields.io/packagist/l/drupol/belgian-national-number-faker.svg?style=flat-square)](https://packagist.org/packages/drupol/belgian-national-number-faker)
[![Say Thanks!](https://img.shields.io/badge/Say-thanks-brightgreen.svg?style=flat-square)](https://saythanks.io/to/drupol)
[![Donate!](https://img.shields.io/badge/Donate-Paypal-brightgreen.svg?style=flat-square)](https://paypal.me/drupol)

# Belgian national number faker

## Description

Belgian national number generator using [fzaninotto/faker](https://github.com/fzaninotto/Faker).

## Requirements

* PHP >= 7.1

## Installation

```composer require --dev drupol/belgian-national-number-faker```

## Code quality, tests and benchmarks

Every time changes are introduced into the library, [Travis CI](https://travis-ci.org/drupol/belgian-national-number-faker/builds) run the tests and the benchmarks.

The library has tests written with [PHPSpec](http://www.phpspec.net/).
Feel free to check them out in the `spec` directory. Run `composer phpspec` to trigger the tests.

Before each commit some inspections are executed with [GrumPHP](https://github.com/phpro/grumphp), run `./vendor/bin/grumphp run` to check manually.

## Contributing

Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)
42 changes: 42 additions & 0 deletions composer.json
@@ -0,0 +1,42 @@
{
"name": "drupol/belgian-national-number-faker",
"type": "library",
"description": "Belgian national number faker generator using fzaninotto/faker.",
"keywords": [
"belgian national number",
"national number",
"national identification number",
"faker"
],
"license": "MIT",
"authors": [
{
"name": "Pol Dellaiera",
"email": "pol.dellaiera@protonmail.com"
}
],
"require": {
"php": "^7.1",
"fzaninotto/faker": "^1.8"
},
"require-dev": {
"drupol/php-conventions": "^1",
"drupol/phpspec-annotation": "^1",
"drupol/phpspec-code-coverage": "^4 || ^5",
"phpspec/phpspec": "^4 || ^5",
"phptaskman/changelog": "^1.0",
"scrutinizer/ocular": "^1"
},
"autoload": {
"psr-4": {
"drupol\\BelgianNationalNumberFaker\\": "src/"
}
},
"scripts": {
"apigen": "./vendor/bin/apigen generate src --destination build/docs",
"bench": "./vendor/bin/phpbench run --report=aggregate --store --precision=3",
"grumphp": "./vendor/bin/grumphp run",
"infection": "./vendor/bin/infection run -j 10",
"scrutinizer": "./vendor/bin/ocular code-coverage:upload --format=php-clover build/logs/clover.xml"
}
}
11 changes: 11 additions & 0 deletions grumphp.yml.dist
@@ -0,0 +1,11 @@
imports:
- { resource: vendor/drupol/php-conventions/config/php71/grumphp.yml }

parameters:
extensions:
- drupol\PhpConventions\GrumphpTasksExtension
extra_tasks:
phpspec:
verbose: true
metadata:
priority: 3000
@@ -0,0 +1,28 @@
<?php

declare(strict_types = 1);

namespace spec\drupol\BelgianNationalNumberFaker\Provider;

use drupol\BelgianNationalNumberFaker\Provider\BelgianNationalNumber;
use Faker\Generator;
use PhpSpec\ObjectBehavior;

class BelgianNationalNumberSpec extends ObjectBehavior
{
public function it_can_generate_random_national_numbers(Generator $generator): void
{
$this->beConstructedWith($generator);

$this
->nationalIdentificationNumber()
->shouldBeString();
}

public function it_is_initializable(Generator $generator): void
{
$this->beConstructedWith($generator);

$this->shouldHaveType(BelgianNationalNumber::class);
}
}

0 comments on commit c9bf91f

Please sign in to comment.