Skip to content

Commit

Permalink
Update to PHP 7 (close #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrokeil committed Aug 4, 2017
1 parent 9d1a2da commit 2f3ca57
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 301 deletions.
6 changes: 1 addition & 5 deletions test/testing.config.php → .docheader
@@ -1,11 +1,7 @@
<?php
/**
* Sake
*
* @link http://github.com/sandrokeil/HtmlElement for the canonical source repository
* @copyright Copyright (c) 2014 Sandro Keil
* @copyright Copyright (c) 2014-2017 Sandro Keil
* @license http://github.com/sandrokeil/HtmlElement/blob/master/LICENSE.txt New BSD License
*/

return array(
);
40 changes: 24 additions & 16 deletions .travis.yml
@@ -1,25 +1,33 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

matrix:
allow_failures:
- php: hhvm
fast_finish: true
include:
- php: 7.1
env:
- DEPENDENCIES=""
- TEST_COVERAGE=true
- php: 7.1
env:
- DEPENDENCIES="--prefer-lowest --prefer-stable"
- TEST_COVERAGE=true

cache:
directories:
- $HOME/.composer/cache
- $HOME/.php-cs-fixer
- $HOME/.local

before_script:
- mkdir -p "$HOME/.php-cs-fixer"
- phpenv config-rm xdebug.ini
- composer self-update
- composer install --dev --prefer-source
- composer update --prefer-dist $DEPENDENCIES

script:
- ./vendor/bin/phpunit
- ./vendor/bin/phpcs --standard=PSR2 ./src/ ./test
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/docheader check src/ tests/; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml; else ./vendor/bin/phpunit; fi

after_script:
- php vendor/bin/coveralls -v
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
after_success:
- if [[ $TEST_COVERAGE == 'true' ]]; then php vendor/bin/coveralls -v; fi
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
# HtmlElement CHANGELOG

## Version 2.0.0 (2017-08-04)

* Use >= PHP 7.0 only
* Removed Zend Framework module config

## Version 1.1.1 (2015-01-19)

* Previous exceptions are now triggered in __toString()
Expand Down
10 changes: 0 additions & 10 deletions Module.php

This file was deleted.

23 changes: 17 additions & 6 deletions README.md
@@ -1,4 +1,4 @@
# HtmlElement view helper for Zend Framework 2
# HtmlElement view helper for Zend Framework

> You want HTML tags as objects?
Expand All @@ -18,10 +18,10 @@
[![Total Downloads](https://poser.pugx.org/sandrokeil/html-element/downloads.png)](https://packagist.org/packages/sandrokeil/html-element)
[![License](https://poser.pugx.org/sandrokeil/html-element/license.png)](https://packagist.org/packages/sandrokeil/html-element)

Zend Framework 2 view helper plugin for generating HTML tags. Use HTML tags as objects and manipulate HTML attributes and values.
Zend Framework view helper plugin for generating HTML tags. Use HTML tags as objects and manipulate HTML attributes and values.

* **Well tested.** Besides unit tests and continuous integration/inspection this solution is also ready for production use.
* **Great foundations.** Based on [Zend Framework 2](https://github.com/zendframework/zf2) and [Easy Config](https://github.com/sandrokeil/EasyConfig)
* **Great foundations.** Based on [Zend Framework](https://github.com/zendframework) and [interop-config](https://github.com/sandrokeil/interop-config)
* **Every change is tracked**. Want to know whats new? Take a look at [CHANGELOG.md](CHANGELOG.md)
* **Listen to your ideas.** Have a great idea? Bring your tested pull request or open a new issue. See [CONTRIBUTING.md](CONTRIBUTING.md)

Expand All @@ -34,11 +34,22 @@ Put the following into your composer.json

{
"require": {
"sandrokeil/html-element": "~1.0"
"sandrokeil/html-element": "^2.0"
}
}

Then add `Sake\HtmlElement` to your `./config/application.config.php`.
Please register the `HtmlElement` view helper to your [Zend\View plugin manager](https://zendframework.github.io/zend-view/helpers/advanced-usage/).
You can use the `Sake\HtmlElement\Service\HtmlElementFactory` factory if you install [interop-config](https://github.com/sandrokeil/interop-config).

```php
return [
'view_helpers' => [
'factories' => [
\Sake\HtmlElement\View\Helper\HtmlElement::class => \Sake\HtmlElement\Service\HtmlElementFactory::class,
],
],
];
```

## Documentation

Expand Down Expand Up @@ -74,7 +85,7 @@ echo $this->html(
The default behaviour of HtmlElement is maximum security. But if you have thousands of HTML tags it could be slow.
If your HTML attributes are not from user input, you can disable escaping of HTML attributes to increase performance.
You can also disable escaping of text to unleash the beast. ;-) This is simply done by adding the following lines to
your `module.config.php`, but keep security in mind.
your config file, but keep security in mind.

```php
<?php
Expand Down
26 changes: 12 additions & 14 deletions composer.json
@@ -1,11 +1,12 @@
{
"name": "sandrokeil/html-element",
"description": "Zend Framework 2 (zf2) view helper plugin to use html tags like objects and to render them.",
"description": "Zend Framework view helper plugin to use html tags like objects and to render them.",
"homepage": "https://github.com/sandrokeil/HtmlElement",
"license": "BSD-3-Clause",
"type": "library",
"keywords": [
"zf2",
"zf3",
"view",
"zend framework",
"view helper",
Expand All @@ -23,22 +24,19 @@
}
},
"require": {
"php": "~5.3",
"zendframework/zend-view": "~2.2",
"zendframework/zend-escaper": "~2.2"
"php": "^7.0",
"zendframework/zend-view": "^2.2 || ^3.0",
"zendframework/zend-escaper": "^2.2 || ^3.0"
},
"require-dev": {
"zendframework/zend-test": "~2.2",
"zendframework/zend-config": "~2.2",
"zendframework/zend-form": "~2.2",
"zendframework/zend-serializer": "~2.2",
"zendframework/zend-log": "~2.2",
"zendframework/zend-modulemanager": "~2.2",
"sandrokeil/easy-config": "~1.0",
"sandrokeil/citools": "~1.0"
"phpunit/phpunit": "^6.0",
"satooshi/php-coveralls": "^1.0",
"squizlabs/php_codesniffer": "^3.0",
"malukenho/docheader": "^0.1.4",
"sandrokeil/interop-config": "^2.1.0",
"container-interop/container-interop": "^1.1"
},
"suggest": {
"zendframework/zend-modulemanager": "To use default module configuration",
"sandrokeil/easy-config": "To use configuration of view helper factory via module config"
"sandrokeil/interop-config": "^2.1.0 for usage of provided factory (require PHP >= 7.1)"
}
}
19 changes: 0 additions & 19 deletions config/module.config.php

This file was deleted.

14 changes: 0 additions & 14 deletions config/view_helper.config.php

This file was deleted.

41 changes: 0 additions & 41 deletions src/Module.php

This file was deleted.

0 comments on commit 2f3ca57

Please sign in to comment.