Formatting and fixup
This commit is contained in:
parent
bc7fd3bf4f
commit
dbfc415166
13 changed files with 162 additions and 138 deletions
30
.github/workflows/lint-php.yml
vendored
30
.github/workflows/lint-php.yml
vendored
|
|
@ -1,30 +0,0 @@
|
||||||
name: Lint PHP
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
php-cs-fixer:
|
|
||||||
name: PHP-CS-Fixer
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Composer Action
|
|
||||||
run: docker run -v $PWD/:/app gone/php:cli-7.4 /usr/local/bin/composer install
|
|
||||||
- name: PHP-CS-Fixer
|
|
||||||
run: |
|
|
||||||
docker-compose run web \
|
|
||||||
phpdbg -qrr -d memory_limit=-1 \
|
|
||||||
vendor/bin/php-cs-fixer fix --dry-run
|
|
||||||
phpstan:
|
|
||||||
name: PHPStan
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Composer Action
|
|
||||||
run: docker run -v $PWD/:/app gone/php:cli-7.4 /usr/local/bin/composer install
|
|
||||||
- name: PHPStan
|
|
||||||
run: |
|
|
||||||
docker-compose run web \
|
|
||||||
phpdbg -qrr -d memory_limit=-1 \
|
|
||||||
vendor/bin/phpstan analyse src/ test/ bin
|
|
||||||
50
.github/workflows/test.yml
vendored
Normal file
50
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
name: Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: tests-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
ACTION_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
phpcsfixer:
|
||||||
|
name: PHP-CS-Fixer
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: PHP-CS-Fixer
|
||||||
|
uses: docker://oskarstark/php-cs-fixer-ga
|
||||||
|
|
||||||
|
phpunit:
|
||||||
|
name: PHPUnit
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: php-actions/composer@v6
|
||||||
|
- uses: php-actions/phpunit@v3
|
||||||
|
|
||||||
|
phpstan:
|
||||||
|
name: PHPStan
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: php-actions/composer@v6
|
||||||
|
- uses: php-actions/phpstan@v3
|
||||||
|
with:
|
||||||
|
path: src/
|
||||||
|
|
||||||
|
trunk:
|
||||||
|
name: Trunk Check Runner
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
checks: write # For trunk to post annotations
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: trunk-io/trunk-action@v1
|
||||||
61
.github/workflows/unit-tests.yml
vendored
61
.github/workflows/unit-tests.yml
vendored
|
|
@ -1,61 +0,0 @@
|
||||||
name: Test
|
|
||||||
on: [push, pull_request]
|
|
||||||
jobs:
|
|
||||||
ingest:
|
|
||||||
name: PHPUnit/Ingest
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Composer Install
|
|
||||||
run: docker run -v $PWD/:/app gone/php:cli-7.4 /usr/local/bin/composer install
|
|
||||||
- name: PHPUnit
|
|
||||||
run: |
|
|
||||||
docker-compose run web \
|
|
||||||
phpdbg -qrr -d memory_limit=-1 \
|
|
||||||
vendor/bin/paratest \
|
|
||||||
--testsuite=Ingest
|
|
||||||
|
|
||||||
human:
|
|
||||||
name: PHPUnit/Human
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Composer Install
|
|
||||||
run: docker run -v $PWD/:/app gone/php:cli-7.4 /usr/local/bin/composer install
|
|
||||||
- name: PHPUnit
|
|
||||||
run: |
|
|
||||||
docker-compose run test \
|
|
||||||
phpdbg -qrr -d memory_limit=-1 \
|
|
||||||
vendor/bin/phpunit \
|
|
||||||
--testsuite=Human
|
|
||||||
|
|
||||||
models:
|
|
||||||
name: PHPUnit/Models
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Composer Install
|
|
||||||
run: docker run -v $PWD/:/app gone/php:cli-7.4 /usr/local/bin/composer install
|
|
||||||
- name: PHPUnit
|
|
||||||
run: |
|
|
||||||
docker-compose run test \
|
|
||||||
phpdbg -qrr -d memory_limit=-1 \
|
|
||||||
vendor/bin/phpunit \
|
|
||||||
--testsuite=Models
|
|
||||||
services:
|
|
||||||
name: PHPUnit/Services
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Composer Install
|
|
||||||
run: docker run -v $PWD/:/app gone/php:cli-7.4 /usr/local/bin/composer install
|
|
||||||
- name: PHPUnit
|
|
||||||
run: |
|
|
||||||
docker-compose run test \
|
|
||||||
phpdbg -qrr -d memory_limit=-1 \
|
|
||||||
vendor/bin/phpunit \
|
|
||||||
--testsuite=Services
|
|
||||||
18
.gitignore
vendored
18
.gitignore
vendored
|
|
@ -1,8 +1,10 @@
|
||||||
build/
|
/composer.lock
|
||||||
composer.lock
|
/vendor/
|
||||||
vendor/
|
/.idea/
|
||||||
.idea/
|
/.phpunit.result.cache
|
||||||
.phpunit.result.cache
|
/.php_cs.cache
|
||||||
.php_cs.cache
|
/.php-cs-fixer.cache
|
||||||
docs
|
/.coverage
|
||||||
phploc.xml
|
/phpunit.xml
|
||||||
|
/.github/cache
|
||||||
|
/.github/act.secrets
|
||||||
9
.trunk/.gitignore
vendored
Normal file
9
.trunk/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
*out
|
||||||
|
*logs
|
||||||
|
*actions
|
||||||
|
*notifications
|
||||||
|
*tools
|
||||||
|
plugins
|
||||||
|
user_trunk.yaml
|
||||||
|
user.yaml
|
||||||
|
tmp
|
||||||
2
.trunk/configs/.markdownlint.yaml
Normal file
2
.trunk/configs/.markdownlint.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Prettier friendly markdownlint config (all formatting rules disabled)
|
||||||
|
extends: markdownlint/style/prettier
|
||||||
7
.trunk/configs/.shellcheckrc
Normal file
7
.trunk/configs/.shellcheckrc
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
enable=all
|
||||||
|
source-path=SCRIPTDIR
|
||||||
|
disable=SC2154
|
||||||
|
|
||||||
|
# If you're having issues with shellcheck following source, disable the errors via:
|
||||||
|
# disable=SC1090
|
||||||
|
# disable=SC1091
|
||||||
7
.trunk/configs/.yamllint.yaml
Normal file
7
.trunk/configs/.yamllint.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
rules:
|
||||||
|
quoted-strings:
|
||||||
|
required: only-when-needed
|
||||||
|
extra-allowed: ["{|}"]
|
||||||
|
key-duplicates: {}
|
||||||
|
octal-values:
|
||||||
|
forbid-implicit-octal: true
|
||||||
36
.trunk/trunk.yaml
Normal file
36
.trunk/trunk.yaml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
|
||||||
|
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
|
||||||
|
version: 0.1
|
||||||
|
cli:
|
||||||
|
version: 1.21.0
|
||||||
|
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
|
||||||
|
plugins:
|
||||||
|
sources:
|
||||||
|
- id: trunk
|
||||||
|
ref: v1.4.5
|
||||||
|
uri: https://github.com/trunk-io/plugins
|
||||||
|
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
|
||||||
|
runtimes:
|
||||||
|
enabled:
|
||||||
|
- go@1.21.0
|
||||||
|
- node@18.12.1
|
||||||
|
- python@3.10.8
|
||||||
|
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
|
||||||
|
lint:
|
||||||
|
enabled:
|
||||||
|
- actionlint@1.6.27
|
||||||
|
- checkov@3.2.60
|
||||||
|
- git-diff-check
|
||||||
|
- markdownlint@0.39.0
|
||||||
|
- prettier@3.2.5
|
||||||
|
- shellcheck@0.10.0
|
||||||
|
- shfmt@3.6.0
|
||||||
|
- trivy@0.50.1
|
||||||
|
- trufflehog@3.71.0
|
||||||
|
- yamllint@1.35.1
|
||||||
|
actions:
|
||||||
|
enabled:
|
||||||
|
- trunk-announce
|
||||||
|
- trunk-check-pre-push
|
||||||
|
- trunk-fmt-pre-commit
|
||||||
|
- trunk-upgrade-available
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
function detectAndLoadVendor($path = __DIR__): void
|
function detectAndLoadVendor($path = __DIR__): void
|
||||||
{
|
{
|
||||||
$path = realpath($path);
|
$path = realpath($path);
|
||||||
|
|
@ -11,12 +13,12 @@ function detectAndLoadVendor($path = __DIR__): void
|
||||||
if ($fileInfo->isDir() && 'vendor' == $fileInfo->getFilename()) {
|
if ($fileInfo->isDir() && 'vendor' == $fileInfo->getFilename()) {
|
||||||
define('VENDOR_PATH', $fileInfo->getRealPath());
|
define('VENDOR_PATH', $fileInfo->getRealPath());
|
||||||
|
|
||||||
require_once VENDOR_PATH.'/autoload.php';
|
require_once VENDOR_PATH . '/autoload.php';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
detectAndLoadVendor($path.'/../');
|
detectAndLoadVendor($path . '/../');
|
||||||
}
|
}
|
||||||
|
|
||||||
detectAndLoadVendor();
|
detectAndLoadVendor();
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,36 @@
|
||||||
{
|
{
|
||||||
"name": "benzine/orm",
|
"name": "benzine/orm",
|
||||||
"description": "The Benzine Database Access Layer. Includes generation of models, controllers and so on from schema.",
|
"description": "The Benzine Database Access Layer. Includes generation of models, controllers and so on from schema.",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Matthew Baggett",
|
"name": "Matthew Baggett",
|
||||||
"email": "matthew@baggett.me"
|
"email": "matthew@baggett.me"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.0",
|
"php": ">=8.0",
|
||||||
"ext-simplexml": "*",
|
"ext-simplexml": "*",
|
||||||
"matthewbaggett/twig-extension-inflect": "^1.0",
|
"matthewbaggett/twig-extension-inflect": "^1.0",
|
||||||
"matthewbaggett/twig-extension-transform": "^1.0",
|
"matthewbaggett/twig-extension-transform": "^1.0",
|
||||||
"matthewbaggett/uuid": "^2.3",
|
"matthewbaggett/uuid": "^2.3",
|
||||||
"laminas/laminas-db": "^2.11.1",
|
"laminas/laminas-db": "^2.11.1",
|
||||||
"mattketmo/camel": "^1.1",
|
"mattketmo/camel": "^1.1",
|
||||||
"nesbot/carbon": "^2.0",
|
"nesbot/carbon": "^2.0",
|
||||||
"robmorgan/phinx": "^0.12.1"
|
"robmorgan/phinx": "^0.12.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"benzine/core": "dev-master"
|
"benzine/core": "dev-main"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Benzine\\ORM\\": "src",
|
"Benzine\\ORM\\": "src",
|
||||||
"Benzine\\ORM\\Tests\\": "test/app/src"
|
"Benzine\\ORM\\Tests\\": "test/app/src"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"bin/laminator",
|
"bin/laminator",
|
||||||
"bin/wait-for-mysql"
|
"bin/wait-for-mysql"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,13 @@ use Benzine\ORM\LaminatorSql;
|
||||||
use Laminas\Db\Adapter\AdapterInterface;
|
use Laminas\Db\Adapter\AdapterInterface;
|
||||||
use Laminas\Db\Adapter\Exception\InvalidQueryException;
|
use Laminas\Db\Adapter\Exception\InvalidQueryException;
|
||||||
use Laminas\Db\ResultSet\ResultSet;
|
use Laminas\Db\ResultSet\ResultSet;
|
||||||
|
use Laminas\Db\ResultSet\ResultSetInterface;
|
||||||
use Laminas\Db\Sql\Expression;
|
use Laminas\Db\Sql\Expression;
|
||||||
use Laminas\Db\Sql\Predicate;
|
use Laminas\Db\Sql\Predicate;
|
||||||
use Laminas\Db\Sql\Predicate\PredicateInterface;
|
use Laminas\Db\Sql\Predicate\PredicateInterface;
|
||||||
use Laminas\Db\Sql\Select;
|
use Laminas\Db\Sql\Select;
|
||||||
use Laminas\Db\Sql\Where;
|
use Laminas\Db\Sql\Where;
|
||||||
use Laminas\Db\TableGateway\TableGateway;
|
use Laminas\Db\TableGateway\TableGateway;
|
||||||
use Laminas\Db\ResultSet\ResultSetInterface;
|
|
||||||
|
|
||||||
abstract class AbstractTableGateway extends TableGateway
|
abstract class AbstractTableGateway extends TableGateway
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,14 +20,14 @@ use Camel\Format;
|
||||||
use Laminas\Db\Metadata\Object\TableObject;
|
use Laminas\Db\Metadata\Object\TableObject;
|
||||||
use Laminas\Stdlib\ConsoleHelper;
|
use Laminas\Stdlib\ConsoleHelper;
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
use Twig\Environment;
|
||||||
use Twig\Environment as TwigEnvironment;
|
use Twig\Environment as TwigEnvironment;
|
||||||
use Twig\Error\LoaderError;
|
use Twig\Error\LoaderError;
|
||||||
use Twig\Error\RuntimeError;
|
use Twig\Error\RuntimeError;
|
||||||
use Twig\Error\SyntaxError;
|
use Twig\Error\SyntaxError;
|
||||||
use Twig\Loader\FilesystemLoader as TwigFileSystemLoader;
|
|
||||||
use Twig\Environment;
|
|
||||||
use Twig\Extension\DebugExtension;
|
use Twig\Extension\DebugExtension;
|
||||||
use Twig\Loader\FilesystemLoader;
|
use Twig\Loader\FilesystemLoader;
|
||||||
|
use Twig\Loader\FilesystemLoader as TwigFileSystemLoader;
|
||||||
use Twig\TwigFunction;
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
class Laminator
|
class Laminator
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue