Skip to content

Commit

Permalink
Scaffold the package
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker committed Mar 4, 2020
0 parents commit 04aa91e
Show file tree
Hide file tree
Showing 9 changed files with 300 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/composer.lock
/vendor
/.idea
/.php_cs.cache
/.phpunit.result.cache
/phpunit.xml
117 changes: 117 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?php

$finder = PhpCsFixer\Finder::create()
->notPath('config')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return PhpCsFixer\Config::create()
->setRules(
[
'psr0' => false,
'@PSR2' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short',
],
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => [
'break',
'case',
'continue',
'for',
'foreach',
'if',
'return',
'switch',
'throw',
'try',
'while',
],
],
'braces' => true,
'cast_spaces' => [
'space' => 'single',
],
'class_definition' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'concat_space' => [
'spacing' => 'one',
],
'dir_constant' => true,
'function_to_constant' => true,
'function_typehint_space' => true,
'increment_style' => [
'style' => 'post',
],
'is_null' => true,
'linebreak_after_opening_tag' => true,
'logical_operators' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'method_chaining_indentation' => true,
'modernize_types_casting' => true,
'native_constant_invocation' => true,
'native_function_casing' => true,
'native_function_invocation' => true,
'new_with_braces' => true,
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_mixed_echo_print' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_null_property_initialization' => true,
'no_short_bool_cast' => true,
'no_short_echo_tag' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_superfluous_elseif' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'ordered_imports' => true,
'phpdoc_align' => true,
'phpdoc_scalar' => true,
'protected_to_private' => true,
'return_type_declaration' => true,
'set_type_to_cast' => true,
'simplified_null_return' => true,
'single_blank_line_at_eof' => true,
'single_class_element_per_statement' => [
'elements' => ['property'],
],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'visibility_required' => [
'elements' => ['property', 'method', 'const'],
],
'yoda_style' => false,
]
)
->setRiskyAllowed(true)
->setFinder($finder);
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
dist: xenial
language: php
sudo: false

env:
global:
- COMPOSER_FLAGS="--prefer-stable"

matrix:
include:
- php: 7.2
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" LARAVEL_VERSION="^6.0"
- php: 7.3
env: LARAVEL_VERSION="^6.0"
- php: 7.3
env: LARAVEL_VERSION="^7.0"
- php: 7.4
# This empty flag removes the prefer-stable switch to cause dev dependencies to be installed
env: COMPOSER_FLAGS="" LARAVEL_VERSION="^7.0"
- php: 7.4
env: LARAVEL_VERSION="^7.0"
- php: nightly
env: LARAVEL_VERSION="^7.0"
allow_failures:
- php: nightly
env: LARAVEL_VERSION="^7.0"

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

before_install:
- phpenv config-rm xdebug.ini || true
- travis_retry composer self-update

before_script:
- travis_retry composer require --no-update laravel/framework:${LARAVEL_VERSION}
- travis_retry composer update $COMPOSER_FLAGS

script:
- vendor/bin/phpunit
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Michael Babker

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.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Twilio SDK Integration for Laravel [![Build Status](https://travis-ci.com/BabDev/laravel-twilio.svg?branch=master)](https://travis-ci.com/BabDev/laravel-twilio)

Laravel package integrating the Twilio SDK into your Laravel application.

## Installation

To install this package, run the following [Composer](https://getcomposer.org/) command:

```sh
composer require babdev/laravel-twilio
```

If your application is not using package discovery, you will need to add the service provider to your `config/app.php` file:

```sh
BabDev\Twilio\Providers\TwilioProvider::class,
```
39 changes: 39 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "babdev/laravel-twilio",
"license": "MIT",
"description": "Twilio SDK integration for Laravel",
"keywords": ["laravel", "twilio"],
"require": {
"php": "^7.2",
"illuminate/support": "^6.0|^7.0",
"twilio/sdk": "^6.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16.1",
"laravel/framework": "^6.0|^7.0",
"orchestra/testbench": "^4.0|^5.0",
"phpunit/phpunit": "^8.0|^9.0"
},
"autoload": {
"psr-4": {
"BabDev\\Twilio\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"BabDev\\Twilio\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"BabDev\\Twilio\\Providers\\TwilioProvider"
]
}
}
}
25 changes: 25 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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"
verbose="true"
>

<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="false">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
17 changes: 17 additions & 0 deletions src/Providers/TwilioProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace BabDev\Twilio\Providers;

use Illuminate\Support\ServiceProvider;

final class TwilioProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register(): void
{
}
}
17 changes: 17 additions & 0 deletions tests/Providers/TwilioProviderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace BabDev\Twilio\Tests\Providers;

use BabDev\Twilio\Providers\TwilioProvider;
use Illuminate\Container\Container;
use PHPUnit\Framework\TestCase;

final class TwilioProviderTest extends TestCase
{
public function testServiceIsRegistered(): void
{
$container = new Container();

(new TwilioProvider($container))->register();
}
}

0 comments on commit 04aa91e

Please sign in to comment.