Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Git
.git
.gitignore
.gitattributes

# IDE
.idea
.vscode
.phpstorm.meta.php

# Documentation
README.md
CHANGELOG.md
LICENSE
*.md

# CI/CD
.github

# Testing
tests
.phpunit.cache
coverage
coverage.xml
infection.log
infection-summary.log
infection-debug.log
.infection

# Dependencies (will be installed in container)
vendor

# Environment
.env
.env.local
.env.*.local

# OS
.DS_Store
Thumbs.db

# Docker
Dockerfile
docker-compose.yml
.dockerignore

25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_style = space
indent_size = 4

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.{json,json5}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = true
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# PHP Server Configuration
PHP_SERVER_PORT=8000

# Application Environment
APP_ENV=dev
APP_DEBUG=true

# Add your custom environment variables below
# EXAMPLE_VARIABLE=value
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @MacPaw/platform-backend
46 changes: 46 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## 📋 Description

<!-- Provide a brief description of the changes in this PR -->

## 🎯 Type of Change

<!-- Mark the relevant option with an "x" -->

- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] 📚 Documentation update
- [ ] 🔧 Configuration change
- [ ] ♻️ Code refactoring

## 🔄 Changes Made

<!-- List the key changes made in this PR -->

-
-
-

## 📸 Screenshots (if applicable)

<!-- Add screenshots to help explain your changes -->

## ✅ Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have tested my changes across multiple PHP/Symfony versions (if applicable)
- [ ] Any dependent changes have been merged and published

## 🔗 Related Issues

<!-- Link any related issues here using #issue_number -->

Closes #

## 📝 Additional Notes

<!-- Add any additional context or notes for reviewers -->
23 changes: 23 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Security Policy

## Reporting Security Issues
If you believe you have found a security vulnerability in any MacPaw-owned repository, please report it to us through coordinated disclosure.

Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

Instead, please send an email to `security[@]macpaw.com`.

Please include as much of the information listed below as you can to help us better understand and resolve the issue:

- The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

## Policy
See MacPaw's [Vulnerability Disclosure Policy](https://macpaw.com/vulnerability-disclosure-policy)
102 changes: 102 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
- master
- develop
- dev

jobs:
ci:
name: Package CI
uses: MacPaw/github-actions/.github/workflows/symfony-php-reusable.yml@feat/add-release-workflow
with:
# Version matrix for testing across PHP and Symfony versions
# Only using stable, available versions
versions-matrix: |
{
"php": ["8.2", "8.3", "8.4"],
"symfony/http-kernel": ["6.4.*", "7.0.*", "7.1.*", "7.2", "7.3", "7.4"]
}

# Matrix include - add specific combinations (e.g., testing lowest dependencies)
matrix-include: |
[
{
"php": "8.2",
"symfony/http-kernel": "6.4.*",
"dependencies": "lowest"
},
{
"php": "8.4",
"symfony/http-kernel": "7.4.*",
"dependencies": "coverage",
"coverage": "xdebug"
}
]

# Matrix exclude - skip specific incompatible combinations if needed
# Currently empty as all combinations above are valid
matrix-exclude: |
[
{"php": "8.2", "symfony/http-kernel": "7.0.*"},
{"php": "8.3", "symfony/http-kernel": "7.0.*"},
{"php": "8.4", "symfony/http-kernel": "7.0.*"},

{"php": "8.2", "symfony/http-kernel": "7.1.*"},
{"php": "8.3", "symfony/http-kernel": "7.1.*"},
{"php": "8.4", "symfony/http-kernel": "7.1.*"},

{"php": "8.2", "symfony/http-kernel": "7.2.*"},
{"php": "8.3", "symfony/http-kernel": "7.2.*"},
{"php": "8.4", "symfony/http-kernel": "7.2.*"},

{"php": "8.2", "symfony/http-kernel": "7.3.*"},
{"php": "8.3", "symfony/http-kernel": "7.3.*"},
{"php": "8.4", "symfony/http-kernel": "7.3.*"}
]

# Testing settings
enable-coverage-check: true
coverage-threshold: 70
coverage-file: 'coverage.xml'
phpcov-version: 11.0.3

# PHP quality tools version
php-version-quality-tools: '8.3'

# Static analysis tools
enable-phpstan: true
phpstan-level: 'max'
phpstan-config: 'phpstan.neon.dist'

# Code style tools
enable-phpcs: true
phpcs-config: 'phpcs.xml.dist'

enable-php-cs-fixer: true
php-cs-fixer-config: '.php-cs-fixer.dist.php'

# Refactoring tool
enable-rector: true
rector-config: 'rector.php'

# Mutation testing
enable-infection: true
infection-config: 'infection.json5.dist'
infection-min-msi: 80
infection-min-covered-msi: 90

# Other validation tools
enable-composer-validate: true
enable-commitlint: true
commitlint-config: 'commitlint.config.js'

# Environment configuration
php-extensions: 'mbstring, json, xdebug'
working-directory: '.'
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
branches:
- main
- master
- next
- beta
- alpha
- '[0-9]+.x'
- '[0-9]+.[0-9]+.x'
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (no release will be created)'
required: false
type: boolean
default: false

jobs:
release:
name: Release
uses: ./.github/workflows/release-reusable.yml
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
dry_run: ${{ inputs.dry_run || false }}
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Composer
/vendor/
composer.lock

# IDE
.idea/
.phpstorm.meta.php
.phpunit.result.cache
.vscode/

# OS
.DS_Store
Thumbs.db

# PHPUnit
.phpunit.cache/
coverage.xml
coverage/

# Infection
.infection/
infection.log
infection-summary.log
infection-debug.log

# Symfony
/var/
/.phpunit.cache/

# Local
.env
.env.local

/*.cache
31 changes: 31 additions & 0 deletions .infrastructure/docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM php:8.3-cli-alpine

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

# Install system dependencies
RUN apk add --no-cache \
git \
curl \
zip \
unzip \
bash \
make

# Install PHP extensions
RUN install-php-extensions \
mbstring \
zip \
pdo_mysql \
opcache

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Set working directory
WORKDIR /app

# Expose port (default 8000, can be overridden via env)
EXPOSE 8000

# Start PHP built-in server
CMD ["sh", "-c", "php -S 0.0.0.0:${PHP_SERVER_PORT:-8000} -t public"]
35 changes: 35 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('vendor')
->exclude('var')
->exclude('.phpunit.cache')
->name('*.php')
;

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'@Symfony' => true,
'declare_strict_types' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
])
->setFinder($finder)
->setRiskyAllowed(true)
;

Loading
Loading