commit 61e3dfa0ece372814c50e0cafa50102400789eca Author: Oliver Davies Date: Tue May 21 12:36:46 2019 +0100 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5f9faaf --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/vendor/ +/composer.lock +/*.cache diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..95c872e --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,14 @@ +files()->in('src')->in('tests'); + +return Config::create() + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + ]) + ->setFinder($finder); diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..14a09c6 --- /dev/null +++ b/composer.json @@ -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 + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..43546b1 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,13 @@ + + + + + tests + + + diff --git a/src/helpers.php b/src/helpers.php new file mode 100644 index 0000000..a4abe2d --- /dev/null +++ b/src/helpers.php @@ -0,0 +1,2 @@ +