Skip to content

Commit

Permalink
release preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
hanneskod committed Dec 25, 2020
1 parent f1f0307 commit 7e4d70b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
All notable changes to this project will be documented in this file.
This project now adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
## [2.0.0-beta1] - 2020-12-25

Version 2 is a complete rewrite using php8 attributes instead of docblock style
annotation. Major changes include:

- Removed built in phpunit integration
- Removed the `--named-only` command line option
Expand All @@ -14,7 +17,6 @@ This project now adheres to [Semantic Versioning](http://semver.org/).
- Added the `--input` command line option
- Renamed command line option `--format` > `--output`
- Added the `--debug` command line option
- Using php8 attributes instead of annotations
- Added support for config files
- Added the `--config` and `--no-config` command line options
- Use a propper event dispatcher
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

Validate PHP code examples in documentation.

This file describes version `2` which uses php8 attributes. For version `1`
which uses docblock style annotations see [this link](https://github.com/hanneskod/readme-tester/tree/1.0.0).


## Why?

Did you update your library, but forgot to update code examples in README? Are
Expand Down
11 changes: 0 additions & 11 deletions docs/01-basic_syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ Attributes unknown to readmetester are simply skipped
// The UnknownAttribute is skipped as it is not known
```

### Case insensitive attributes

Attributes are case insensitive.

<!--
#[readmetester\expectoutput('foo')]
-->
```php
echo "foo";
```

### Multiple attributes

Multiple attributes can be grouped togheter in the same way as php handles
Expand Down
4 changes: 2 additions & 2 deletions spec/Attribute/IgnoreUnmarkedExamplesSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ function it_is_a_transformation()

function it_ignores_unmaked_example(ExampleObj $example)
{
$example->getAttributes()->willReturn([(object)array()]);
$example->hasAttribute(Example::class)->willReturn(false);
$example->withActive(false)->willReturn($example)->shouldBeCalled();
$this->transform($example)->shouldReturn($example);
}

function it_skipps_marked_example(ExampleObj $example)
{
$example->getAttributes()->willReturn([new Example]);
$example->hasAttribute(Example::class)->willReturn(true);
$example->withActive(false)->shouldNotBeCalled();
$this->transform($example)->shouldReturn($example);
}
Expand Down
6 changes: 2 additions & 4 deletions src/Attribute/IgnoreUnmarkedExamples.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class IgnoreUnmarkedExamples extends AbstractAttribute implements Transformation
{
public function transform(ExampleObj $example): ExampleObj
{
foreach ($example->getAttributes() as $attribute) {
if ($attribute instanceof Example) {
return $example;
}
if ($example->hasAttribute(Example::class)) {
return $example;
}

return $example->withActive(false);
Expand Down
2 changes: 1 addition & 1 deletion src/FilesystemFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getFilesystemInput(string $cwd, array $paths, array $extensions,
)
);

// Set file extensions (case insensitive)
// Set file extensions

$finder->name(
array_map(
Expand Down

0 comments on commit 7e4d70b

Please sign in to comment.