Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtvbrianking committed Dec 28, 2019
0 parents commit 6c6a0fe
Show file tree
Hide file tree
Showing 18 changed files with 518 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 4
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/.sami.dist export-ignore
/.scrutinizer.yml export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/docs export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
composer.lock
coverage
coverage.clover
docs
sami.phar
vendor
.idea
.php_cs.cache
.phpunit.result.cache
.sami
62 changes: 62 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

// https://mlocati.github.io/php-cs-fixer-configurator/

$rules = [
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'no_trailing_comma_in_singleline_array' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'no_singleline_whitespace_before_semicolons' => true,
'blank_line_before_statement' => [
'statements' => ['return']
],
'concat_space' => [
'spacing' => 'none',
],
'no_short_echo_tag' => true,
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'no_useless_else' => true,
'ordered_imports' => [
'sortAlgorithm' => 'alpha',
],
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_indent' => true,
'phpdoc_no_package' => true,
'phpdoc_order' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_trim' => true,
'phpdoc_var_without_name' => true,
'phpdoc_to_comment' => true,
'phpdoc_summary' => true,
'single_quote' => true,
'single_line_comment_style' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
];

$excludes = [
'config',
'coverage',
'database',
'docs',
'tests',
'vendor',
];

return PhpCsFixer\Config::create()
->setRules($rules)
->setFinder(
PhpCsFixer\Finder::create()
->exclude($excludes)
->in(__DIR__.'/config')
->in(__DIR__.'/database')
->in(__DIR__.'/src')
->ignoreDotFiles(true)
->ignoreVCS(true)
);
36 changes: 36 additions & 0 deletions .sami.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use Sami\Sami;
use Symfony\Component\Finder\Finder;
use Sami\Version\GitVersionCollection;
use Sami\RemoteRepository\GitHubRemoteRepository;

$dir = __DIR__ . '/src';

$iterator = Finder::create()
->files()
->name('*.php')
->exclude('tests')
->exclude('vendor')
->in($dir);

$versions = GitVersionCollection::create($dir)
->add('master', 'master branch');

$repo = new GitHubRemoteRepository(
'mtvbrianking/laravel-api-filters',
dirname($dir),
'https://github.com/'
);

$options = [
'theme' => 'default',
'versions' => $versions,
'title' => 'Laravel API Filters',
'build_dir' => __DIR__ . '/docs',
'cache_dir' => __DIR__ . '/docs/cache',
'remote_repository' => $repo,
'default_opened_level' => 3,
];

return new Sami($iterator, $options);
28 changes: 28 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# https://scrutinizer-ci.com/docs/configuration/build_reference

checks:
php:
code_rating: true
duplication: true

filter:
excluded_paths:
- "docs/"
- "tests/"

build:
environment:
php:
version: '7.2'
requires:
- branch: master
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
-
command: 'vendor/bin/phpunit --coverage-clover=coverage.clover'
coverage:
file: 'coverage.clover'
format: 'clover'
18 changes: 18 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
preset: laravel

disabled:
- single_class_element_per_statement

# https://docs.styleci.io/standalone-php#risky
risky: false

finder:
exclude:
- "config"
- "coverage"
- "database"
- "docs"
- "tests"
- "vendor"
name:
- "*.php"
52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
language: php

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

# https://docs.travis-ci.com/user/build-stages

jobs:

include:

- stage: test

php: 7.2

before_script:
- travis_retry composer self-update
- travis_retry composer update --prefer-lowest --no-ansi --no-interaction --no-progress --no-scripts

script:
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

# - stage: deploy

# name: "Documentation"

# php: 7.2

# before_script:
# - git clone https://github.com/mtvbrianking/laravel-api-filters.git

# install:
# - curl -O http://get.sensiolabs.org/sami.phar

# script:
# - php sami.phar update .sami.dist

# # https://docs.travis-ci.com/user/deployment/pages/
# deploy:
# provider: pages
# skip-cleanup: true
# github-token: $GITHUB_TOKEN
# local_dir: docs
# on:
# branch: master

# https://docs.travis-ci.com/user/notifications
notifications:
email:
on_success: never
on_failure: always
58 changes: 58 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "bmatovu/laravel-package-boilerplate",
"description": "Laravel package boilerplate.",
"homepage": "https://github.com/mtvbrianking/laravel-package-boilerplate",
"type": "library",
"license": "MIT",
"keywords": [
"laravel",
"package",
"starter",
"boilerplate"
],
"authors": [
{
"name": "Brian Matovu",
"email": "mtvbrianking@gmail.com",
"homepage": "http://bmatovu.com",
"role": "Developer"
}
],
"require": {
"php": ">=7.2"
},
"require-dev": {
"orchestra/testbench": "^4.0",
"phpunit/phpunit": "^8.0"
},
"autoload": {
"psr-4": {
"Bmatovu\\HelloWorld\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Bmatovu\\HelloWorld\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"doc": "php sami.phar update .sami.dist",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Bmatovu\\HelloWorld\\HelloWorldServiceProvider"
],
"aliases": {
"HelloWorld": "Bmatovu\\HelloWorld\\HelloWorldFacade"
}
}
}
}
5 changes: 5 additions & 0 deletions config/hello-world.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
// ...
];
21 changes: 21 additions & 0 deletions license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) <Brian Matovu>

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.
29 changes: 29 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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="false">
<testsuites>
<testsuite name="Hello world Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="base64:0w8L41TeMgO/N6P3SOlZFn7QIQfsnS6cm6Gdm5nCCVI="/>

<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>

0 comments on commit 6c6a0fe

Please sign in to comment.