This commit is contained in:
Oliver Davies 2019-05-21 12:36:46 +01:00
commit 61e3dfa0ec
5 changed files with 70 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
/vendor/
/composer.lock
/*.cache

14
.php_cs.dist Normal file
View file

@ -0,0 +1,14 @@
<?php
use PhpCsFixer\Config;
use Symfony\Component\Finder\Finder;
$finder = new Finder();
$finder->files()->in('src')->in('tests');
return Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
])
->setFinder($finder);

38
composer.json Normal file
View file

@ -0,0 +1,38 @@
{
"name": "opdavies/php-helpers",
"description": "Helper functions for when working with PHP",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Oliver Davies",
"email": "oliver@oliverdavies.uk"
}
],
"scripts": {
"lint": "php-cs-fixer fix",
"test": [
"composer run lint -- --dry-run",
"composer run test:unit"
],
"test:unit": "phpunit"
},
"require": {
"php": "^7.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15",
"phpunit/phpunit": "^8.1"
},
"autoload": {
"files": ["src/helpers.php"]
},
"autoload-dev": {
"psr-4": {
"Tests\\Opdavies\\PhpHelpers\\": "tests/"
}
},
"config": {
"sort-packages": true
}
}

13
phpunit.xml.dist Normal file
View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="true">
<testsuites>
<testsuite name="Unit tests">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
</phpunit>

2
src/helpers.php Normal file
View file

@ -0,0 +1,2 @@
<?php