From efe18de6d338d4bdfcbe365de2138e6369165688 Mon Sep 17 00:00:00 2001 From: Christopher Pitt <cgpitt@gmail.com> Date: Thu, 22 Jun 2017 09:27:09 +0200 Subject: [PATCH] Update plugin version --- composer.json | 13 ++++++++----- readme.md | 10 ++-------- src/bootstrap.php | 3 --- src/{macros.pre => macros.yay} | 0 tests/{SpecTest.php => MacroTest.php} | 4 ++-- tests/bootstrap.php | 19 ++++++++++++------- 6 files changed, 24 insertions(+), 25 deletions(-) delete mode 100644 src/bootstrap.php rename src/{macros.pre => macros.yay} (100%) rename tests/{SpecTest.php => MacroTest.php} (67%) diff --git a/composer.json b/composer.json index 316ad6b..db60c7c 100644 --- a/composer.json +++ b/composer.json @@ -1,23 +1,26 @@ { + "type": "pre-macro", "name": "pre/immutable-classes", "license": "MIT", "require": { - "pre/plugin": "^0.6" + "pre/plugin": "^0.7.3" }, "autoload": { - "files": [ - "src/bootstrap.php" - ], "psr-4": { "Pre\\ImmutableClasses\\": "src" } }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^5.0|^6.0" }, "autoload-dev": { "psr-4": { "Pre\\ImmutableClasses\\": "tests" } + }, + "extra": { + "macros": [ + "src/macros.yay" + ] } } diff --git a/readme.md b/readme.md index d0dd719..9db02f7 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,3 @@ -# Pre Immutable Classes +# Immutable Classes -Documentation can be found at [preprocess.io](https://preprocess.io/docs#immutable-classes). - -## Versioning - -This library follows [Semver](http://semver.org). According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library. - -All methods, with `public` visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep `protected` methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading. +Documentation can be found at [preprocess.io](https://preprocess.io#immutable-classes). diff --git a/src/bootstrap.php b/src/bootstrap.php deleted file mode 100644 index 7c5622d..0000000 --- a/src/bootstrap.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - -Pre\addMacroPath(__DIR__ . "/macros.pre"); diff --git a/src/macros.pre b/src/macros.yay similarity index 100% rename from src/macros.pre rename to src/macros.yay diff --git a/tests/SpecTest.php b/tests/MacroTest.php similarity index 67% rename from tests/SpecTest.php rename to tests/MacroTest.php index 0a7fdd0..7d0dd65 100644 --- a/tests/SpecTest.php +++ b/tests/MacroTest.php @@ -2,9 +2,9 @@ namespace Pre\ImmutableClasses; -use Pre\Testing\Runner; +use Pre\Plugin\Testing\Runner; -class SpecTest extends Runner +class MacroTest extends Runner { protected function path(): string { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3cf9fa1..e45a934 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,13 +1,18 @@ <?php -namespace Yay; +namespace +{ + require __DIR__ . "/../vendor/autoload.php"; -// let's use a namespace trick, to make non-colliding variables predictable. + putenv("PRE_BASE_DIR=" . __DIR__ . "/../"); -function md5($value) { - return $value; + Pre\Plugin\addMacroPath(__DIR__ . "/../src/macros.yay"); } -putenv("PRE_BASE_DIR=" . __DIR__ . "/.."); - -require __DIR__ . "/../vendor/autoload.php"; +namespace Yay +{ + function md5($value) + { + return $value; + } +}