Skip to content

Commit

Permalink
First release
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent Morselli committed Jan 17, 2015
1 parent 08bba95 commit cc5aebb
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
build/
16 changes: 16 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
before_commands:
- "composer install --prefer-dist"

tools:
external_code_coverage: true
php_mess_detector: true
php_code_sniffer: true
php_analyzer: true
sensiolabs_security_checker: true
php_code_coverage: true
php_sim: false
php_cpd: true
php_pdepend:
excluded_dirs: [vendor/*, doc/*, tests/*]
filter:
excluded_paths: [vendor/*, doc/*, tests/*]
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: php

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

matrix:
allow_failures:
- php: hhvm

before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar update --dev --no-interaction

script:
- mkdir -p build/logs
- php vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi;'
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Base64 Url Safe

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Spomky-Labs/base64url/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Spomky-Labs/base64url/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/Spomky-Labs/base64url/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Spomky-Labs/base64url/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/Spomky-Labs/base64url/badges/build.png?b=master)](https://scrutinizer-ci.com/g/Spomky-Labs/base64url/build-status/master)
[![HHVM Status](http://hhvm.h4cc.de/badge/Spomky-Labs/base64url.png)](http://hhvm.h4cc.de/package/Spomky-Labs/base64url)

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/0f8f9b12-2076-4d0e-a34e-c6f097c61b16/big.png)](https://insight.sensiolabs.com/projects/0f8f9b12-2076-4d0e-a34e-c6f097c61b16)

[![Latest Stable Version](https://poser.pugx.org/Spomky-Labs/base64url/v/stable.png)](https://packagist.org/packages/Spomky-Labs/base64url) [![Total Downloads](https://poser.pugx.org/Spomky-Labs/base64url/downloads.png)](https://packagist.org/packages/Spomky-Labs/base64url) [![Latest Unstable Version](https://poser.pugx.org/Spomky-Labs/base64url/v/unstable.png)](https://packagist.org/packages/Spomky-Labs/base64url) [![License](https://poser.pugx.org/Spomky-Labs/base64url/license.png)](https://packagist.org/packages/Spomky-Labs/base64url)
32 changes: 32 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "spomky-labs/base64url",
"description": "Base 64 URL Safe",
"type": "library",
"license": "MIT",
"keywords": ["Base64", "URL", "Safe"],
"homepage": "https://github.com/Spomky-Labs/base64url",
"authors": [
{
"name": "Florent Morselli",
"homepage": "https://github.com/Spomky-Labs/base64url/contributors"
}
],
"autoload": {
"psr-4": {
"Base64Url\\": "lib/"
}
},
"autoload-dev": {
"psr-4": {
"Base64Url\\": "tests/"
}
},
"require": {
"php": ">=5.3"
},
"extra": {
"branch-alias": {
"dev-master": "0.0.x-dev"
}
}
}
19 changes: 19 additions & 0 deletions lib/Base64Url.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Base64Url;

/**
* Encode and decode data into Base64 Url Safe
*/
class Base64Url
{
public static function encode($data)
{
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}

public static function decode($data)
{
return base64_decode(strtr($data, '-_', '+/'));
}
}
30 changes: 30 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
strict="true"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="true"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">./</directory>
<exclude>
<directory>./tests</directory>
<directory>./doc</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

0 comments on commit cc5aebb

Please sign in to comment.