Skip to content

Commit 08e4f63

Browse files
author
Socola Đại Ca
committed
change template to spatie/package-skeleton-php
1 parent 235fd2e commit 08e4f63

31 files changed

+400
-168
lines changed

.editorconfig

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
; This file is for unifying the coding style for different editors and IDEs.
2-
; More information at http://editorconfig.org
3-
41
root = true
52

63
[*]
@@ -13,3 +10,6 @@ trim_trailing_whitespace = true
1310

1411
[*.md]
1512
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.gitattributes

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
/.gitignore export-ignore
77
/.travis.yml export-ignore
88
/phpunit.xml.dist export-ignore
9-
/.scrutinizer.yml export-ignore
109
/tests export-ignore
1110
/.editorconfig export-ignore
11+
/.php_cs export-ignore
12+
/.github export-ignore
13+
/psalm.xml export-ignore
14+
File renamed without changes.

.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: spatie
2+
custom: https://spatie.be/open-source/support-us

.github/ISSUE_TEMPLATE/config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a Question
4+
url: https://github.com/socoladaica/laravel-table-prefix/discussions/new?category=q-a
5+
about: Ask the community for help
6+
- name: Feature Request
7+
url: https://github.com/socoladaica/laravel-table-prefix/discussions/new?category=ideas
8+
about: Share ideas for new features
9+
- name: Bug Report
10+
url: https://github.com/socoladaica/laravel-table-prefix/issues/new
11+
about: Report a reproducable bug

.github/SECURITY.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Security Policy
2+
3+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.

.github/workflows/php-cs-fixer.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check & fix styling
2+
3+
on: [push]
4+
5+
jobs:
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
ref: ${{ github.head_ref }}
14+
15+
- name: Run PHP CS Fixer
16+
uses: docker://oskarstark/php-cs-fixer-ga
17+
with:
18+
args: --config=.php_cs.dist --allow-risky=yes
19+
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: Fix styling

.github/workflows/php.yml

-37
This file was deleted.

.github/workflows/psalm.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Psalm
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'psalm.xml.dist'
8+
9+
jobs:
10+
psalm:
11+
name: psalm
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '7.4'
20+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
21+
coverage: none
22+
23+
- name: Cache composer dependencies
24+
uses: actions/cache@v2
25+
with:
26+
path: vendor
27+
key: composer-${{ hashFiles('composer.lock') }}
28+
29+
- name: Run composer install
30+
run: composer install -n --prefer-dist
31+
32+
- name: Run psalm
33+
run: ./vendor/bin/psalm --output-format=github

.github/workflows/run-tests.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
os: [ubuntu-latest, windows-latest]
12+
php: [8.0, 7.4]
13+
stability: [prefer-lowest, prefer-stable]
14+
15+
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
26+
coverage: none
27+
28+
- name: Setup problem matchers
29+
run: |
30+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
31+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
32+
33+
- name: Install dependencies
34+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
35+
36+
- name: Execute tests
37+
run: vendor/bin/phpunit

.gitignore

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
.idea
2+
.php_cs
3+
.php_cs.cache
4+
.phpunit.result.cache
15
build
26
composer.lock
7+
coverage
38
docs
9+
phpunit.xml
10+
psalm.xml
411
vendor
5-
coverage
6-
.idea

.php_cs.dist

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->name('*.php')
9+
->notName('*.blade.php')
10+
->ignoreDotFiles(true)
11+
->ignoreVCS(true);
12+
13+
return PhpCsFixer\Config::create()
14+
->setRules([
15+
'@PSR2' => true,
16+
'array_syntax' => ['syntax' => 'short'],
17+
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
18+
'no_unused_imports' => true,
19+
'not_operator_with_successor_space' => true,
20+
'trailing_comma_in_multiline_array' => true,
21+
'phpdoc_scalar' => true,
22+
'unary_operator_spaces' => true,
23+
'binary_operator_spaces' => true,
24+
'blank_line_before_statement' => [
25+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
26+
],
27+
'phpdoc_single_line_var_spacing' => true,
28+
'phpdoc_var_without_name' => true,
29+
'class_attributes_separation' => [
30+
'elements' => [
31+
'method',
32+
],
33+
],
34+
'method_argument_space' => [
35+
'on_multiline' => 'ensure_fully_multiline',
36+
'keep_multiple_spaces_after_comma' => true,
37+
],
38+
'single_trait_insert_per_statement' => true,
39+
])
40+
->setFinder($finder);

.phpunit.result.cache

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
C:37:"PHPUnit\Runner\DefaultTestResultCache":196:{a:2:{s:7:"defects";a:1:{s:62:"SocolaDaiCa\LaravelTablePrefix\Tests\ExampleTest::true_is_true";i:4;}s:5:"times";a:1:{s:62:"SocolaDaiCa\LaravelTablePrefix\Tests\ExampleTest::true_is_true";d:0.108;}}}
1+
C:37:"PHPUnit\Runner\DefaultTestResultCache":272:{a:2:{s:7:"defects";a:1:{s:61:"Socoladaica\LaravelTablePrefix\Tests\SimpleTest::true_is_true";i:3;}s:5:"times";a:2:{s:62:"Socoladaica\LaravelTablePrefix\Tests\ExampleTest::true_is_true";d:0.003;s:61:"Socoladaica\LaravelTablePrefix\Tests\SimpleTest::true_is_true";d:0.012;}}}

