Skip to content

Commit 04aa91e

Browse files
committed
Scaffold the package
0 parents  commit 04aa91e

File tree

9 files changed

+300
-0
lines changed

9 files changed

+300
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/composer.lock
2+
/vendor
3+
/.idea
4+
/.php_cs.cache
5+
/.phpunit.result.cache
6+
/phpunit.xml

.php_cs

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->notPath('config')
5+
->notPath('vendor')
6+
->in(__DIR__)
7+
->name('*.php')
8+
->notName('*.blade.php')
9+
->ignoreDotFiles(true)
10+
->ignoreVCS(true);
11+
12+
return PhpCsFixer\Config::create()
13+
->setRules(
14+
[
15+
'psr0' => false,
16+
'@PSR2' => true,
17+
'align_multiline_comment' => true,
18+
'array_indentation' => true,
19+
'array_syntax' => [
20+
'syntax' => 'short',
21+
],
22+
'blank_line_after_opening_tag' => true,
23+
'blank_line_before_statement' => [
24+
'statements' => [
25+
'break',
26+
'case',
27+
'continue',
28+
'for',
29+
'foreach',
30+
'if',
31+
'return',
32+
'switch',
33+
'throw',
34+
'try',
35+
'while',
36+
],
37+
],
38+
'braces' => true,
39+
'cast_spaces' => [
40+
'space' => 'single',
41+
],
42+
'class_definition' => true,
43+
'combine_consecutive_issets' => true,
44+
'combine_consecutive_unsets' => true,
45+
'compact_nullable_typehint' => true,
46+
'concat_space' => [
47+
'spacing' => 'one',
48+
],
49+
'dir_constant' => true,
50+
'function_to_constant' => true,
51+
'function_typehint_space' => true,
52+
'increment_style' => [
53+
'style' => 'post',
54+
],
55+
'is_null' => true,
56+
'linebreak_after_opening_tag' => true,
57+
'logical_operators' => true,
58+
'lowercase_cast' => true,
59+
'lowercase_static_reference' => true,
60+
'magic_constant_casing' => true,
61+
'method_argument_space' => [
62+
'on_multiline' => 'ensure_fully_multiline',
63+
],
64+
'method_chaining_indentation' => true,
65+
'modernize_types_casting' => true,
66+
'native_constant_invocation' => true,
67+
'native_function_casing' => true,
68+
'native_function_invocation' => true,
69+
'new_with_braces' => true,
70+
'no_alias_functions' => true,
71+
'no_blank_lines_after_class_opening' => true,
72+
'no_blank_lines_after_phpdoc' => true,
73+
'no_empty_phpdoc' => true,
74+
'no_empty_statement' => true,
75+
'no_extra_blank_lines' => true,
76+
'no_leading_import_slash' => true,
77+
'no_mixed_echo_print' => true,
78+
'no_multiline_whitespace_around_double_arrow' => true,
79+
'no_null_property_initialization' => true,
80+
'no_short_bool_cast' => true,
81+
'no_short_echo_tag' => true,
82+
'no_spaces_after_function_name' => true,
83+
'no_spaces_inside_parenthesis' => true,
84+
'no_superfluous_elseif' => true,
85+
'no_trailing_comma_in_singleline_array' => true,
86+
'no_trailing_whitespace' => true,
87+
'no_trailing_whitespace_in_comment' => true,
88+
'no_unneeded_control_parentheses' => true,
89+
'no_unused_imports' => true,
90+
'no_useless_else' => true,
91+
'no_useless_return' => true,
92+
'no_whitespace_before_comma_in_array' => true,
93+
'ordered_imports' => true,
94+
'phpdoc_align' => true,
95+
'phpdoc_scalar' => true,
96+
'protected_to_private' => true,
97+
'return_type_declaration' => true,
98+
'set_type_to_cast' => true,
99+
'simplified_null_return' => true,
100+
'single_blank_line_at_eof' => true,
101+
'single_class_element_per_statement' => [
102+
'elements' => ['property'],
103+
],
104+
'single_import_per_statement' => true,
105+
'single_line_after_imports' => true,
106+
'switch_case_semicolon_to_colon' => true,
107+
'switch_case_space' => true,
108+
'ternary_to_null_coalescing' => true,
109+
'trailing_comma_in_multiline_array' => true,
110+
'visibility_required' => [
111+
'elements' => ['property', 'method', 'const'],
112+
],
113+
'yoda_style' => false,
114+
]
115+
)
116+
->setRiskyAllowed(true)
117+
->setFinder($finder);

