Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Configuration to skipp html tags (#5)
* added logic to skipp tags * added script tag to be skipped default * adjusted tests * added ci workflow configuration
- Loading branch information
1 parent
01831d1
commit 737ec72
Showing
7 changed files
with
179 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: CI | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
tests: | ||
name: PHP ${{ matrix.php }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ 7.2., 7.3, 7.4 ] | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo, zlib | ||
tools: phpunit | ||
coverage: none | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install the dependencies | ||
run: composer install --no-interaction | ||
|
||
- name: Run the unit tests | ||
run: php vendor/bin/phpunit -c phpunit.xml.dist --colors=always | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo, zlib | ||
coverage: xdebug | ||
tools: php-cs-fixer, phpunit | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install the dependencies | ||
run: composer install --no-interaction | ||
|
||
- name: Generate the coverage report | ||
run: php vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml | ||
|
||
- name: Coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
composer global require php-coveralls/php-coveralls | ||
php-coveralls --coverage_clover=build/logs/clover.xml -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) 2021 Heimrich & Hannot GmbH | ||
* | ||
* @license LGPL-3.0-or-later | ||
*/ | ||
|
||
namespace HeimrichHannot\HyphenatorBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
class Configuration implements ConfigurationInterface | ||
{ | ||
const ROOT_ID = 'huh_hyphenator'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getConfigTreeBuilder() | ||
{ | ||
$treeBuilder = new TreeBuilder(static::ROOT_ID); | ||
|
||
// Keep compatibility with symfony/config < 4.2 | ||
if (!method_exists($treeBuilder, 'getRootNode')) { | ||
$rootNode = $treeBuilder->root(static::ROOT_ID); | ||
} else { | ||
$rootNode = $treeBuilder->getRootNode(); | ||
} | ||
|
||
// $rootNode = $treeBuilder->root(static::ROOT_ID); | ||
$rootNode | ||
->children() | ||
->arrayNode('skip_tags') | ||
->scalarPrototype() | ||
->defaultValue(['script']) | ||
->end() | ||
->end() | ||
->end(); | ||
|
||
return $treeBuilder; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters