-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
406 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "[BUG]" | ||
labels: bug | ||
assignees: glorand | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: enhancement | ||
assignees: glorand | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
composer.phar | ||
vendor/ | ||
/.idea | ||
.php_cs.cache | ||
composer.lock | ||
|
||
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file | ||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file | ||
# composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
build: | ||
nodes: | ||
analysis: | ||
tests: | ||
override: | ||
- php-scrutinizer-run | ||
- command: phpcs-run | ||
use_website_config: true | ||
- command: './vendor/bin/phpunit --coverage-clover=coverage.xml' | ||
coverage: | ||
file: coverage.xml | ||
format: clover | ||
filter: | ||
excluded_paths: | ||
- 'tests/*' | ||
checks: | ||
php: | ||
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 | ||
|
||
coding_style: | ||
php: | ||
spaces: | ||
around_operators: | ||
concatenation: true | ||
other: | ||
after_type_cast: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
preset: psr2 | ||
enabled: | ||
- phpdoc_annotation_without_dot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: php | ||
|
||
php: | ||
- 7.1 | ||
- 7.2 | ||
|
||
before_script: | ||
- composer selfupdate | ||
- composer install | ||
|
||
script: | ||
- vendor/bin/phpunit --coverage-clover=coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog | ||
|
||
All notable changes to `glorand/laravel-drip` will be documented in this file | ||
|
||
## 1.0.0 - 2018-12-27 | ||
### Added | ||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Contribution Guide | ||
|
||
This project adheres to the following standards and practices. | ||
|
||
## Versioning | ||
|
||
This package is versioned under the [Semantic Versioning](http://semver.org/) guidelines as much as possible. | ||
|
||
Releases will be numbered with the following format: | ||
|
||
`<major>.<minor>.<patch>` | ||
|
||
And constructed with the following guidelines: | ||
|
||
* Breaking backward compatibility bumps the major and resets the minor and patch. | ||
* New additions without breaking backward compatibility bumps the minor and resets the patch. | ||
* Bug fixes and misc changes bumps the patch. | ||
|
||
## Coding Standards | ||
|
||
This package is compliant with the | ||
[PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), | ||
[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and | ||
[PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). | ||
If you notice any compliance oversights, please send a patch via pull request. | ||
|
||
## Pull Requests | ||
|
||
The pull request process differs for new features and bugs. | ||
|
||
Pull requests for bugs may be sent without creating any proposal issue. | ||
If you believe that you know of a solution for a bug that has been filed, | ||
please leave a comment detailing your proposed fix or create a pull request with the fix mentioning that issue id. | ||
|
||
### Proposal \ Feature Requests | ||
|
||
If you have a proposal or a feature request, you may create an issue with `[Proposal]` in the title. | ||
|
||
The proposal should also describe the new feature, as well as implementation ideas. | ||
The proposal will then be reviewed and either approved or denied. Once a proposal is approved, | ||
a pull request may be created implementing the new feature. | ||
|
||
### Which Branch? | ||
|
||
**ALL** bug fixes should be made to the branch which they belong to. | ||
Bug fixes should never be sent to the `master` branch unless they fix features that exist only in the upcoming release. | ||
|
||
If a bug is found on a `minor` version `1.1` and it exists on the `major` version `1.0`, | ||
the bug fix should be sent to the `1.0` branch which will be afterwards merged into the `1.1` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) Gombos Lorand | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "glorand/laravel-drip", | ||
"description": "A Laravel wrapper for Drip's REST API v2.0", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Lorand Gombos", | ||
"email": "gombos.lorand@gmail.com" | ||
} | ||
], | ||
"type": "laravel-package", | ||
"keywords": [ | ||
"glorand", | ||
"laravel-drip", | ||
"drip", | ||
"drip-php", | ||
"drip-api" | ||
], | ||
"require": { | ||
"php": ">=7.1.3", | ||
"illuminate/support": "5.6.*|5.7.*", | ||
"glorand/drip-php": "^1.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^7.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Glorand\\Drip\\Laravel\\": "src/" | ||
}, | ||
"files": [ | ||
"src/helpers.php" | ||
] | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Glorand\\Drip\\Laravel\\Tests\\": "tests" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Glorand\\Drip\\Laravel\\DripServiceProvider" | ||
], | ||
"aliases": { | ||
"Drip": "Glorand\\Drip\\Laravel\\Facades\\Drip" | ||
} | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"scripts": { | ||
"stan": "vendor/bin/phpstan analyse src --level=7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
return [ | ||
'drip_account_id' => env('DRIP_ACCOUNT_ID'), | ||
'drip_api_key' => env('DRIP_API_KEY'), | ||
'drip_user_agent' => env('DRIP_USER_AGENT'), | ||
'enabled' => env('DRIP_ENABLED', false), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?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" | ||
> | ||
<testsuites> | ||
<testsuite name="Laravel Drip Test Suite"> | ||
<directory suffix="Test.php">./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src/</directory> | ||
</whitelist> | ||
</filter> | ||
<logging> | ||
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/> | ||
</logging> | ||
<php> | ||
|
||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Glorand\Drip\Laravel; | ||
|
||
use Glorand\Drip\Api\Accounts; | ||
use Glorand\Drip\Api\Events; | ||
use Glorand\Drip\Api\Subscribers; | ||
|
||
interface DripContract | ||
{ | ||
/** | ||
* @return \Glorand\Drip\Api\Events | ||
*/ | ||
public function events(): Events; | ||
|
||
/** | ||
* @return \Glorand\Drip\Api\Subscribers | ||
*/ | ||
public function subscribers(): Subscribers; | ||
|
||
/** | ||
* @return \Glorand\Drip\Api\Accounts | ||
*/ | ||
public function accounts(): Accounts; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Glorand\Drip\Laravel; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class DripFacade extends Facade | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'drip'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Glorand\Drip\Laravel; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class DripServiceProvider extends ServiceProvider | ||
{ | ||
protected $defer = true; | ||
|
||
public function register() | ||
{ | ||
$this->app->bind('drip', function ($app) { | ||
return new LaravelDrip( | ||
config('laravel_drip.drip_account_id'), | ||
config('laravel_drip.drip_api_key'), | ||
config('laravel_drip.drip_user_agent') | ||
); | ||
}); | ||
$this->app->alias('drip', \Glorand\Drip\Laravel\DripContract::class); | ||
} | ||
|
||
public function boot() | ||
{ | ||
$this->publishes([ | ||
__DIR__ . '/../config/laravel_drip.php' => config_path('laravel_drip.php'), | ||
]); | ||
|
||
$this->mergeConfigFrom(__DIR__.'/../config/laravel_drip.php', 'laravel_drip'); | ||
} | ||
|
||
public function provides() | ||
{ | ||
return [ | ||
\Glorand\Drip\Laravel\DripContract::class, | ||
'drip' | ||
]; | ||
} | ||
} |
Oops, something went wrong.