Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #82 from loopline-systems/develop
Browse files Browse the repository at this point in the history
refs #79: release 0.7
  • Loading branch information
mavimo authored Aug 16, 2018
2 parents a41f25a + 460407b commit 5e0aa3a
Show file tree
Hide file tree
Showing 70 changed files with 2,203 additions and 574 deletions.
4 changes: 3 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
src_dir: src
service_name: travis-ci
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Bug report
about: Before reporting an issue please check that you are using the latest close.io
api wrapper version!

---

### Summary

<!-- Please describe your problem here. -->

### Code snippet that reproduces the problem

<!-- Indicate how to reproduce the issue you are, if possible include a self contained snippet used to reproduce it -->


### More infos

<!-- Please indicate all extra info needed to solve this issue -->
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Feature request
about: Suggest an idea for this project

---

### Summary

<!-- Please describe your feature request here. -->

### More infos

<!-- Please indicate all extra info needed to introduce this feature -->
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
config/
!config/config.sample.yml
vendor/
tests/LooplineSystems/CloseIoApi/Api/LiveApiTest.php
tests/build/logs/
build/
/composer.lock
30 changes: 22 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
language: php

php:
- 5.6
- 5.6
- 7.1
- 7.2
- master

env:
- dependencies=lowest
- dependencies=highest

matrix:
allow_failures:
- php: master
env: dependencies=lowest
- php: master
env: dependencies=highest

before_script:
- /home/travis/.phpenv/versions/`phpenv version-name`/bin/composer self-update
- php composer.phar install --dev --no-interaction
- composer self-update
- if [ "$dependencies" = "lowest" ]; then composer update --no-interaction --prefer-lowest; fi;
- if [ "$dependencies" = "highest" ]; then composer update --no-interaction; fi;

script:
- mkdir -p build/logs
- phpunit --configuration tests/phpunit.xml --coverage-clover build/logs/clover.xml
- vendor/bin/phpunit
- if [ "$TRAVIS_PHP_VERSION" != "5.6" ] && [ "$dependencies" = "highest" ]; then composer require --dev phpstan/phpstan; fi;
- if [ "$TRAVIS_PHP_VERSION" != "5.6" ] && [ "$dependencies" = "highest" ]; then php vendor/bin/phpstan analyze --level=4 src tests; fi;

after_script:
- php vendor/bin/coveralls
- CODECLIMATE_REPO_TOKEN="1236a1650f2cb22f334ec37e96e7e022d11cbf1a8e604a99fc59a3501810fdc6" vendor/bin/test-reporter --stdout > codeclimate.json
- "curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v0.1.1)' https://codeclimate.com/test_reports"
- php vendor/bin/php-coveralls -v
48 changes: 31 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ PHP Wrapper to use the Close.io API
[![License](https://img.shields.io/packagist/l/loopline-systems/closeio-api-wrapper.svg)](http://opensource.org/licenses/MIT)
[![Build Status](http://img.shields.io/travis/loopline-systems/closeio-api-wrapper.svg)](https://travis-ci.org/loopline-systems/closeio-api-wrapper)
[![Coverage Status](https://img.shields.io/coveralls/loopline-systems/closeio-api-wrapper.svg)](https://coveralls.io/r/loopline-systems/closeio-api-wrapper?branch=master)
[![Code Climate](https://codeclimate.com/github/loopline-systems/closeio-api-wrapper/badges/gpa.svg)](https://codeclimate.com/github/loopline-systems/closeio-api-wrapper)

[![Packagist](http://img.shields.io/packagist/v/loopline-systems/closeio-api-wrapper.svg)](https://packagist.org/packages/loopline-systems/closeio-api-wrapper)
[![Packagist](http://img.shields.io/packagist/dt/loopline-systems/closeio-api-wrapper.svg)](https://packagist.org/packages/loopline-systems/closeio-api-wrapper)
Expand Down Expand Up @@ -83,6 +82,36 @@ $opportunityApi = $this->apiWrapper->getOpportunityApi();
$result = $opportunityApi->addOpportunity($opportunity);
```

Activities
----------

```php
$activityApi = $this->apiWrapper->getActivityApi();
```

```php
// SMS
$sms = new SmsActivity();
$sms->setLocalPhone('12345');
$sms->setRemotePhone('23456');
$sms->setText('first sms');
$sms->setStatus(SmsActivity::STATUS_SCHEDULED);

$activityApi->addSms($sms);
```

```php
// EMails
$email = new EmailActivity();
$email->setStatus(EmailActivity::STATUS_INBOX);
$email->setSubject('RE: Support');
$email->setSender('Support <support@nowhere.net>');
$email->setTo('Customer <customer@nowhere.net>');

$activityApi->addEmail($sms);

```

Updating custom fields
----------------------
```php
Expand All @@ -94,21 +123,6 @@ $customFieldApi = $this->apiWrapper->getCustomFieldApi();
$result = $customFieldApi->updateCustomField($customField);
```

Console runner
-
For testing purposes there is a simple console runner.

```
bin/console -a <api name> -r <request name> -k <api key> [-d payload as json]
```
Examples:
```
bin/console -k your_api_key -r getAllLeads -a LeadApi
bin/console -k your_api_key -r addLead -a LeadApi -d '{...}'
```
The is output will be displayed on the console as json.

Info
------------
Right now just a few request are implemented, because the main need was to create leads.
Expand All @@ -126,7 +140,7 @@ Authors

Michael Devery - <[email protected]><br />
Marco Roßdeutscher - <[email protected]><br />
Marco Roßdeutscher - <[email protected]><br />
Marc Zahn - <[email protected]><br />

See also the list of [contributors](https://github.com/loopline-systems/closeio-api-wrapper/contributors) who participated in this project.

Expand Down
84 changes: 0 additions & 84 deletions bin/console

This file was deleted.

17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@
"require": {
"php": ">=5.6.0",
"ext-curl": "*",
"symfony/yaml": "^2.5",
"zendframework/zend-filter": "^2.3.3",
"doctrine/inflector": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^5.0.0",
"codeclimate/php-test-reporter": "^0.1.2",
"symfony/console": "^3.1"
"phpunit/phpunit": "^5.7.10",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
"psr-0": {
"LooplineSystems\\CloseIoApiWrapper\\": "src",
"LooplineSystems\\CloseIoApiWrapper\\Tests\\": "test"
"psr-4": {
"LooplineSystems\\CloseIoApiWrapper\\": "src/LooplineSystems/CloseIoApiWrapper"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\LooplineSystems\\CloseIoApiWrapper\\": "tests/LooplineSystems/CloseIoApiWrapper"
}
}
}
Binary file removed composer.phar
Binary file not shown.
6 changes: 3 additions & 3 deletions tests/phpunit.xml → phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<phpunit backupGlobals="true" bootstrap="./bootstrap.php">
<phpunit backupGlobals="true" bootstrap="./vendor/autoload.php">
<filter>
<whitelist>
<directory>/src</directory>
<directory>./src</directory>
</whitelist>
</filter>
<testsuites>
<testsuite name="Close.io Api Wrapper Tests">
<directory>./</directory>
<directory>./tests</directory>
</testsuite>
</testsuites>
<logging>
Expand Down
Loading

0 comments on commit 5e0aa3a

Please sign in to comment.