Skip to content

Commit 2a9fb26

Browse files
author
SmetDenis
committed
Start!
0 parents  commit 2a9fb26

File tree

15 files changed

+454
-0
lines changed

15 files changed

+454
-0
lines changed

.codeclimate.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
languages:
2+
PHP: true
3+
4+
exclude_paths:
5+
- tests/*

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/*
2+
vendor/*
3+
phpunit.xml
4+
composer.lock

.travis.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
language: php
2+
3+
php:
4+
- 5.3
5+
- 5.4
6+
- 5.5
7+
- 5.6
8+
- 7.0
9+
- hhvm
10+
11+
matrix:
12+
fast_finish: true
13+
allow_failures:
14+
- php: 7.0
15+
- php: hhvm
16+
17+
before_script:
18+
# Composer
19+
- composer self-update
20+
- composer update
21+
- composer validate
22+
23+
# install testing tools
24+
- composer require phpunit/phpunit:^4.8
25+
26+
# install report tools
27+
- sh -c 'if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then
28+
composer require
29+
satooshi/php-coveralls:dev-master
30+
squizlabs/php_codesniffer:*
31+
sebastian/phpcpd:*
32+
phploc/phploc:*
33+
phpmd/phpmd:^2.2
34+
pdepend/pdepend:^2.1
35+
;
36+
fi;'
37+
38+
# Dirs
39+
- mkdir -p build/cov
40+
- mkdir -p build/logs
41+
- mkdir -p build/phpunit
42+
- mkdir -p build/pdepend
43+
44+
# Update env
45+
- phpenv rehash
46+
47+
script:
48+
# PHPUnit tests
49+
- php vendor/bin/phpunit --configuration phpunit.xml.dist;
50+
51+
# Check PHP Code Standarts
52+
- sh -c 'if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then
53+
mkdir -p build/misc;
54+
git clone --branch=master https://github.com/JBZoo/Misc.git build/misc;
55+
php vendor/bin/phpcs ./src --standard=build/misc/phpcs/JBZoo/ruleset.xml --report=full;
56+
fi;'
57+
58+
after_script:
59+
# Send to coveralls
60+
- sh -c 'if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then
61+
php vendor/bin/coveralls --verbose;
62+
fi;'
63+
64+
# Try to find copy-paste
65+
- sh -c 'if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then
66+
php vendor/bin/phpcpd ./src --no-interaction --verbose;
67+
fi;'
68+
69+
# Show code statistic
70+
- sh -c 'if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then
71+
php vendor/bin/phploc ./src --no-interaction --verbose;
72+
fi;'
73+
74+
# Show code problems
75+
- sh -c 'if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then
76+
php vendor/bin/phpmd ./src text cleancode --verbose;
77+
php vendor/bin/phpmd ./src text codesize --verbose;
78+
php vendor/bin/phpmd ./src text controversial --verbose;
79+
php vendor/bin/phpmd ./src text design --verbose;
80+
php vendor/bin/phpmd ./src text naming --verbose;
81+
php vendor/bin/phpmd ./src text unusedcode --verbose;
82+
fi;'
83+
84+
# Build pdepend stats
85+
- sh -c 'if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then
86+
php vendor/bin/pdepend
87+
--summary-xml=build/pdepend/summary.xml
88+
--jdepend-chart=build/pdepend/jdepend.svg
89+
--overview-pyramid=build/pdepend/pyramid.svg ./src;
90+
fi;'
91+
92+
notifications:
93+

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 JBZoo Content Construction Kit (CCK)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# JBZoo Utils [![Build Status](https://travis-ci.org/JBZoo/Utils.svg?branch=master)](https://travis-ci.org/JBZoo/Utils) [![Coverage Status](https://coveralls.io/repos/JBZoo/Utils/badge.svg?branch=master&service=github)](https://coveralls.io/github/JBZoo/Utils?branch=master)
2+
3+
#### PHP library description
4+
5+
[![License](https://poser.pugx.org/JBZoo/Utils/license)](https://packagist.org/packages/JBZoo/Utils)
6+
[![Latest Stable Version](https://poser.pugx.org/JBZoo/Utils/v/stable)](https://packagist.org/packages/JBZoo/Utils)
7+
8+
9+
### Example
10+
11+
```php
12+
require_once './vendor/autoload.php'; // composer autoload.php
13+
14+
// Get needed classes
15+
use JBZoo\Utils\Utils;
16+
17+
// Just use it!
18+
$object = new Utils();
19+
$object->doSomeMagic(':)');
20+
```
21+
22+
### License
23+
24+
MIT

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "jbzoo/utils",
3+
"type": "library",
4+
"description": "A collection of useful PHP functions, mini classes and snippets that you need or could use every day.",
5+
"license": "MIT",
6+
"minimum-stability": "dev",
7+
"keywords": ["php", "helpers", "helper", "utility", "utils", "collection"],
8+
"authors": [
9+
{
10+
"name": "SmetDenis",
11+
"email": "[email protected]",
12+
"role": "lead"
13+
}
14+
],
15+
"require": {
16+
"php": ">=5.3.10"
17+
},
18+
"require-dev": {
19+
"jbzoo/phpunit": "dev-master"
20+
},
21+
"autoload": {
22+
"psr-4": {
23+
"JBZoo\\Utils\\": "src"
24+
}
25+
},
26+
"support": {
27+
"issues": "https://github.com/JBZoo/Utils/issues"
28+
}
29+
}

demo.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* JBZoo Utils
4+
*
5+
* This file is part of the JBZoo CCK package.
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*
9+
* @package Utils
10+
* @license MIT
11+
* @copyright Copyright (C) JBZoo.com, All rights reserved.
12+
* @link https://github.com/JBZoo/Utils
13+
*/
14+
15+
namespace JBZoo\Utils;
16+
17+
18+
require_once __DIR__ . '/vendor/autoload.php';