.scrutinizer.yml

-19
This file was deleted.

.styleci.yml

-4
This file was deleted.

.travis.yml

-21
This file was deleted.

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
All notable changes to `laravel-table-prefix` will be documented in this file
44

5-
## 1.0.0 - 201X-XX-XX
5+
## 1.0.0 - 202X-XX-XX
66

77
- initial release

LICENSE.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) Socola Dai ca
3+
Copyright (c) Socola Dai Ca <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
copies of the Software, and to permit persons to whom the Software is
1010
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
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 THE
21-
SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Very short description of the package
1+
# Laravel Table Prefix
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/socoladaica/laravel-table-prefix.svg?style=flat-square)](https://packagist.org/packages/socoladaica/laravel-table-prefix)
4-
[![Build Status](https://img.shields.io/travis/socoladaica/laravel-table-prefix/master.svg?style=flat-square)](https://travis-ci.org/socoladaica/laravel-table-prefix)
5-
[![Quality Score](https://img.shields.io/scrutinizer/g/socoladaica/laravel-table-prefix.svg?style=flat-square)](https://scrutinizer-ci.com/g/socoladaica/laravel-table-prefix)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/socoladaica/laravel-table-prefix.svg?style=flat-square)](https://packagist.org/packages/socoladaica/laravel-table-prefix)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/Socoladaica/laravel-table-prefix.svg?style=flat-square)](https://packagist.org/packages/Socoladaica/laravel-table-prefix)
4+
[![Build Status](https://img.shields.io/travis/Socoladaica/laravel-table-prefix/master.svg?style=flat-square)](https://travis-ci.org/Socoladaica/laravel-table-prefix)
5+
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/Socoladaica/laravel-table-prefix/run-tests?label=tests)](https://github.com/Socoladaica/laravel-table-prefix/actions?query=workflow%3Arun-tests+branch%3Amaster)
6+
[![Quality Score](https://img.shields.io/scrutinizer/g/Socoladaica/laravel-table-prefix.svg?style=flat-square)](https://scrutinizer-ci.com/g/Socoladaica/laravel-table-prefix)
7+
[![Total Downloads](https://img.shields.io/packagist/dt/Socoladaica/laravel-table-prefix.svg?style=flat-square)](https://packagist.org/packages/Socoladaica/laravel-table-prefix)
78

89
Allows you to use a table prefix with standard Laravel models.
910

@@ -26,7 +27,7 @@ Using it inside a `Post` model would look like this:
2627
namespace App;
2728

2829
use Illuminate\Database\Eloquent\Model;
29-
use SocolaDaiCa\LaravelTablePrefix\HasTablePrefix;
30+
use Socoladaica\LaravelTablePrefix\HasTablePrefix;
3031

3132
class Post extends Model
3233
{
@@ -45,7 +46,7 @@ Using it inside a `CategoryPost` pilot would look like this:
4546
namespace App;
4647

4748
use Illuminate\Database\Eloquent\Relations\Pivot;
48-
use SocolaDaiCa\LaravelTablePrefix\HasTablePrefix;
49+
use Socoladaica\LaravelTablePrefix\HasTablePrefix;
4950

5051
class CategoryPost extends Pivot
5152
{
@@ -63,7 +64,7 @@ However, if someone were to use this approach and had many models with a prefix
6364

6465
namespace App;
6566

66-
use SocolaDaiCa\LaravelTablePrefix\HasTablePrefix;
67+
use Socoladaica\LaravelTablePrefix\HasTablePrefix;
6768

6869
trait BlogPrefix
6970
{
@@ -103,7 +104,7 @@ The final pivot might look something like this:
103104
namespace App;
104105

105106
use Illuminate\Database\Eloquent\Relations\Pivot;
106-
use SocolaDaiCa\LaravelTablePrefix\HasTablePrefix;
107+
use Socoladaica\LaravelTablePrefix\HasTablePrefix;
107108

108109
class CategoryPost extends Pivot
109110
{
@@ -166,17 +167,13 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
166167

167168
### Security
168169

169-
If you discover any security related issues, please email SocolaDaiCa@gmail.com instead of using the issue tracker.
170+
If you discover any security related issues, please email Socoladaica@gmail.com instead of using the issue tracker.
170171

171172
## Credits
172173

173-
- [Socola Dai ca](https://github.com/socoladaica)
174+
- [Socola Dai ca](https://github.com/Socoladaica)
174175
- [All Contributors](../../contributors)
175176

176177
## License
177178

178179
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
179-
180-
## Laravel Package Boilerplate
181-
182-
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

0 commit comments

Comments
 (0)