-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 2.0: Added badges in README Changed directory structure and added "autoload-dev" Fixed trimming in HTMLPurifierListener Fixed README and added CHANGELOG Updated travis.yaml to rely on PHPUnit bridge and PHP CS Fixer
- Loading branch information
Showing
28 changed files
with
397 additions
and
76 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.php_cs.cache | ||
.phpunit.result.cache | ||
phpunit.xml | ||
composer.lock | ||
vendor/ |
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,13 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->exclude('Resources') | ||
->in(__DIR__) | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@Symfony' => true, | ||
]) | ||
->setFinder($finder) | ||
; |
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 |
---|---|---|
@@ -1,5 +1,66 @@ | ||
language: php | ||
php: | ||
- '7.1' | ||
install: composer install | ||
script: php vendor/bin/phpunit | ||
|
||
sudo: false | ||
|
||
dist: xenial | ||
|
||
env: | ||
global: | ||
- COMPOSER_MEMORY_LIMIT=-1 | ||
- SYMFONY_PHPUNIT_DIR=$HOME/.phpunit-bridge | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
- $HOME/.phpunit-bridge | ||
|
||
jobs: | ||
include: | ||
# Lowest | ||
- php: 5.5 | ||
dist: trusty | ||
env: NO_FLEX=1 COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak | ||
- php: 7.1 | ||
env: SYMFONY_REQUIRE="4.3.*" COMPOSER_FLAGS="--prefer-lowest" | ||
|
||
# Stable | ||
- php: 7.2 | ||
env: SYMFONY_REQUIRE="3.4.*" COMPOSER_FLAGS="--prefer-stable" | ||
- php: 7.3 | ||
env: SYMFONY_REQUIRE="4.4.*" COMPOSER_FLAGS="--prefer-stable" | ||
- php: 7.4 | ||
env: SYMFONY_REQUIRE="5.0.*" COMPOSER_FLAGS="--prefer-stable" | ||
|
||
# Dev | ||
- php: 7.4 | ||
env: STABILITY=dev | ||
|
||
# QA | ||
- stage: QA | ||
name: PHP CS Fixer | ||
php: 7.4 | ||
script: vendor/bin/php-cs-fixer fix --dry-run --diff | ||
- name: Coverage | ||
php: 7.4 | ||
before_script: | ||
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,} | ||
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi | ||
script: | ||
- ./vendor/bin/simple-phpunit -v --coverage-text | ||
|
||
allow_failures: | ||
- env: STABILITY=dev | ||
|
||
before_install: | ||
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available" | ||
- composer self-update | ||
- if [[ -z $NO_FLEX ]]; then composer global require --no-progress --no-scripts --no-plugins symfony/flex; fi; | ||
|
||
install: | ||
- composer update --prefer-dist --no-interaction $COMPOSER_FLAGS | ||
- vendor/bin/simple-phpunit install | ||
|
||
script: | ||
- if [[ -v $STABILITY ]]; then composer config minimum-stability $STABILITY; fi; | ||
- composer validate --strict --no-check-lock | ||
- vendor/bin/simple-phpunit -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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Version 2.0 (08/2018) | ||
|
||
* Added compatibility for Symfony 5 and Twig 3 | ||
* Updated minimum requirement of Twig to 1.35 and 2.4 to support runtime | ||
* [BC break] Dropped support for Symfony 2. Symfony 3.4 minimum required. | ||
* [BC break] Removed classes parameters. | ||
* [BC break] Removed the form data transformer. | ||
* Added an `HTMLPurifierTextTypeExtension` to add `purify_html` and | ||
`purify_html_profile` options to all `TextType` children. | ||
* Added an `HTMLPurifierListener` to purify submitted form data. | ||
* Added an `HTMLPurifiersRegistryInterface` to lazy load purifiers by profile. | ||
* Added a Twig `HTMLPurifierRuntime` to lazy load purifiers in templates. | ||
* Added a pass to use custom `\HTMLPurifier` classes as custom profiles using | ||
a new `exercise.html_purifier` tag. |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
47 changes: 47 additions & 0 deletions
47
src/Form/TypeExtension/ForwardCompatTypeExtensionTrait.php
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,47 @@ | ||
<?php | ||
|
||
namespace Exercise\HTMLPurifierBundle\Form\TypeExtension; | ||
|
||
use Symfony\Component\Form\FormTypeExtensionInterface; | ||
|
||
if (method_exists(FormTypeExtensionInterface::class, 'getExtendedTypes')) { | ||
eval(' | ||
namespace Exercise\HTMLPurifierBundle\Form\TypeExtension; | ||
/** | ||
* @internal | ||
*/ | ||
trait ForwardCompatTypeExtensionTrait | ||
{ | ||
private static function doGetExtendedTypes(): iterable | ||
{ | ||
} | ||
public static function getExtendedTypes(): iterable | ||
{ | ||
return self::doGetExtendedTypes(); | ||
} | ||
} | ||
'); | ||
} else { | ||
/** | ||
* @internal | ||
*/ | ||
trait ForwardCompatTypeExtensionTrait | ||
{ | ||
/** | ||
* @return iterable | ||
*/ | ||
private static function doGetExtendedTypes() | ||
{ | ||
} | ||
|
||
/** | ||
* @return iterable | ||
*/ | ||
public static function getExtendedTypes() | ||
{ | ||
return self::doGetExtendedTypes(); | ||
} | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
Oops, something went wrong.