-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ivan Wolf
committed
Jul 7, 2015
1 parent
9fa01c5
commit 580264d
Showing
19 changed files
with
308 additions
and
2 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,2 @@ | ||
src_dir: src | ||
service_name: travis-ci |
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 @@ | ||
* text eol=lf |
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,4 @@ | ||
vendor | ||
composer.lock | ||
composer.phar | ||
phpunit.xml |
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,23 @@ | ||
language: php | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- hhvm | ||
|
||
matrix: | ||
allow_failures: | ||
- php: hhvm | ||
|
||
before_script: | ||
- composer self-update | ||
- composer install --dev --prefer-source --no-interaction | ||
|
||
script: | ||
- php vendor/bin/phpunit -c travis.phpunit.xml | ||
- php vendor/bin/phpmd src xml build/config/phpmd.xml --reportfile build/logs/pmd.xml | ||
- php vendor/bin/phpcs --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=build/config/phpcs.xml -v ./src/ ./tests/ | ||
|
||
after_script: | ||
- php vendor/bin/coveralls |
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,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014 DETAIL NET | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
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,2 +1,6 @@ | ||
# dfw-filtering | ||
DETAIL Framework library for input filtering | ||
# DETAIL Framework library for index based filtering | ||
|
||
[![Build Status](https://travis-ci.org/detailnet/dfw-filtering.svg?branch=master)](https://travis-ci.org/detailnet/dfw-filtering) | ||
[![Coverage Status](https://img.shields.io/coveralls/detailnet/dfw-filtering.svg)](https://coveralls.io/r/detailnet/dfw-filtering) | ||
[![Latest Stable Version](https://poser.pugx.org/detailnet/dfw-filtering/v/stable.svg)](https://packagist.org/packages/detailnet/dfw-filtering) | ||
[![Latest Unstable Version](https://poser.pugx.org/detailnet/dfw-filtering/v/unstable.svg)](https://packagist.org/packages/detailnet/dfw-filtering) |
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,5 @@ | ||
* | ||
!config | ||
!config/* | ||
!logs | ||
!.gitignore |
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,31 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="DETAIL NET PHPCS rule set"> | ||
<description>The coding standard for a DETAIL NET PHP application</description> | ||
<exclude-pattern>*/img/*</exclude-pattern> | ||
<exclude-pattern>*/images/*</exclude-pattern> | ||
<exclude-pattern>*/less/*</exclude-pattern> | ||
<exclude-pattern>*/css/*</exclude-pattern> | ||
<exclude-pattern>*/js/*</exclude-pattern> | ||
<exclude-pattern>*.html</exclude-pattern> | ||
<exclude-pattern>*.twig</exclude-pattern> | ||
<exclude-pattern>*.yml</exclude-pattern> | ||
<exclude-pattern>*.xml</exclude-pattern> | ||
<exclude-pattern>*.txt</exclude-pattern> | ||
<exclude-pattern>*.less</exclude-pattern> | ||
<exclude-pattern>*.css</exclude-pattern> | ||
<exclude-pattern>*.js</exclude-pattern> | ||
<exclude-pattern>*.jpg</exclude-pattern> | ||
<exclude-pattern>*.jpeg</exclude-pattern> | ||
<exclude-pattern>*.png</exclude-pattern> | ||
<exclude-pattern>*.gif</exclude-pattern> | ||
|
||
<!-- Include the whole PSR-2 standard --> | ||
<rule ref="PSR2"/> | ||
<rule ref="Generic.Files.LineLength"> | ||
<properties> | ||
<property name="lineLimit" value="140"/> | ||
<property name="absoluteLineLimit" value="0"/> | ||
</properties> | ||
</rule> | ||
|
||
</ruleset> |
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 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="DETAIL NET PHPMD rule set" | ||
xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | ||
|
||
<description>Ruleset for all DETAIL NET projects</description> | ||
|
||
<rule ref="rulesets/unusedcode.xml" /> | ||
|
||
<rule ref="rulesets/design.xml"> | ||
<exclude name="CouplingBetweenObjects"/> | ||
</rule> | ||
|
||
<rule ref="rulesets/naming.xml"> | ||
<exclude name="ShortVariable"/> | ||
<exclude name="LongVariable"/> | ||
<exclude name="BooleanGetMethodName"/> | ||
</rule> | ||
<rule ref="rulesets/naming.xml/ShortVariable"> | ||
<properties> | ||
<property name="minimum" value="2" /> | ||
</properties> | ||
</rule> | ||
<rule ref="rulesets/naming.xml/LongVariable"> | ||
<properties> | ||
<property name="maximum" value="30" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="rulesets/codesize.xml"> | ||
<exclude name="TooManyMethods"/> | ||
<exclude name="ExcessiveClassComplexity"/> | ||
<exclude name="NPathComplexity"/> | ||
</rule> | ||
<rule ref="rulesets/codesize.xml/TooManyMethods"> | ||
<properties> | ||
<property name="maxmethods" value="20" /> | ||
</properties> | ||
</rule> | ||
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity"> | ||
<properties> | ||
<property name="maximum" value="70" /> | ||
</properties> | ||
</rule> | ||
<rule ref="rulesets/codesize.xml/NPathComplexity"> | ||
<properties> | ||
<property name="minimum" value="300" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="rulesets/controversial.xml"> | ||
<exclude name="Superglobals"/> | ||
</rule> | ||
</ruleset> |
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,2 @@ | ||
* | ||
!.gitignore |
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,55 @@ | ||
{ | ||
"name": "detailnet/dfw-filtering", | ||
"description": "DETAIL Framework library for input filtering", | ||
"type": "library", | ||
"keywords": [ | ||
"dfw", | ||
"detailnet", | ||
"input", | ||
"filtering" | ||
], | ||
"homepage": "https://github.com/detailnet/dfw-filtering/", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Ivan Wolf", | ||
"email": "ivan.wolf@detailnet.ch" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.5.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.6", | ||
"squizlabs/php_codesniffer" : "~2.3", | ||
"phpmd/phpmd": "~2.2", | ||
"satooshi/php-coveralls": "dev-master" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"Detail\\Filtering\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-0": { | ||
"DetailTest\\Filtering\\": "tests/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.x-dev" | ||
} | ||
}, | ||
"archive": { | ||
"exclude": [ | ||
"!vendor", | ||
"tests", | ||
"*phpunit.xml", | ||
".coveralls.yml", | ||
".travis.yml", | ||
"build.xml", | ||
"build.properties", | ||
"composer.phar" | ||
] | ||
} | ||
} |
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,29 @@ | ||
<phpunit | ||
bootstrap="./tests/bootstrap.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
verbose="true" | ||
stopOnFailure="false" | ||
processIsolation="false" | ||
backupGlobals="false" | ||
syntaxCheck="true" | ||
> | ||
<testsuite name="Detail\Filtering Test Suite"> | ||
<directory>./tests/DetailTest/Filtering</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/> | ||
<log type="coverage-html" target="./build/coverage" title="Detail\Filtering" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/> | ||
<log type="coverage-clover" target="./build/logs/clover.xml"/> | ||
<log type="junit" target="./build/logs/junit.xml" logIncompleteSkipped="false"/> | ||
</logging> | ||
</phpunit> |
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,7 @@ | ||
<?php | ||
|
||
namespace Detail\Filtering\Exception; | ||
|
||
interface ExceptionInterface | ||
{ | ||
} |
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,8 @@ | ||
<?php | ||
|
||
namespace Detail\Filtering\Exception; | ||
|
||
class InvalidArgumentException extends \InvalidArgumentException implements | ||
ExceptionInterface | ||
{ | ||
} |
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,8 @@ | ||
<?php | ||
|
||
namespace Detail\Filtering\Exception; | ||
|
||
class RuntimeException extends \RuntimeException implements | ||
ExceptionInterface | ||
{ | ||
} |
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 @@ | ||
configuration.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,18 @@ | ||
<?php | ||
|
||
$loader = null; | ||
$basePath = realpath(__DIR__ . '/..') . '/'; | ||
|
||
if (file_exists($basePath . 'vendor/autoload.php')) { | ||
$loader = include $basePath . 'vendor/autoload.php'; | ||
} else { | ||
throw new RuntimeException( | ||
$basePath . 'vendor/autoload.php could not be found. Did you run `php composer.phar install`?' | ||
); | ||
} | ||
|
||
$loader->add('DetailTest\Filtering', __DIR__); | ||
|
||
if (!$config = @include $basePath . 'tests/configuration.php') { | ||
$config = require $basePath . 'tests/configuration.php.dist'; | ||
} |
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,3 @@ | ||
<?php | ||
|
||
return array(); |
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,27 @@ | ||
<phpunit | ||
bootstrap="./tests/bootstrap.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
verbose="true" | ||
stopOnFailure="false" | ||
processIsolation="false" | ||
backupGlobals="false" | ||
syntaxCheck="true" | ||
> | ||
<testsuite name="Detail\Filtering Test Suite"> | ||
<directory>./tests/DetailTest/Filtering</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log type="coverage-clover" target="./build/logs/clover.xml"/> | ||
<log type="junit" target="./build/logs/junit.xml" logIncompleteSkipped="false"/> | ||
</logging> | ||
</phpunit> |