phpunit.xml.dist

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpunit bootstrap="tests/autoload.php"
3+
colors="true"
4+
convertErrorsToExceptions="true"
5+
convertNoticesToExceptions="true"
6+
convertWarningsToExceptions="true"
7+
processIsolation="false"
8+
syntaxCheck="true"
9+
stopOnFailures="true"
10+
stopOnError="true"
11+
stopOnFailure="true"
12+
stopOnIncomplete="true"
13+
stopOnSkipped="false"
14+
verbose="true"
15+
>
16+
17+
<php>
18+
<env name="PACKAGE_NAME" value="Utils"/>
19+
</php>
20+
21+
<testsuites>
22+
<testsuite name="JBZoo Utils suite">
23+
<directory suffix="Test.php">./tests</directory>
24+
</testsuite>
25+
</testsuites>
26+
27+
<filter>
28+
<whitelist processUncoveredFilesFromWhitelist="true">
29+
<directory suffix=".php">src</directory>
30+
</whitelist>
31+
</filter>
32+
33+
<logging>
34+
<log type="coverage-clover" target="build/logs/clover.xml"/>
35+
<log type="coverage-html" target="build/phpunit" lowUpperBound="80" highLowerBound="95"/>
36+
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
37+
</logging>
38+
39+
</phpunit>

src/Exception.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* JBZoo Utils
4+
*
5+
* This file is part of the JBZoo CCK package.
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*
9+
* @package Utils
10+
* @license MIT
11+
* @copyright Copyright (C) JBZoo.com, All rights reserved.
12+
* @link https://github.com/JBZoo/Utils
13+
*/
14+
15+
namespace JBZoo\Utils;
16+
17+
/**
18+
* Class Exception
19+
* @package JBZoo\Utils
20+
*/
21+
class Exception extends \Exception
22+
{
23+
}

src/Package.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* JBZoo Utils
4+
*
5+
* This file is part of the JBZoo CCK package.
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*
9+
* @package Utils
10+
* @license MIT
11+
* @copyright Copyright (C) JBZoo.com, All rights reserved.
12+
* @link https://github.com/JBZoo/Utils
13+
*/
14+
15+
namespace JBZoo\Utils;
16+
17+
/**
18+
* Class Utils
19+
* @package JBZoo\Utils
20+
*/
21+
class Package
22+
{
23+
24+
/**
25+
* @return string
26+
*/
27+
public function doSomeStreetMagic()
28+
{
29+
return 'street magic';
30+
}
31+
}

0 commit comments

Comments
 (0)