Navigation Menu

Skip to content

Commit

Permalink
aligning package structure with standards
Browse files Browse the repository at this point in the history
  • Loading branch information
nateiler committed Jun 14, 2017
1 parent be6bec0 commit 5f796a5
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 19 deletions.
13 changes: 6 additions & 7 deletions .gitignore
@@ -1,7 +1,6 @@
*.idea/*
*.log
*.DS_Store
*Thumbs.db
tests/_output/*
vendor/
/composer.lock
/build
/vendor
composer.phar
composer.lock
.DS_Store
.idea
35 changes: 35 additions & 0 deletions .scrutinizer.yml
@@ -0,0 +1,35 @@
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: 2
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]
23 changes: 23 additions & 0 deletions .travis.yml
@@ -0,0 +1,23 @@
language: php

sudo: false

php:
- 7.0
- 7.1

## Cache composer
cache:
directories:
- $HOME/.composer/cache

before_script:
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist

script:
- vendor/bin/phpcs --standard=psr2 src/
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,42 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/flipbox/postmark).


## 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 and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow SemVer. Randomly breaking public APIs is not an option.

- **Create topic 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 before submitting.

- **Ensure tests pass!** - Please run the tests (see below) before submitting your pull request, and make sure they pass. We won't accept a patch until all tests pass.

- **Ensure no coding standards violations** - Please run PHP Code Sniffer using the PSR-2 standard (see below) before submitting your pull request. A violation will cause the build to fail, so please make sure there are no violations. We can't accept a patch if the build fails.


## Running Tests

``` bash
$ ./vendor/bin/phpunit
```


## Running PHP Code Sniffer

``` bash
$ ./vendor/bin/phpcs src --standard=psr2 -sp
```

**Happy coding**!
11 changes: 7 additions & 4 deletions README.md
@@ -1,7 +1,10 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/flipbox/postmark/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/flipbox/postmark/?branch=master)

Postmark for Craft CMS
=====================
# Postmark for Craft CMS
[![Latest Version](https://img.shields.io/github/release/flipbox/link.svg?style=flat-square)](https://github.com/flipbox/postmark/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/flipbox/postmark/master.svg?style=flat-square)](https://travis-ci.org/flipbox/postmark)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/flipbox/postmark.svg?style=flat-square)](https://scrutinizer-ci.com/g/flipbox/postmark/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/flipbox/postmark.svg?style=flat-square)](https://scrutinizer-ci.com/g/flipbox/postmark)
[![Total Downloads](https://img.shields.io/packagist/dt/flipboxdigital/postmark.svg?style=flat-square)](https://packagist.org/packages/flipboxdigital/postmark)

This plugin provides a [Postmark](http://www.postmarkapp.com/) integration for [Craft CMS](https://craftcms.com/).

Expand Down
38 changes: 30 additions & 8 deletions composer.json
Expand Up @@ -2,20 +2,30 @@
"name": "flipboxdigital/postmark",
"description": "Postmark adapter",
"version": "1.0.2",
"type": "craft-plugin",
"minimum-stability": "beta",
"prefer-stable": true,
"config": {
"optimize-autoloader": true
},
"require": {
"craftcms/cms": "~3.0.0-beta",
"wildbit/swiftmailer-postmark": "^2.1"
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"require-dev": {
"phpunit/phpunit": "^5.0",
"squizlabs/php_codesniffer": "^2.0"
},
"autoload": {
"psr-4": {
"flipbox\\postmark\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"flipbox\\postmark\\tests\\": "tests/src/"
}
},
"extra": {
"name": "Postmark",
"handle": "postmark",
Expand All @@ -24,6 +34,18 @@
"changelogUrl": "https://raw.githubusercontent.com/flipbox/postmark/master/CHANGELOG.md",
"downloadUrl": "https://github.com/flipbox/postmark/archive/master.zip",
"class": "flipbox\\postmark\\Postmark",
"schemaVersion": "1.0.0"
}
"schemaVersion": "1.0.0",
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
}
43 changes: 43 additions & 0 deletions phpunit.xml
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<logging>
<log type="tap"
target="./build/report.tap"/>
<log type="junit"
target="./build/report.junit.xml"/>
<log type="coverage-html"
target="./build/coverage/html"
charset="UTF-8"
highlight="false"
lowUpperBound="35"
highLowerBound="70"/>
<log type="coverage-text"
target="./build/coverage.txt"/>
<log type="coverage-clover"
target="./build/coverage/log/coverage.xml"/>
</logging>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./</directory>
<exclude>
<directory suffix=".php">./vendor</directory>
<directory suffix=".php">./tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

0 comments on commit 5f796a5

Please sign in to comment.