Skip to content

Commit 56096bd

Browse files
Merge pull request #1 from larapulse/feature/project_structure
Project structure and basic functions
2 parents 52f3dcb + ae06b44 commit 56096bd

26 files changed

+1168
-23
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.dist export-ignore
9+
/.scrutinizer.yml export-ignore
10+
/tests export-ignore
11+
/docs export-ignore

.gitignore

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

.scrutinizer.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
filter:
2+
excluded_paths: [tests/*]
3+
4+
checks:
5+
php:
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+
20+
tools:
21+
external_code_coverage:
22+
timeout: 600
23+
runs: 3

.styleci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
preset: psr2

.travis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
dist: trusty
2+
language: php
3+
4+
php:
5+
- 7.0
6+
- 7.1
7+
- 7.2
8+
- nightly
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+
before_script:
20+
- travis_retry composer update --no-interaction --prefer-dist
21+
22+
script:
23+
- vendor/bin/phpcs --standard=psr2 src/
24+
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
25+
26+
after_script:
27+
- |
28+
if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' && "$TRAVIS_PHP_VERSION" != '7.0' ]]; then
29+
wget https://scrutinizer-ci.com/ocular.phar
30+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
31+
fi

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

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) 2017 Sergey Podgornyy <[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: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,91 @@
1-
# support
2-
Package with helper functions
1+
# PHP Support functions
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+
PHP package with helper functions.
11+
12+
## Structure
13+
14+
If any of the following are applicable to your project, then the directory structure should follow industry best practises by being named the following.
15+
16+
```
17+
bin/
18+
config/
19+
src/
20+
tests/
21+
vendor/
22+
```
23+
24+
25+
## Install
26+
27+
Via Composer
28+
29+
``` bash
30+
$ composer require larapulse/support
31+
```
32+
33+
## Usage
34+
35+
This package contains some useful functions that can be used for different cases, such as:
36+
37+
``` php
38+
$initial = [
39+
'environment' => 'dev',
40+
'app_start' => date('Y-m-d H:i:s'),
41+
'options' => [
42+
'test' => true,
43+
'debug' => true,
44+
'log' => 'notice'.
45+
],
46+
];
47+
48+
$hash = md5(implode('|', array_flatten_assoc($initial)));
49+
```
50+
51+
## Change log
52+
53+
Please see [CHANGELOG](docs/CHANGELOG.md) for more information on what has changed recently.
54+
55+
## Testing
56+
57+
``` bash
58+
$ composer test
59+
```
60+
61+
## Contributing
62+
63+
Please see [CONTRIBUTING](docs/CONTRIBUTING.md) and [CODE_OF_CONDUCT](docs/CODE_OF_CONDUCT.md) for details.
64+
65+
## Security
66+
67+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
68+
69+
## Credits
70+
71+
- [Sergey Podgornyy][link-author]
72+
- [All Contributors][link-contributors]
73+
74+
## License
75+
76+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
77+
78+
[ico-version]: https://img.shields.io/packagist/v/larapulse/support.svg?style=flat-square
79+
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
80+
[ico-travis]: https://img.shields.io/travis/larapulse/support/master.svg?style=flat-square
81+
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/larapulse/support.svg?style=flat-square
82+
[ico-code-quality]: https://img.shields.io/scrutinizer/g/larapulse/support.svg?style=flat-square
83+
[ico-downloads]: https://img.shields.io/packagist/dt/larapulse/support.svg?style=flat-square
84+
85+
[link-packagist]: https://packagist.org/packages/larapulse/support
86+
[link-travis]: https://travis-ci.org/larapulse/support
87+
[link-scrutinizer]: https://scrutinizer-ci.com/g/larapulse/support/code-structure
88+
[link-code-quality]: https://scrutinizer-ci.com/g/larapulse/support
89+
[link-downloads]: https://packagist.org/packages/larapulse/support
90+
[link-author]: https://github.com/SergeyPodgornyy
91+
[link-contributors]: ../../contributors

composer.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "larapulse/support",
3+
"type": "library",
4+
"description": "Handy PHP functions",
5+
"keywords": [
6+
"larapulse",
7+
"support"
8+
],
9+
"homepage": "https://github.com/larapulse/support",
10+
"license": "MIT",
11+
"support": {
12+
"issues": "https://github.com/larapulse/support/issues",
13+
"source": "https://github.com/larapulse/support"
14+
},
15+
"authors": [
16+
{
17+
"name": "Sergey Podgornyy",
18+
"email": "[email protected]",
19+
"homepage": "http://larapulse.com",
20+
"role": "Developer"
21+
}
22+
],
23+
"require": {
24+
"php": "~7.0",
25+
"illuminate/support": "^5.5"
26+
},
27+
"require-dev": {
28+
"phpunit/phpunit" : "~6.3",
29+
"squizlabs/php_codesniffer": "^2.3"
30+
},
31+
"autoload": {
32+
"psr-4": {
33+
"Larapulse\\Support\\": "src"
34+
},
35+
"files": [
36+
"src/array_functions.php",
37+
"src/string_functions.php"
38+
]
39+
},
40+
"autoload-dev": {
41+
"psr-4": {
42+
"Larapulse\\Support\\": "tests"
43+
}
44+
},
45+
"scripts": {
46+
"test": "phpunit",
47+
"check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
48+
"fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests"
49+
},
50+
"extra": {
51+
"branch-alias": {
52+
"dev-master": "1.0-dev"
53+
}
54+
},
55+
"config": {
56+
"sort-packages": true
57+
}
58+
}

0 commit comments

Comments
 (0)