Skip to content

Commit

Permalink
Merge pull request #1 from csrdelft/refactor
Browse files Browse the repository at this point in the history
Refactor and add some tests
  • Loading branch information
mathcals authored Sep 28, 2019
2 parents af433c5 + b5592bc commit 5835c45
Show file tree
Hide file tree
Showing 46 changed files with 2,140 additions and 224 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
vendor
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: php
php:
- 7.2

dist: trusty

cache:
directories:
- "node_modules"
- "vendor"

install:
- composer install

script:
- composer test
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ A tag has access to an environment, which is by default of type `CsrDelft\bb\BBe

```php
class BbSuperscript extends BbTag {
public function getTagName() {
public static function getTagName() {
return 'sup';
}

public function parse($arguments = []) {
return '<sup class="bb-tag-sup">' . $this->getContent(['sub', 'sup']) . '</sup>';
public function render() {
return '<sup class="bb-tag-sup">' . $this->content . '</sup>';
}

public function parse($arguments = []) {
$this->readContent(['sub', 'sup'])
}
}
```

Expand Down
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,12 @@
"psr-4": {
"CsrDelft\\bb\\": "src/"
}
},
"scripts": {
"test": "@php vendor/phpunit/phpunit/phpunit tests"
},
"require-dev": {
"phpunit/phpunit": "^8.3",
"spatie/phpunit-snapshot-assertions": "^2.1"
}
}
Loading

0 comments on commit 5835c45

Please sign in to comment.