Merge pull request #3 from nyamsprod/master

update skeleton project
This commit is contained in:
Phil Sturgeon 2014-10-07 13:34:13 -05:00
commit ed20ae272b
10 changed files with 107 additions and 59 deletions

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
vendor build
composer.lock composer.lock
docs docs
vendor

View file

@ -8,11 +8,12 @@ php:
- hhvm - hhvm
before_script: before_script:
- composer self-update - travis_retry composer self-update
- composer install - travis_retry composer install --no-interaction --prefer-source --dev
- pyrus install pear/PHP_CodeSniffer
- phpenv rehash
script: script:
- phpcs --standard=psr2 src/ - phpunit --coverage-text --coverage-clover=coverage.clover
- phpunit --coverage-text
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

19
CHANGELOG.md Normal file
View file

@ -0,0 +1,19 @@
#Changelog
All Notable changes to `:package_name` will be documented in this file
## NEXT - YYYY-MM-DD
### Added
- Nothing
### Deprecated
- Nothing
### Fixed
- Nothing
### Remove
- Nothing
### Security
- Nothing

View file

@ -1,14 +1,16 @@
# League Skeleton # League Skeleton
[![Build Status](https://travis-ci.org/thephpleague/statsd.png?branch=master)](https://travis-ci.org/thephpleague/statsd) [![Latest Version](https://img.shields.io/github/release/thephpleague/skeleton.svg?style=flat-square)](https://github.com/thephpleague/skeleton/releases)
[![Total Downloads](https://poser.pugx.org/league/statsd/downloads.png)](https://packagist.org/packages/league/statsd) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Latest Stable Version](https://poser.pugx.org/league/statsd/v/stable.png)](https://packagist.org/packages/league/statsd) [![Build Status](https://img.shields.io/travis/thephpleague/skeleton/master.svg?style=flat-square)](https://travis-ci.org/thephpleague/skeleton)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/thephpleague/skeleton.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/skeleton/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/thephpleague/skeleton.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/skeleton)
[![Total Downloads](https://img.shields.io/packagist/dt/league/skeleton.svg?style=flat-square)](https://packagist.org/packages/league/skeleton)
**Replace Skeleton with your own package name in the above URLs** **Replace Skeleton with your own package name in the above URLs**
:package_description :package_description
## Install ## Install
Via Composer Via Composer
@ -21,7 +23,6 @@ Via Composer
} }
``` ```
## Usage ## Usage
``` php ``` php
@ -30,25 +31,21 @@ echo $skeleton->echoPhrase('Hello, League!');
``` ```
## Testing ## Testing
``` bash ``` bash
$ phpunit $ phpunit
``` ```
## Contributing ## Contributing
Please see [CONTRIBUTING](https://github.com/thephpleague/:package_name/blob/master/CONTRIBUTING.md) for details. Please see [CONTRIBUTING](https://github.com/thephpleague/:package_name/blob/master/CONTRIBUTING.md) for details.
## Credits ## Credits
- [:author_name](https://github.com/:author_username) - [:author_name](https://github.com/:author_username)
- [All Contributors](https://github.com/thephpleague/:package_name/contributors) - [All Contributors](https://github.com/thephpleague/:package_name/contributors)
## License ## License
The MIT License (MIT). Please see [License File](https://github.com/thephpleague/:package_name/blob/master/LICENSE) for more information. The MIT License (MIT). Please see [License File](https://github.com/thephpleague/:package_name/blob/master/LICENSE) for more information.

View file

@ -10,18 +10,30 @@
"authors": [ "authors": [
{ {
"name": ":author_name", "name": ":author_name",
"email": ":author_email", "email": "author_email@example.com",
"homepage": ":author_website", "homepage": "http://author-website.example.com",
"role": "Developer" "role": "Developer"
} }
], ],
"require-dev": { "require-dev": {
"silex/silex": "~1.0" "php" : ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit" : "4.*"
}, },
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"League": ["src", "tests"], "League\\Skeleton\\": "src"
"Silex\\Provider": "src" }
},
"autoload-dev": {
"psr-4": {
"League\\Skeleton\\Test\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
} }
} }
} }

View file

@ -1,14 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"> <phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites> <testsuites>
<testsuite name="League Test Suite"> <testsuite name="League Test Suite">
<directory>tests/League</directory> <directory>tests</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <filter>
<whitelist> <whitelist>
<directory suffix=".php">src/Silex</directory> <directory suffix=".php">src/</directory>
<directory suffix=".php">src/League</directory>
</whitelist> </whitelist>
</filter> </filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit> </phpunit>

34
scrutinizer.yml Normal file
View file

@ -0,0 +1,34 @@
filter:
excluded_paths: [tests/*]
checks:
php:
code_rating: true
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true
tools:
external_code_coverage:
timeout: 600
runs: 3
php_code_coverage: false
php_code_sniffer:
config:
standard: PSR2
filter:
paths: ['src']
php_loc:
enabled: true
excluded_dirs: [vendor, tests]
php_cpd:
enabled: true
excluded_dirs: [vendor, tests]

View file

@ -1,32 +0,0 @@
<?php
namespace Silex\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
/**
* Service provider for Silex
*/
class SkeletonServiceProvider implements ServiceProviderInterface
{
/**
* Register Service Provider
* @param Application $app Silex application instance
*/
public function register(Application $app)
{
}
/**
* Boot Method
* @param Application $app Silex application instance
* @codeCoverageIgnore
*/
public function boot(Application $app)
{
}
}

View file

@ -12,10 +12,11 @@ class SkeletonClass
{ {
} }
/** /**
* Friendly welcome * Friendly welcome
*
* @param string $phrase Phrase to return * @param string $phrase Phrase to return
*
* @return string Returns the phrase passed in * @return string Returns the phrase passed in
*/ */
public function echoPhrase($phrase) public function echoPhrase($phrase)