Skip to content

Commit 99a3af5

Browse files
authored
Merge pull request #1 from webkod3r/swivel-facade
Swivel facade
2 parents 8dcb233 + 8349a3e commit 99a3af5

File tree

17 files changed

+2185
-695
lines changed

17 files changed

+2185
-695
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
composer.phar
2+
vendor/

.travis.yml

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,8 @@
1-
dist: trusty
21
language: php
32

43
php:
5-
- 5.6
6-
- 7.0
7-
- 7.1
8-
- hhvm
9-
10-
# This triggers builds to run on the new TravisCI infrastructure.
11-
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
12-
sudo: false
13-
14-
## Cache composer
15-
cache:
16-
directories:
17-
- $HOME/.composer/cache
18-
19-
matrix:
20-
include:
21-
- php: 5.6
22-
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
4+
- 5.6
5+
- 7.0
236

247
before_script:
25-
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist
26-
27-
script:
28-
- vendor/bin/phpcs --standard=psr2 src/
29-
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
30-
31-
after_script:
32-
- |
33-
if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' && "$TRAVIS_PHP_VERSION" != '7.0' ]]; then
34-
wget https://scrutinizer-ci.com/ocular.phar
35-
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
36-
fi
8+
- composer install --prefer-dist --no-interaction --no-suggest --optimize-autoloader

README.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# :package_name
1+
# Laravel Swivel
22

33
[![Latest Version on Packagist][ico-version]][link-packagist]
44
[![Software License][ico-license]](LICENSE.md)
@@ -7,37 +7,43 @@
77
[![Quality Score][ico-code-quality]][link-code-quality]
88
[![Total Downloads][ico-downloads]][link-downloads]
99

