-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add foundation for DataValues/Validators ~=[,,_,,]:3
- Loading branch information
0 parents
commit f622b9b
Showing
9 changed files
with
559 additions
and
0 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,12 @@ | ||
*~ | ||
*.kate-swp | ||
*.swp | ||
|
||
!.* | ||
|
||
.idea/ | ||
build/ | ||
vendor/ | ||
|
||
composer.phar | ||
composer.lock |
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,12 @@ | ||
inherit: true | ||
|
||
tools: | ||
php_code_coverage: true | ||
php_code_sniffer: true | ||
php_cpd: true | ||
php_cs_fixer: true | ||
php_loc: true | ||
php_mess_detector: true | ||
php_pdepend: true | ||
php_analyzer: true | ||
sensiolabs_security_checker: true |
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,16 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
|
||
before_script: | ||
- composer install | ||
|
||
script: | ||
- phpunit --coverage-clover build/logs/clover.xml | ||
|
||
after_script: | ||
- composer require satooshi/php-coveralls:dev-master | ||
- php vendor/bin/coveralls -v |
Large diffs are not rendered by default.
Oops, something went wrong.
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,65 @@ | ||
# DataValues Validators | ||
|
||
|
||
|
||
[](http://travis-ci.org/DataValues/Validators) | ||
|
||
On [Packagist](https://packagist.org/packages/data-values/validators): | ||
[](https://packagist.org/packages/data-values/validators) | ||
[](https://packagist.org/packages/data-values/validators) | ||
|
||
## Installation | ||
|
||
The recommended way to use this library is via [Composer](http://getcomposer.org/). | ||
|
||
### Composer | ||
|
||
To add this package as a local, per-project dependency to your project, simply add a | ||
dependency on `data-values/validators` to your project's `composer.json` file. | ||
Here is a minimal example of a `composer.json` file that just defines a dependency on | ||
version 1.0 of this package: | ||
|
||
{ | ||
"require": { | ||
"data-values/validators": "1.0.*" | ||
} | ||
} | ||
|
||
### Manual | ||
|
||
Get the code of this package, either via git, or some other means. Also get all dependencies. | ||
You can find a list of the dependencies in the "require" section of the composer.json file. | ||
Then take care of autoloading the classes defined in the src directory. | ||
|
||
## Tests | ||
|
||
This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run these | ||
tests using the PHPUnit configuration file found in the root directory. The tests can also be run | ||
via TravisCI, as a TravisCI configuration file is also provided in the root directory. | ||
|
||
## Authors | ||
|
||
DataValues Validators has been written by the Wikidata team, as [Wikimedia Germany] | ||
(https://wikimedia.de) employees for the [Wikidata project](https://wikidata.org/). | ||
|
||
It is based upon and contains a lot of code written by [Jeroen De Dauw] | ||
(https://github.com/JeroenDeDauw) for the [Maps](https://github.com/JeroenDeDauw/Maps) and | ||
[Semantic MediaWiki](https://semantic-mediawiki.org/) projects. | ||
|
||
## Release notes | ||
|
||
### 0.1 (dev) | ||
|
||
Initial release with these features: | ||
|
||
* DimensionValidator | ||
* ListValidator | ||
* NullValidator | ||
* RangeValidator | ||
* StringValidator | ||
* TitleValidator | ||
|
||
## Links | ||
|
||
* [DataValues Validators on Packagist](https://packagist.org/packages/data-values/validators) | ||
* [DataValues Validators on TravisCI](https://travis-ci.org/DataValues/Validators) |
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,32 @@ | ||
<?php | ||
|
||
/** | ||
* Entry point of the DataValues Validators library. | ||
* | ||
* @since 0.1 | ||
* @codeCoverageIgnore | ||
* | ||
* @licence GNU GPL v2+ | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
|
||
if ( defined( 'DATAVALUES_VALIDATORS_VERSION' ) ) { | ||
// Do not initialize more then once. | ||
return 1; | ||
} | ||
|
||
define( 'DATAVALUES_VALIDATORS_VERSION', '0.1 beta' ); | ||
|
||
if ( defined( 'MEDIAWIKI' ) ) { | ||
$GLOBALS['wgExtensionCredits']['datavalues'][] = array( | ||
'path' => __DIR__, | ||
'name' => 'DataValues Number', | ||
'version' => DATAVALUES_NUMBER_VERSION, | ||
'author' => array( | ||
'[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]', | ||
'The Wikidata team', | ||
), | ||
'url' => 'https://github.com/DataValues/Validators', | ||
'description' => 'Numerical value objects, parsers and formatters', | ||
); | ||
} |
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,45 @@ | ||
{ | ||
"name": "data-values/validators", | ||
"type": "library", | ||
"description": "", | ||
"keywords": [ | ||
"datavalues", | ||
"valueparsers", | ||
"valueformatters", | ||
"wikidata", | ||
"validators", | ||
"validation" | ||
], | ||
"homepage": "https://github.com/DataValues/Validators", | ||
"license": "GPL-2.0+", | ||
"authors": [ | ||
{ | ||
"name": "Jeroen De Dauw", | ||
"email": "[email protected]", | ||
"homepage": "http://jeroendedauw.com", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "The Wikidata team", | ||
"role": "Developer" | ||
} | ||
], | ||
"support": { | ||
"irc": "irc://irc.freenode.net/wikidata" | ||
}, | ||
"require": { | ||
"php": ">=5.3.0", | ||
"data-values/data-values": "~0.1", | ||
"data-values/interfaces": "~0.1", | ||
"data-values/common": "*" | ||
}, | ||
"minimum-stability" : "dev", | ||
"autoload": { | ||
"files" : [ | ||
"Validators.php" | ||
], | ||
"psr-0": { | ||
"ValueValidators\\": "src" | ||
} | ||
} | ||
} |
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,25 @@ | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="tests/bootstrap.php" | ||
cacheTokens="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
strict="true" | ||
verbose="true"> | ||
<testsuites> | ||
<testsuite name="DataValuesValidators"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist addUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
</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,5 @@ | ||
<?php | ||
|
||
echo exec( 'composer update' ) . "\n"; | ||
|
||
require_once( __DIR__ . '/../vendor/autoload.php' ); |