Skip to content

Commit 3b851e8

Browse files
committed
Initial commit
0 parents  commit 3b851e8

16 files changed

+380
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
indent_style = space
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.gitattributes

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
/.github export-ignore
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/tests export-ignore
10+
/.editorconfig export-ignore
11+
/.php_cs.dist export-ignore
12+
/psalm.xml export-ignore
13+
/psalm.xml.dist export-ignore
14+
/testbench.yaml export-ignore

.github/workflows/php_cs_fixer.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHP CS Fixer
2+
3+
on: [push, pull_request]
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: "style: fix styling"

.github/workflows/phpunit.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: PHPUnit
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
php: [8.0]
12+
laravel: [6.*, 7.*, 8.*]
13+
stability: [prefer-lowest, prefer-stable]
14+
include:
15+
- laravel: 6.*
16+
testbench: 4.*
17+
- laravel: 7.*
18+
testbench: 5.*
19+
- laravel: 8.*
20+
testbench: 6.*
21+
22+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php }}
32+
extensions: fileinfo, pdo
33+
coverage: xdebug
34+
35+
- name: Setup problem matchers
36+
run: |
37+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
38+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
39+
40+
- name: Install dependencies
41+
run: |
42+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
43+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
44+
45+
- name: Execute tests
46+
run: vendor/bin/phpunit

.github/workflows/psalm.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Psalm
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
psalm:
7+
name: psalm
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.0'
16+
extensions: fileinfo, pdo
17+
coverage: none
18+
19+
- name: Cache composer dependencies
20+
uses: actions/cache@v2
21+
with:
22+
path: vendor
23+
key: composer-${{ hashFiles('composer.lock') }}
24+
25+
- name: Run composer install
26+
run: composer install -n --prefer-dist
27+
28+
- name: Run psalm
29+
run: ./vendor/bin/psalm --output-format=github

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.idea
2+
.php_cs
3+
.php_cs.cache
4+
.phpunit.result.cache
5+
build
6+
composer.lock
7+
coverage
8+
docs
9+
phpunit.xml
10+
psalm.xml
11+
testbench.yaml
12+
vendor

.php_cs.dist

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->name('*.php')
9+
->ignoreDotFiles(true)
10+
->ignoreVCS(true);
11+
12+
return PhpCsFixer\Config::create()
13+
->setRules([
14+
'@PHP80Migration:risky' => true,
15+
'@Symfony:risky' => true,
16+
'@Symfony' => true,
17+
'ordered_class_elements' => [
18+
'order' => [
19+
'use_trait',
20+
'constant_public',
21+
'constant_protected',
22+
'constant_private',
23+
'property_public',
24+
'property_protected',
25+
'property_private',
26+
'construct',
27+
'destruct',
28+
'magic',
29+
'phpunit',
30+
'method_public',
31+
'method_protected',
32+
'method_private',
33+
],
34+
'sort_algorithm' => 'alpha',
35+
],
36+
])
37+
->setFinder($finder);

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) tpetry <tobias@tpetry.me>
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

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Laravel PostgreSQL Enhanced
2+
3+
![GitHub License](https://img.shields.io/github/license/tpetry/laravel-postgresql-enhanced?label=License)
4+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/tpetry/laravel-postgresql-enhanced.svg?label=Packagist)](https://packagist.org/packages/tpetry/laravel-postgresql-enhanced)
5+
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/tpetry/laravel-postgresql-enhanced/run-tests?label=Tests)](https://github.com/tpetry/laravel_postgresql_enhanced/actions?query=workflow%3ATests+branch%3Amaster)
6+
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/tpetry/laravel-postgresql-enhanced/Check%20&%20fix%20styling?label=Code%20Style)](https://github.com/tpetry/laravel_postgresql_enhanced/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amaster)
7+
8+
The standard Laravel PostgreSQL driver is extended with many missing PostgreSQL functionalities.
9+
10+
## Installation
11+
12+
You can install the package via composer:
13+
14+
```bash
15+
composer require tpetry/laravel_postgresql_enhanced
16+
```
17+
18+
## Usage
19+
20+
TODO
21+
22+
## Changelog
23+
24+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
25+
26+
## Security Vulnerabilities
27+
28+
If you discover any security related issues, please email github@tpetry.me instead of using the issue tracker.
29+
30+
## License
31+
32+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "tpetry/laravel-postgresql-enhanced",
3+
"description": "Support for many missing PostgreSQL specific features",
4+
"keywords": [
5+
"laravel",
6+
"postgresql"
7+
],
8+
"homepage": "https://github.com/tpetry/laravel-postgresql-enhanced",
9+
"license": "MIT",
10+
"authors": [
11+
{
12+
"name": "tpetry",
13+
"email": "tobias@tpetry.me"
14+
}
15+
],
16+
"require": {
17+
"php": "^8.0",
18+
"illuminate/database": "^6.0|^7.0|^8.0"
19+
},
20+
"require-dev": {
21+
"friendsofphp/php-cs-fixer": "^2.18",
22+
"orchestra/testbench": "^4.0|^5.0|^6.0",
23+
"phpunit/phpunit": "^9.3",
24+
"vimeo/psalm": "^4.4"
25+
},
26+
"autoload": {
27+
"psr-4": {
28+
"Tpetry\\PostgresqlEnhanced\\": "src"
29+
}
30+
},
31+
"autoload-dev": {
32+
"psr-4": {
33+
"Tpetry\\PostgresqlEnhanced\\Tests\\": "tests"
34+
}
35+
},
36+
"scripts": {
37+
"fixstyle": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
38+
"psalm": "vendor/bin/psalm",
39+
"test": "./vendor/bin/testbench package:test --no-coverage",
40+
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
41+
},
42+
"config": {
43+
"sort-packages": true
44+
},
45+
"extra": {
46+
"laravel": {
47+
"providers": [
48+
"Tpetry\\PostgresqlEnhanced\\PostgresqlEnhancedServiceProvider"
49+
]
50+
}
51+
},
52+
"minimum-stability": "stable",
53+
"prefer-stable": true
54+
}

