Skip to content

Commit

Permalink
Merge pull request #2 from preprocess/develop
Browse files Browse the repository at this point in the history
The great refactoring!
  • Loading branch information
assertchris authored May 13, 2017
2 parents 8ff745f + 9ce8a11 commit 43a44af
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 23 deletions.
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
{
"type": "pre-macro",
"name": "pre/class-accessors",
"license": "MIT",
"require": {
"pre/plugin": "^0.6"
"pre/plugin": "^0.7"
},
"autoload": {
"files": [
"src/bootstrap.php",
"src/expanders.php"
],
"psr-4": {
"Pre\\ClassAccessors\\": "src"
}
},
"require-dev": {
"phpunit/phpunit": "^5.0"
"phpunit/phpunit": "^5.0|^6.0"
},
"autoload-dev": {
"psr-4": {
"Pre\\ClassAccessors\\": "tests"
}
},
"extra": {
"macros": [
"src/macros.yay"
]
}
}
3 changes: 2 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
convertWarningsToExceptions="false"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
syntaxCheck="false"
>
<testsuites>
<testsuite>
<directory suffix="Test.php">tests</directory>
Expand Down
6 changes: 0 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Pre Class Accessors

Documentation can be found at [preprocess.io](https://preprocess.io/docs#class-accessors).

## 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.
3 changes: 0 additions & 3 deletions src/bootstrap.php

This file was deleted.

5 changes: 2 additions & 3 deletions src/expanders.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
namespace Yay\DSL\Expanders;

use Yay\Engine;
use Yay\Token;
use Yay\TokenStream;

function class_accessors_return($stream, Engine $engine): TokenStream
function class_accessors_return(TokenStream $stream, Engine $engine): TokenStream
{
if (!empty($stream->current())) {
$stream = ": {$stream}";
}

return TokenStream::fromSource(
$engine->expand($stream, '', Engine::GC_ENGINE_DISABLED)
$engine->expand($stream, "", Engine::GC_ENGINE_DISABLED)
);
}
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/SpecTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Pre\ClassAccessors;

use Pre\Testing\Runner;
use Pre\Plugin\Testing\Runner;

class SpecTest extends Runner
{
Expand Down
8 changes: 4 additions & 4 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Yay;

// let's use a namespace trick, to make non-colliding variables predictable.

function md5($value) {
return $value;
}

putenv("PRE_BASE_DIR=" . __DIR__ . "/..");

require __DIR__ . "/../vendor/autoload.php";

putenv("PRE_BASE_DIR=" . __DIR__ . "/../");

\Pre\Plugin\addMacroPath(__DIR__ . "/../src/macros.yay");
2 changes: 1 addition & 1 deletion tests/specs/accessors.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--DESCRIPTION--

Test accessors
Test class accessors macros

--GIVEN--

Expand Down
2 changes: 1 addition & 1 deletion tests/specs/fallbacks.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--DESCRIPTION--

Test accessor fallbacks
Test class accessors fallback macros

--GIVEN--

Expand Down

0 comments on commit 43a44af

Please sign in to comment.