From 547ed65526c0003568bd245ddbfa9c2f6b71acda Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Thu, 8 Sep 2016 17:30:51 +1000 Subject: [PATCH] Create package scaffolding --- .editorconfig | 15 ++++++++ .gitattributes | 12 +++++++ .gitignore | 4 +++ .scrutinizer.yml | 38 +++++++++++++++++++++ .styleci.yml | 1 + .travis.yml | 30 ++++++++++++++++ CHANGELOG.md | 22 ++++++++++++ CONDUCT.md | 22 ++++++++++++ CONTRIBUTING.md | 32 +++++++++++++++++ LICENSE.md | 21 ++++++++++++ README.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ composer.json | 46 +++++++++++++++++++++++++ phpspec.yml | 12 +++++++ src/.gitkeep | 0 tests/.gitkeep | 0 15 files changed, 344 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .scrutinizer.yml create mode 100644 .styleci.yml create mode 100644 .travis.yml create mode 100644 CHANGELOG.md create mode 100644 CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 composer.json create mode 100644 phpspec.yml create mode 100644 src/.gitkeep create mode 100644 tests/.gitkeep diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..cd8eb86 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_size = 4 +indent_style = space +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..76e1406 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +# Path-based git attributes +# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html + +# Ignore all test and documentation with "export-ignore". +/.gitattributes export-ignore +/.gitignore export-ignore +/.styleci.yml export-ignore +/.travis.yml export-ignore +/phpspec.yml export-ignore +/.scrutinizer.yml export-ignore +/tests export-ignore +/src/.gitkeep export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f02a2f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build +composer.lock +docs +vendor diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..a45c82d --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,38 @@ +filter: + excluded_paths: [tests/*] + +checks: + php: + code_rating: true + duplication: 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: 300 + runs: 3 + php_analyzer: true + 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] diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 0000000..247a09c --- /dev/null +++ b/.styleci.yml @@ -0,0 +1 @@ +preset: psr2 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..46da716 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: php + +php: + - 5.5 + - 5.6 + - 7.0 + - hhvm + +# This triggers builds to run on the new TravisCI infrastructure. +# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +sudo: false + +matrix: + allow_failures: + - php: hhvm + include: + - php: 5.5 + env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"' + +before_script: + - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'xdebug.enable = On' >> /etc/hhvm/php.ini; fi + - travis_retry composer self-update + - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source + +script: + - vendor/bin/phpcs --standard=psr2 src/ + - vendor/bin/phpspec run -vvv + +after_script: + - if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b6f8fb7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All Notable changes to `cloak` will be documented in this file. + +Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. + +## NEXT - YYYY-MM-DD + +### Added +- Nothing + +### Deprecated +- Nothing + +### Fixed +- Nothing + +### Removed +- Nothing + +### Security +- Nothing diff --git a/CONDUCT.md b/CONDUCT.md new file mode 100644 index 0000000..6ff94ca --- /dev/null +++ b/CONDUCT.md @@ -0,0 +1,22 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..53b302e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing + +Contributions are **welcome** and will be fully **credited**. + +We accept contributions via Pull Requests on [Github](https://github.com/cerbero90/Cloak). + + +## Pull Requests + +- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). + +- **Add tests!** - Your patch won't be accepted if it doesn't have tests. + +- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. + +- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. + +- **Create feature branches** - Don't ask us to pull from your master branch. + +- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. + +- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. + + +## Running Tests + +``` bash +$ composer test +``` + + +**Happy coding**! diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..95901cd --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) + +Copyright (c) 2016 Andrea Marco Sartori + +> 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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..508534a --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +# Cloak + +[![Author][ico-author]][link-author] +[![Latest Version on Packagist][ico-version]][link-packagist] +[![Software License][ico-license]](LICENSE.md) +[![Quality Score][ico-code-quality]][link-code-quality] +[![StyleCI][ico-styleci]][link-styleci] +[![Total Downloads][ico-downloads]][link-downloads] +[![Gratipay][ico-gratipay]][link-gratipay] + +[![SensioLabsInsight][ico-sensiolabs]][link-sensiolabs] + +**Note:** Enable the following services for the current package: + +- [Packagist](https://packagist.org/packages/submit) +- [TravisCI](https://travis-ci.org/profile/cerbero90) +- [ScrutinizerCI](https://scrutinizer-ci.com/g/new) +- [StyleCI](https://styleci.io/account) +- [SensioLabs Insight](https://insight.sensiolabs.com/projects/new) + +**Note:** Now that StyleCI and SensioLabs are enabled, replace their placeholders with the actual values in this file: + +- ```:styleci_repo``` +- ```:sensiolabs_project``` + +**Note:** Delete all the above notes, including this one. + +This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what +PSRs you support to avoid any confusion with users and contributors. + +## Install + +Via Composer + +``` bash +composer require cerbero/cloak +``` + +## Usage + +``` php +$skeleton = new League\Skeleton(); +echo $skeleton->echoPhrase('Hello, League!'); +``` + +## Change log + +Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. + +## Testing + +``` bash +composer test +``` + +## Contributing + +Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. + +## Security + +If you discover any security related issues, please email andrea.marco.sartori@gmail.com instead of using the issue tracker. + +## Credits + +- [Andrea Marco Sartori][link-author] +- [All Contributors][link-contributors] + +## License + +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. + +[ico-author]: http://img.shields.io/badge/author-@cerbero90-blue.svg?style=flat-square +[ico-version]: https://img.shields.io/packagist/v/cerbero/Cloak.svg?style=flat-square +[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square +[ico-code-quality]: https://img.shields.io/scrutinizer/g/cerbero90/cloak.svg?style=flat-square +[ico-styleci]: https://styleci.io/repos/:styleci_repo/shield +[ico-downloads]: https://img.shields.io/packagist/dt/cerbero/Cloak.svg?style=flat-square +[ico-gratipay]: https://img.shields.io/gratipay/cerbero.svg?style=flat-square +[ico-sensiolabs]: https://insight.sensiolabs.com/projects/:sensiolabs_project/big.png + +[link-author]: https://twitter.com/cerbero90 +[link-packagist]: https://packagist.org/packages/cerbero/cloak +[link-code-quality]: https://scrutinizer-ci.com/g/cerbero90/cloak +[link-styleci]: https://styleci.io/repos/:styleci_repo +[link-downloads]: https://packagist.org/packages/cerbero/cloak +[link-gratipay]: https://gratipay.com/cerbero +[link-sensiolabs]: https://insight.sensiolabs.com/projects/:sensiolabs_project +[link-contributors]: ../../contributors diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..18c08e7 --- /dev/null +++ b/composer.json @@ -0,0 +1,46 @@ +{ + "name": "cerbero/cloak", + "type": "library", + "description": "Encrypted communication between two systems.", + "keywords": [ + "encryption", + "communication" + ], + "homepage": "https://github.com/cerbero90/cloak", + "license": "MIT", + "authors": [ + { + "name": "Andrea Marco Sartori", + "email": "andrea.marco.sartori@gmail.com", + "homepage": "https://github.com/cerbero90", + "role": "Developer" + } + ], + "require": { + "php" : "~5.5|~7.0" + }, + "require-dev": { + "phpspec/phpspec" : "^2.5", + "henrikbjorn/phpspec-code-coverage" : "^2.0", + "scrutinizer/ocular": "^1.1", + "squizlabs/php_codesniffer": "^2.3" + }, + "autoload": { + "psr-4": { + "Cerbero\\Cloak\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Cerbero\\Cloak\\": "tests" + } + }, + "scripts": { + "test": "phpspec run -vvv" + }, + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + } +} diff --git a/phpspec.yml b/phpspec.yml new file mode 100644 index 0000000..0c9d4cb --- /dev/null +++ b/phpspec.yml @@ -0,0 +1,12 @@ +suites: + main: + spec_path: tests + namespace: Cerbero\Cloak + psr4_prefix: Cerbero\Cloak +extensions: + - PhpSpec\Extension\CodeCoverageExtension +code_coverage: + format: + - clover + output: + clover: coverage.clover diff --git a/src/.gitkeep b/src/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/.gitkeep b/tests/.gitkeep new file mode 100644 index 0000000..e69de29