phpunit.xml.dist

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
backupGlobals="false"
6+
backupStaticAttributes="false"
7+
bootstrap="vendor/autoload.php"
8+
colors="true"
9+
convertErrorsToExceptions="true"
10+
convertNoticesToExceptions="true"
11+
convertWarningsToExceptions="true"
12+
processIsolation="false"
13+
stopOnFailure="false"
14+
executionOrder="random"
15+
failOnWarning="true"
16+
failOnRisky="true"
17+
failOnEmptyTestSuite="true"
18+
beStrictAboutOutputDuringTests="true"
19+
verbose="true"
20+
>
21+
<testsuites>
22+
<testsuite name="PostgreSQL Enhanced Test Suite">
23+
<directory>tests</directory>
24+
</testsuite>
25+
</testsuites>
26+
<coverage>
27+
<include>
28+
<directory suffix=".php">./src</directory>
29+
</include>
30+
<report>
31+
<html outputDirectory="build/coverage"/>
32+
<text outputFile="build/coverage.txt"/>
33+
<clover outputFile="build/logs/clover.xml"/>
34+
</report>
35+
</coverage>
36+
<logging>
37+
<junit outputFile="build/report.junit.xml"/>
38+
</logging>
39+
</phpunit>

psalm.xml.dist

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="4"
4+
findUnusedVariablesAndParams="true"
5+
resolveFromConfigFile="true"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xmlns="https://getpsalm.org/schema/config"
8+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
9+
>
10+
<projectFiles>
11+
<directory name="src"/>
12+
<ignoreFiles>
13+
<directory name="vendor"/>
14+
</ignoreFiles>
15+
</projectFiles>
16+
</psalm>
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Tpetry\PostgresqlEnhanced;
6+
7+
use Illuminate\Database\DatabaseServiceProvider;
8+
9+
class PostgresqlEnhancedServiceProvider extends DatabaseServiceProvider
10+
{
11+
}

tests/ExampleTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Tpetry\PostgresqlEnhanced\Tests;
6+
7+
class ExampleTest extends TestCase
8+
{
9+
public function testTrueIsTrue(): void
10+
{
11+
$this->assertTrue(true);
12+
}
13+
}

tests/TestCase.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Tpetry\PostgresqlEnhanced\Tests;
6+
7+
use Orchestra\Testbench\TestCase as Orchestra;
8+
9+
class TestCase extends Orchestra
10+
{
11+
}

0 commit comments

Comments
 (0)