10-
**Note:** Replace ```:author_name``` ```:author_username``` ```:author_website``` ```:author_email``` ```:vendor``` ```:package_name``` ```:package_description``` with their correct values in [README.md](README.md), [CHANGELOG.md](CHANGELOG.md), [CONTRIBUTING.md](CONTRIBUTING.md), [LICENSE.md](LICENSE.md) and [composer.json](composer.json) files, then delete this line. You can run `$ php prefill.php` in the command line to make all replacements at once. Delete the file prefill.php as well.
10+
[Zumba Swivel](https://github.com/zumba/swivel) is a library that allows PHP
11+
applications to manage features to multiple users via buckets. It consists
12+
with 10 buckets, allowing the same code have up to 10 different behaviors.
1113

12-
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what
13-
PSRs you support to avoid any confusion with users and contributors.
14+
This package is a bridge between Laravel/Lumen and Swivel. It provides a Facade,
15+
and Entity classes to be used in your Laravel application.
1416

1517
## Structure
1618

17-
If any of the following are applicable to your project, then the directory structure should follow industry best practises by being named the following.
18-
19-
```
20-
bin/
21-
config/
22-
src/
23-
tests/
24-
vendor/
25-
```
26-
19+
If you want to make a contribution, please make sure you follow Laravel package
20+
structure.
2721

2822
## Install
2923

3024
Via Composer
3125

3226
``` bash
33-
$ composer require :vendor/:package_name
27+
$ composer require webkod3r/laravel-swivel
3428
```
3529

30+
After installing the package you can copy the default configuration and replace
31+
it with your own. In order to do that copy the file inside
32+
`vendor/webkod3r/laravel-swivel/config/swivel.php` into your onw project.
33+
3634
## Usage
3735

36+
Calling the app IoC and making your own instance
37+
3838
``` php
39-
$skeleton = new League\Skeleton();
40-
echo $skeleton->echoPhrase('Hello, League!');
39+
$swivel = app()->make('swivel');
40+
$swivel->returnValue('CoolFeature', 'Active', 'No Active');
41+
```
42+
43+
or, using the shipped `Facade`
44+
45+
``` php
46+
LaravelSwivel\Facades\Swivel::returnValue('CoolFeature', 'Active', 'No Active');
4147
```
4248

4349
## Change log
@@ -56,28 +62,22 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT
5662

5763
## Security
5864

59-
If you discover any security related issues, please email :author_email instead of using the issue tracker.
60-
61-
## Credits
62-
63-
- [:author_name][link-author]
64-
- [All Contributors][link-contributors]
65+
If you discover any security related issues, please notify and open an issue.
6566

6667
## License
6768

6869
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
6970

70-
[ico-version]: https://img.shields.io/packagist/v/:vendor/:package_name.svg?style=flat-square
71+
[ico-version]: https://img.shields.io/packagist/v/webkod3r/laravel-swivel.svg?style=flat-square
7172
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
72-
[ico-travis]: https://img.shields.io/travis/:vendor/:package_name/master.svg?style=flat-square
73-
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/:vendor/:package_name.svg?style=flat-square
74-
[ico-code-quality]: https://img.shields.io/scrutinizer/g/:vendor/:package_name.svg?style=flat-square
75-
[ico-downloads]: https://img.shields.io/packagist/dt/:vendor/:package_name.svg?style=flat-square
76-
77-
[link-packagist]: https://packagist.org/packages/:vendor/:package_name
78-
[link-travis]: https://travis-ci.org/:vendor/:package_name
79-
[link-scrutinizer]: https://scrutinizer-ci.com/g/:vendor/:package_name/code-structure
80-
[link-code-quality]: https://scrutinizer-ci.com/g/:vendor/:package_name
81-
[link-downloads]: https://packagist.org/packages/:vendor/:package_name
82-
[link-author]: https://github.com/:author_username
83-
[link-contributors]: ../../contributors
73+
[ico-travis]: https://img.shields.io/travis/webkod3r/laravel-swivel/master.svg?style=flat-square
74+
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/webkod3r/laravel-swivel.svg?style=flat-square
75+
[ico-code-quality]: https://img.shields.io/scrutinizer/g/webkod3r/laravel-swivel.svg?style=flat-square
76+
[ico-downloads]: https://img.shields.io/packagist/dt/webkod3r/laravel-swivel.svg?style=flat-square
77+
78+
[link-packagist]: https://packagist.org/packages/webkod3r/laravel-swivel
79+
[link-travis]: https://travis-ci.org/webkod3r/laravel-swivel
80+
[link-scrutinizer]: https://scrutinizer-ci.com/g/webkod3r/laravel-swivel/code-structure
81+
[link-code-quality]: https://scrutinizer-ci.com/g/webkod3r/laravel-swivel
82+
[link-downloads]: https://packagist.org/packages/webkod3r/laravel-swivel
83+
[link-author]: https://github.com/webkod3r

composer.json

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,48 @@
1818
}
1919
],
2020
"require": {
21-
"php" : "~5.6|~7.0",
22-
"illuminate/support": "~5.0",
23-
"illuminate/http": "~5.0",
21+
"php": "~5.6|~7.0.0",
22+
"illuminate/container": "~5.4",
23+
"illuminate/http": "~5.4",
24+
"illuminate/support": "~5.4",
25+
"psr/log": "^1.0",
2426
"zumba/swivel": "^2.1"
2527
},
2628
"require-dev": {
29+
"mockery/mockery": "^1.2",
30+
"orchestra/testbench": "~3.4.0",
2731
"phpunit/phpunit": "~5.0",
28-
"mockery/mockery": "dev-master"
32+
"squizlabs/php_codesniffer": "^3.4"
2933
},
3034
"autoload": {
3135
"psr-4": {
32-
"Webkod3r\\LaravelSwivel\\": "src"
36+
"LaravelSwivel\\": "src"
3337
}
3438
},
3539
"autoload-dev": {
3640
"psr-4": {
37-
"Tests\\Webkod3r\\LaravelSwivel\\": "tests"
41+
"Tests\\LaravelSwivel\\": "tests"
3842
}
3943
},
4044
"scripts": {
41-
"test": "phpunit"
45+
"test": "./vendor/bin/phpunit",
46+
"post-autoload-dump": [
47+
"bash ./extras/setup.sh"
48+
]
4249
},
4350
"extra": {
4451
"branch-alias": {
4552
"dev-master": "1.0-dev"
53+
},
54+
"laravel": {
55+
"providers": [
56+
"LaravelSwivel\\LaravelSwivelServiceProvider"
57+
]
4658
}
4759
},
4860
"config": {
61+
"optimize-autoloader": true,
4962
"sort-packages": true
5063
},
51-
"minimum-stability": "stable"
64+
"minimum-stability": "dev"
5265
}

0 commit comments

Comments
 (0)