.travis.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
dist: xenial
2+
language: php
3+
sudo: false
4+
5+
env:
6+
global:
7+
- COMPOSER_FLAGS="--prefer-stable"
8+
9+
matrix:
10+
include:
11+
- php: 7.2
12+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" LARAVEL_VERSION="^6.0"
13+
- php: 7.3
14+
env: LARAVEL_VERSION="^6.0"
15+
- php: 7.3
16+
env: LARAVEL_VERSION="^7.0"
17+
- php: 7.4
18+
# This empty flag removes the prefer-stable switch to cause dev dependencies to be installed
19+
env: COMPOSER_FLAGS="" LARAVEL_VERSION="^7.0"
20+
- php: 7.4
21+
env: LARAVEL_VERSION="^7.0"
22+
- php: nightly
23+
env: LARAVEL_VERSION="^7.0"
24+
allow_failures:
25+
- php: nightly
26+
env: LARAVEL_VERSION="^7.0"
27+
28+
cache:
29+
directories:
30+
- $HOME/.composer/cache
31+
32+
before_install:
33+
- phpenv config-rm xdebug.ini || true
34+
- travis_retry composer self-update
35+
36+
before_script:
37+
- travis_retry composer require --no-update laravel/framework:${LARAVEL_VERSION}
38+
- travis_retry composer update $COMPOSER_FLAGS
39+
40+
script:
41+
- vendor/bin/phpunit

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Michael Babker
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Twilio SDK Integration for Laravel [![Build Status](https://travis-ci.com/BabDev/laravel-twilio.svg?branch=master)](https://travis-ci.com/BabDev/laravel-twilio)
2+
3+
Laravel package integrating the Twilio SDK into your Laravel application.
4+
5+
## Installation
6+
7+
To install this package, run the following [Composer](https://getcomposer.org/) command:
8+
9+
```sh
10+
composer require babdev/laravel-twilio
11+
```
12+
13+
If your application is not using package discovery, you will need to add the service provider to your `config/app.php` file:
14+
15+
```sh
16+
BabDev\Twilio\Providers\TwilioProvider::class,
17+
```

composer.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "babdev/laravel-twilio",
3+
"license": "MIT",
4+
"description": "Twilio SDK integration for Laravel",
5+
"keywords": ["laravel", "twilio"],
6+
"require": {
7+
"php": "^7.2",
8+
"illuminate/support": "^6.0|^7.0",
9+
"twilio/sdk": "^6.0"
10+
},
11+
"require-dev": {
12+
"friendsofphp/php-cs-fixer": "^2.16.1",
13+
"laravel/framework": "^6.0|^7.0",
14+
"orchestra/testbench": "^4.0|^5.0",
15+
"phpunit/phpunit": "^8.0|^9.0"
16+
},
17+
"autoload": {
18+
"psr-4": {
19+
"BabDev\\Twilio\\": "src/"
20+
}
21+
},
22+
"autoload-dev": {
23+
"psr-4": {
24+
"BabDev\\Twilio\\Tests\\": "tests/"
25+
}
26+
},
27+
"minimum-stability": "dev",
28+
"prefer-stable": true,
29+
"config": {
30+
"sort-packages": true
31+
},
32+
"extra": {
33+
"laravel": {
34+
"providers": [
35+
"BabDev\\Twilio\\Providers\\TwilioProvider"
36+
]
37+
}
38+
}
39+
}

phpunit.xml.dist

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
verbose="true"
12+
>
13+
14+
<testsuites>
15+
<testsuite name="Test Suite">
16+
<directory suffix="Test.php">./tests/</directory>
17+
</testsuite>
18+
</testsuites>
19+
20+
<filter>
21+
<whitelist addUncoveredFilesFromWhitelist="false">
22+
<directory suffix=".php">src/</directory>
23+
</whitelist>
24+
</filter>
25+
</phpunit>

src/Providers/TwilioProvider.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace BabDev\Twilio\Providers;
4+
5+
use Illuminate\Support\ServiceProvider;
6+
7+
final class TwilioProvider extends ServiceProvider
8+
{
9+
/**
10+
* Register any application services.
11+
*
12+
* @return void
13+
*/
14+
public function register(): void
15+
{
16+
}
17+
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace BabDev\Twilio\Tests\Providers;
4+
5+
use BabDev\Twilio\Providers\TwilioProvider;
6+
use Illuminate\Container\Container;
7+
use PHPUnit\Framework\TestCase;
8+
9+
final class TwilioProviderTest extends TestCase
10+
{
11+
public function testServiceIsRegistered(): void
12+
{
13+
$container = new Container();
14+
15+
(new TwilioProvider($container))->register();
16+
}
17+
}

0 commit comments

Comments
 (0)