Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
andysnell committed Apr 3, 2024
0 parents commit 1e81786
Show file tree
Hide file tree
Showing 47 changed files with 5,302 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig http://EditorConfig.org

# top-most EditorConfig file
root = true

# This applies to all files
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4

[*.{yml,yaml}]
indent_size = 2
37 changes: 37 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/.allowed-licenses export-ignore
/.editorconfig export-ignore
/.env export-ignore
/.env.example export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.idea export-ignore
/.psysh.php export-ignore
/CHANGELOG.md export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
/Dockerfile export-ignore
/Makefile export-ignore
/SECURITY.md export-ignore
/benchmarks/ export-ignore
/bin/ export-ignore
/build/ export-ignore
/captainhook.json export-ignore
/codecov.yml export-ignore
/composer.lock export-ignore
/conventional-commits.json export-ignore
/docker-compose.yml export-ignore
/docs/ export-ignore
/phpbench.json export-ignore
/phpcs.xml export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon export-ignore
/phpstan.dist.neon export-ignore
/phpunit.xml export-ignore
/phpunit.dist.xml export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/rector.php export-ignore
/resources/ export-ignore
/settings.ini export-ignore
/tests/ export-ignore
92 changes: 92 additions & 0 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Code Quality
on: [push, pull_request]

jobs:
phpcs:
name: PHP ${{ matrix.php }} - PHP_CodeSniffer
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.3']
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install PHP and Extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2

- name: Install Composer Dependencies
uses: ramsey/composer-install@v2

- name: Run PHP_CodeSniffer
run: vendor/bin/phpcs --no-cache

phpstan:
name: PHP ${{ matrix.php }} - PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.3']
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install PHP and Extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2

- name: Install Composer Dependencies
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: vendor/bin/phpstan --no-progress --no-ansi

rector:
name: PHP ${{ matrix.php }} - Rector
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.3']
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install PHP and Extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2

- name: Install Composer Dependencies
uses: ramsey/composer-install@v2

- name: Run Rector
run: vendor/bin/rector process --dry-run --no-progress-bar

phpunit:
name: PHP ${{ matrix.php }} - PHPUnit
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.3']
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install PHP and Extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer:v2

- name: Install Composer Dependencies
uses: ramsey/composer-install@v2

- name: Run PHPUnit
run: vendor/bin/phpunit --no-progress --coverage-text
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea/
.env
.phpunit.result.cache
docker-compose.override.yml
phpstan.neon
phpunit.xml
vendor/
build/
18 changes: 18 additions & 0 deletions .psysh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

return [
'commands' => [],
'configDir' => __DIR__ . '/build/psysh/config',
'dataDir' => __DIR__ . '/build/psysh/data',
'defaultIncludes' => [],
'eraseDuplicates' => true,
'errorLoggingLevel' => \E_ALL,
'forceArrayIndexes' => true,
'historySize' => 1000,
'runtimeDir' => __DIR__ . '/build/psysh/tmp',
'updateCheck' => 'never',
'useBracketedPaste' => true,
'verbosity' => \Psy\Configuration::VERBOSITY_NORMAL,
];
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# syntax=docker/dockerfile:1.4
FROM php:8.3-cli as php
WORKDIR /app
ENV PATH "/app/bin:/app/vendor/bin:/app/build/composer/vendor/bin:$PATH"
ENV COMPOSER_HOME "/app/build/composer"

RUN <<-EOF
groupadd --gid 1000 dev;
useradd --system --create-home --uid 1000 --gid 1000 --shell /bin/bash dev;
EOF

RUN <<-EOF
apt-get update;
apt-get install -y \
apt-transport-https \
autoconf \
build-essential \
curl \
git \
less \
libgmp-dev \
libicu-dev \
libzip-dev \
libsodium-dev \
pkg-config \
unzip \
vim-tiny \
zip \
zlib1g-dev;
apt-get clean;
EOF

RUN <<-EOF
docker-php-ext-install -j$(nproc) bcmath gmp intl opcache zip;
pecl install xdebug;
docker-php-ext-enable xdebug;
EOF

COPY --link --from=composer/composer:latest-bin /composer /usr/bin/composer
COPY --link settings.ini /usr/local/etc/php/conf.d/settings.ini

USER dev
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2023-2024 WickedByte LLC

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.
64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
SHELL := bash

app = docker compose run --rm app

build:
@docker compose build --pull
@$(app) composer install
@cp phpstan.dist.neon phpstan.neon
@cp phpunit.dist.xml phpunit.xml
@$(app) mkdir -p build

.PHONY: clean
clean:
@rm -rf ./build ./vendor

.PHONY: update
update: build
@$(app) composer update --with-all-dependencies
@$(app) composer bump

.PHONY: upgrade
upgrade: build
@$(app) composer require --dev --update-with-all-dependencies \
phpstan/phpstan \
phpunit/phpunit \
psy/psysh \
squizlabs/php_codesniffer \
slevomat/coding-standard \
rector/rector
@$(app) composer require --update-with-all-dependencies \
symfony/console
@$(app) app composer bump

.PHONY: bash
bash: build
@$(app) bash

.PHONY: phpunit
phpunit: build
@$(app) composer phpunit

.PHONY: psysh
psysh: build
@$(app) composer psysh

.PHONY: phpcs
phpcs: build
@$(app) composer phpcs

.PHONY: phpcbf
phpcbf: build
@$(app) composer phpcbf

.PHONY: phpstan
phpstan: build
@$(app) composer phpstan

.PHONY: rector
rector: build
@$(app) composer rector

.PHONY: ci
ci: build
@$(app) composer ci
Loading

0 comments on commit 1e81786

Please sign in to comment.