Skip to content

Commit 89c7c22

Browse files
committed
Initial commit
0 parents  commit 89c7c22

File tree

11 files changed

+281
-0
lines changed

11 files changed

+281
-0
lines changed

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml export-ignore
9+
/.scrutinizer.yml export-ignore
10+
/tests export-ignore

.gitignore

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

.scrutinizer.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
filter:
2+
excluded_paths: [tests/*]
3+
checks:
4+
php:
5+
code_rating: true
6+
remove_extra_empty_lines: true
7+
remove_php_closing_tag: true
8+
remove_trailing_whitespace: true
9+
fix_use_statements:
10+
remove_unused: true
11+
preserve_multiple: false
12+
preserve_blanklines: true
13+
order_alphabetically: true
14+
fix_php_opening_tag: true
15+
fix_linefeed: true
16+
fix_line_ending: true
17+
fix_identation_4spaces: true
18+
fix_doc_comments: true
19+
tools:
20+
external_code_coverage:
21+
timeout: 600
22+
runs: 2
23+
php_analyzer: true
24+
php_code_coverage: false
25+
php_code_sniffer:
26+
config:
27+
standard: PSR2
28+
filter:
29+
paths: ['src']
30+
php_loc:
31+
enabled: true
32+
excluded_dirs: [vendor, tests]
33+
php_cpd:
34+
enabled: true
35+
excluded_dirs: [vendor, tests]

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
language: php
2+
3+
php:
4+
- 5.5
5+
- 5.6
6+
- 7.0
7+
- hhvm
8+
9+
matrix:
10+
allow_failures:
11+
- php: 7.0
12+
13+
before_script:
14+
- travis_retry composer self-update
15+
- travis_retry composer install --prefer-source --no-interaction
16+
17+
script:
18+
- if [ "$TRAVIS_PHP_VERSION" == "7.0" ] || [ "$TRAVIS_PHP_VERSION" == "hhvm" ]; then phpunit; fi
19+
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ] && [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpunit --coverage-text --coverage-clover=coverage.clover; fi
20+
21+
after_script:
22+
- wget https://scrutinizer-ci.com/ocular.phar
23+
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ] && [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
24+
25+
notifications:
26+
email:
27+
on_success: never
28+
on_failure: change

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changelog
2+
3+
All Notable changes to `laravel-api-response` will be documented in this file
4+
5+
## NEXT - YYYY-MM-DD
6+
7+
### Added
8+
- Nothing
9+
10+
### Deprecated
11+
- Nothing
12+
13+
### Fixed
14+
- Nothing
15+
16+
### Removed
17+
- Nothing
18+
19+
### Security
20+
- Nothing

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2015 Patrick Samson <[email protected]>
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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# laravel-api-response
2+
3+
[![Latest Version on Packagist][ico-version]][link-packagist]
4+
[![Software License][ico-license]](LICENSE.md)
5+
[![Build Status][ico-travis]][link-travis]
6+
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
7+
[![Quality Score][ico-code-quality]][link-code-quality]
8+
[![Total Downloads][ico-downloads]][link-downloads]
9+
10+
A Laravel wrapper for thephpleague's Fractal package
11+
12+
## Install
13+
14+
Via Composer
15+
16+
``` bash
17+
composer require lykegenes/laravel-api-response
18+
```
19+
20+
## Usage
21+
22+
``` php
23+
$skeleton = new Lykegenes\ApiResponse();
24+
echo $skeleton->echoPhrase('Hello, Lykegenes!');
25+
```
26+
27+
## Testing
28+
29+
``` bash
30+
composer test
31+
```
32+
33+
## Credits
34+
35+
- [Patrick Samson][link-author]
36+
- [All Contributors][link-contributors]
37+
38+
## License
39+
40+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
41+
42+
[ico-version]: https://img.shields.io/packagist/v/lykegenes/laravel-api-response.svg?style=flat-square
43+
[ico-license]: https://img.shields.io/packagist/l/lykegenes/laravel-api-response.svg?style=flat-square
44+
[ico-travis]: https://img.shields.io/travis/Lykegenes/laravel-api-response/master.svg?style=flat-square
45+
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/lykegenes/laravel-api-response.svg?style=flat-square
46+
[ico-code-quality]: https://img.shields.io/scrutinizer/g/lykegenes/laravel-api-response.svg?style=flat-square
47+
[ico-downloads]: https://img.shields.io/packagist/dt/lykegenes/laravel-api-response.svg?style=flat-square
48+
49+
[link-packagist]: https://packagist.org/packages/lykegenes/laravel-api-response
50+
[link-travis]: https://travis-ci.org/lykegenes/laravel-api-response
51+
[link-scrutinizer]: https://scrutinizer-ci.com/g/lykegenes/laravel-api-response/code-structure
52+
[link-code-quality]: https://scrutinizer-ci.com/g/lykegenes/laravel-api-response
53+
[link-downloads]: https://packagist.org/packages/lykegenes/laravel-api-response
54+
[link-author]: https://github.com/lykegenes
55+
[link-contributors]: ../../contributors

composer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "lykegenes/laravel-api-response",
3+
"description": "A Laravel wrapper for thephpleague's Fractal package",
4+
"keywords": [
5+
"lykegenes",
6+
"laravel-api-response",
7+
"fractal",
8+
"laravel",
9+
"api"
10+
],
11+
"homepage": "https://github.com/lykegenes/laravel-api-response",
12+
"license": "MIT",
13+
"authors": [
14+
{
15+
"name": "Patrick Samson",
16+
"email": "[email protected]",
17+
"homepage": "https://github.com/lykegenes",
18+
"role": "Developer"
19+
}
20+
],
21+
"require": {
22+
"illuminate/support": "~5.1",
23+
"illuminate/http": "~5.1",
24+
"illuminate/database": "~5.1",
25+
"league/fractal": "^0.12.0",
26+
"sofa/eloquence": "~5.1"
27+
},
28+
"require-dev": {
29+
"phpunit/phpunit" : "4.*"
30+
},
31+
"autoload": {
32+
"psr-4": {
33+
"Lykegenes\\ApiResponse\\": "src"
34+
}
35+
},
36+
"autoload-dev": {
37+
"psr-4": {
38+
"Lykegenes\\ApiResponse\\Test\\": "tests"
39+
}
40+
},
41+
"scripts": {
42+
"test": "phpunit"
43+
},
44+
"extra": {
45+
"branch-alias": {
46+
"dev-master": "1.0-dev"
47+
}
48+
}
49+
}

phpunit.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
syntaxCheck="false"
12+
>
13+
<testsuites>
14+
<testsuite name="Lykegenes Test Suite">
15+
<directory>tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
<filter>
19+
<whitelist addUncoveredFilesFromWhitelist="false">
20+
<directory suffix=".php">src/</directory>
21+
</whitelist>
22+
</filter>
23+
</phpunit>

src/SkeletonClass.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
namespace Lykegenes\ApiResponse;
3+
4+
class ApiResponseClass
5+
{
6+
/**
7+
* Create a new ApiResponse Instance
8+
*/
9+
public function __construct()
10+
{
11+
// constructor body
12+
}
13+
14+
/**
15+
* Friendly welcome
16+
*
17+
* @param string $phrase Phrase to return
18+
*
19+
* @return string Returns the phrase passed in
20+
*/
21+
public function echoPhrase($phrase)
22+
{
23+
return $phrase;
24+
}
25+
}

0 commit comments

Comments
 (0)