Skip to content

Commit

Permalink
Merge pull request #7 from djunehor/djunehor-patch-1
Browse files Browse the repository at this point in the history
Define php versions to run workflow
  • Loading branch information
djunehor authored Mar 4, 2021
2 parents a1b8718 + 09b8b4a commit 24fe1e0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: composer install -n --prefer-dist
- run: php -d memory_limit=-1 /usr/local/bin/composer install -n --prefer-dist

- save_cache:
key: v1-dependencies-{{ checksum "composer.json" }}
paths:
- ./vendor

# run tests with phpunit or codecept
- run: ./vendor/bin/phpunit --coverage-clover=coverage.clover
- run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover=coverage.clover
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- run: chmod +x ./cc-test-reporter
- run: sudo docker-php-ext-enable xdebug
- run: ./cc-test-reporter before-build
- run: sudo vendor/bin/phpunit --coverage-clover clover.xml
- run: sudo XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover clover.xml
- run: ./cc-test-reporter after-build --coverage-input-type clover --exit-code $?
13 changes: 11 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0']
steps:
- uses: actions/checkout@v1

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: intl #optional
- name: Check PHP Version
run: php -v
- name: Validate composer.json and composer.lock
run: composer validate

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@
Laravel SMS allows you to send SMS from your Laravel application using one of over 10 sms providers, or your own sms provider.

- [Laravel SMS](#laravel-sms)
- [Requirements](#requirements)
- [Installation](#installation)
- [Laravel 5.5 and above](#laravel-55-and-above)
- [Laravel 5.4 and older](#laravel-54-and-older)
- [Lumen](#lumen)
- [Env Keys](#env-keys)
- [Usage](#usage)
- [All parts of speech](#using-helper-function)
- [Using Helper Function](#using-helper-function)
- [Available SMS Providers](#available-sms-providers)
- [Creating custom SMS Provider](#creating-custom-sms-provider)
- [Contributing](#contributing)

## Requirements
- PHP >=7.1

## Installation

### Step 1
Expand Down Expand Up @@ -153,13 +157,15 @@ $send = send_sms($message, $to);
|XWireless|https://xwireless.net/cportal/knowledge-base/article/sms-3|No|
|InfoBip|https://dev.infobip.com/send-sms/single-sms-message|No|

> Note: For smartSmsSolutions, you have to whitelist the sender on the platform before using, else smartsms will automatically change your senderId when sending - https://github.com/djunehor/laravel-sms/issues/6
### Creating custom SMS Provider
- Create a class that extends `Djunehor\Sms\Concrete\Sms` class
- Implement the `send()` which makes the request and return bool
- (Optional) You can add the provider keys to the config/laravel-sms.php

## Contributing
- Fork this project
- Clone to your repo
- Clone your forked repo
- Make your changes and run tests `composer test`
- Push and create Pull request
- Push and create Pull Request
- Make sure your PR passes all checks
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
],
"minimum-stability": "dev",
"require": {
"php": "^7.0|~7.2|~7.4",
"guzzlehttp/guzzle": "^7.0.1"
"php": ">=7.1",
"guzzlehttp/guzzle": ">=6.5.x-dev"
},
"require-dev": {
"orchestra/testbench": "^3.8",
"phpunit/phpunit": "^7.0"
"orchestra/testbench": ">=3.5.x-dev",
"phpunit/phpunit": ">=6.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Concrete/BulkSmsNigeria.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function send($text = null): bool
],
]);

$response = json_decode($response->getBody()->getContents(), true);
$response = json_decode($response->getBody()->getContents(), true) ?? [];
$this->response = array_key_exists('error', $response) ? $response['error']['message'] : $response['data']['message'];

return $response['data']['status'] == 'success' ? true : false;
Expand Down

0 comments on commit 24fe1e0

Please sign in to comment.