Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f515e44
license and composer json normalizer
vjik Dec 30, 2025
52b9fd0
.editorconfig
vjik Dec 30, 2025
5a4b878
Add support information to composer.json and update license year
vjik Jan 3, 2026
ee2c005
Add rector
vjik Jan 3, 2026
57f8006
Update
vjik Jan 3, 2026
5e2c797
Add README generation and internals documentation
vjik Jan 3, 2026
69c7ae5
Refactor PHP version handling in PrepareRectorConfiguration
vjik Jan 3, 2026
6db1ec4
phpunit
vjik Jan 3, 2026
4d2078e
Enhance README generation with dynamic PHP constraint handling
vjik Jan 4, 2026
6ada392
Add Psalm support
vjik Jan 4, 2026
abba956
Add UsePhpUnit fact and update gitignore handling for PHPUnit
vjik Jan 4, 2026
3fd54c1
Add PHPStan support and configuration
vjik Jan 4, 2026
ddcd6e6
Add PHP CS Fixer support and configuration
vjik Jan 4, 2026
9d5341c
Add Composer Dependency Analyser support and configuration
vjik Jan 4, 2026
0652e12
Add support for EnsureDirectoryWithGitkeep and update package parameters
vjik Jan 4, 2026
e6872ee
Add .gitattributes file for text file handling and export-ignore rules
vjik Jan 4, 2026
d688c00
Add PrepareChangelog class to generate and manage CHANGELOG.md
vjik Jan 4, 2026
85de9a8
Add .gitattributes and CHANGELOG.md
vjik Jan 4, 2026
b94b574
Add PrepareDocsInternals class to manage and generate documentation f…
vjik Jan 4, 2026
0012c2c
Add Infection support with configuration files and command integration
vjik Jan 4, 2026
437db3c
Add GitHub Actions workflow for PHP testing and coverage
vjik Jan 4, 2026
baf18c7
Add GitHub Actions workflow for Composer dependency analysis
vjik Jan 4, 2026
0df89c0
Add Composer Dependency Analyser workflow and refactor variable names…
vjik Jan 4, 2026
a04f4ec
Add GitHub Actions workflow for mutation testing and integrate PHP ve…
vjik Jan 4, 2026
a35b9eb
Add GitHub Actions workflow for Psalm static analysis
vjik Jan 4, 2026
7f0f119
Add GitHub Actions workflow for PHPStan static analysis with PHP vers…
vjik Jan 4, 2026
a10292f
Add GitHub Actions workflow for PHP CS Fixer and Rector
vjik Jan 4, 2026
24f3294
Update Dockerfile to use PHP 8.4 CLI base image
vjik Jan 4, 2026
b13a546
Refactor PHP version handling in GitHub workflows to ensure compatibi…
vjik Jan 4, 2026
4d3ee5e
Add docker build & push. Rename workflows for clarity and consistency
vjik Jan 4, 2026
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
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
36 changes: 36 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Autodetect text files
* text=auto eol=lf

# ...Unless the name matches the following overriding patterns

# Definitively text files
*.php text
*.css text
*.js text
*.txt text
*.md text
*.xml text
*.json text
*.bat text
*.sql text
*.yml text

# Ensure those won't be messed up with
*.phar binary
*.png binary
*.jpg binary
*.gif binary
*.ttf binary

# Exclude development and metadata files from distribution archive
* export-ignore
/src/ -export-ignore
/src/** -export-ignore
/composer.json -export-ignore
/README.md -export-ignore
/CHANGELOG.md -export-ignore
/LICENSE -export-ignore

# Avoid merge conflicts in CHANGELOG
# https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/
/CHANGELOG.md merge=union
38 changes: 38 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Code Style

on: [ pull_request_target ]

jobs:
php-cs-fixer:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer:v2
coverage: none

- name: Install Composer dependencies
uses: "ramsey/composer-install@v3"

- name: Run PHP CS Fixer
run: composer cs-fix

- name: Run Rector
run: ./vendor/bin/rector --output-format=github

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply PHP CS Fixer and Rector changes (CI)"
file_pattern: '*.php'
disable_globbing: true
35 changes: 35 additions & 0 deletions .github/workflows/composer-dependency-analyser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Composer Dependency Analyser

on:
pull_request:
push:
branches: [ 'master' ]

jobs:
composer-require-checker:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
php:
- "8.4"

steps:
- name: Checkout.
uses: actions/checkout@v6

- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@v3

- name: Check dependencies
run: vendor/bin/composer-dependency-analyser
51 changes: 51 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Docker Image

on:
workflow_dispatch: ~
workflow_run:
workflows: [ "Code Style", "Composer Dependency Analyser", "PHPStan" ]
branches: [ "master" ]
types:
- completed

concurrency:
group: docker-image-build
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Get current timestamp
id: timestamp
run: echo "rfc3339=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT

- name: Checkout
uses: actions/checkout@v6

- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Docker QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build & push image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
tags: ghcr.io/phptg/scaffolder:latest
push: ${{ github.ref == 'refs/heads/master' && github.repository_owner == 'phptg' }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.timestamp.outputs.rfc3339 }}
org.opencontainers.image.revision=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
37 changes: 37 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PHPStan

on:
pull_request:
push:
branches:
- master

jobs:
phpstan:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
php:
- "8.4"

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php }}
tools: composer:v2, cs2pr

- name: Install Composer dependencies
uses: ramsey/composer-install@v3

- name: Static analysis
run: vendor/bin/phpstan analyse --configuration=phpstan.neon
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Composer
/vendor/
20 changes: 20 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

$finder = new Finder()->in([
__DIR__ . '/src',
]);

return new Config()
->setParallelConfig(ParallelConfigFactory::detect())
->setCacheFile(__DIR__ . '/runtime/.php-cs-fixer.cache')
->setRules([
'@PER-CS3.0' => true,
'no_unused_imports' => true,
])
->setFinder($finder);
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# PHPTG Scaffolder Change Log

## under development

- Initial release.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.5-cli-alpine3.22
FROM php:8.4-cli-alpine3.22

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 2026 Sergei Predvoditelev.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
.DEFAULT_GOAL := help

IMAGE_NAME := ghcr.io/phptg/scaffolder

build: ## Build the docker image
docker build -t $(IMAGE_NAME) .

run:
docker run \
--volume .:/project \
--user $(shell id -u):$(shell id -g) \
--interactive --tty --rm --init \
$(IMAGE_NAME):latest \
$(RUN_ARGS)

# Output the help for each task, see https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# Scaffolder Template
<div align="center">
<a href="https://github.com/phptg">
<img src="logo.png" alt="PHPTG">
</a>
<h1 align="center">PHPTG Scaffolder</h1>
<br>
</div>

## Documentation

If you have any questions or problems with this package, use [author telegram chat](https://t.me/predvoditelev_chat) for communication.

## License

The `phptg/scaffolder` is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE) for more information.
11 changes: 11 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;

return new Configuration()
->disableComposerAutoloadPathScan()
->setFileExtensions(['php'])
->addPathToScan(__DIR__ . '/src', isDev: false);
49 changes: 45 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,53 @@
{
"name": "_____/_____",
"name": "phptg/scaffolder",
"description": "PHPTG Scaffolder",
"license": "BSD-3-Clause",
"type": "project",
"autoload": {
"psr-4": {
"_____\\": "src/"
"authors": [
{
"name": "Sergei Predvoditelev",
"email": "sergei@predvoditelev.ru"
}
],
"support": {
"issues": "https://github.com/phptg/scaffolder/issues?state=open",
"chat": "https://t.me/predvoditelev_chat",
"source": "https://github.com/phptg/scaffolder"
},
"require": {
"php": "~8.4.0",
"ext-filter": "*",
"symfony/console": "^8.0.3",
"vjik/scaffolder": "dev-master"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.3",
"phpstan/phpstan": "^2.1.33",
"rector/rector": "^2.3"
},
"autoload": {
"psr-4": {
"Phptg\\Scaffolder\\": "src/"
}
},
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
},
"bump-after-update": true,
"sort-packages": true
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": true,
"target-directory": "tools"
}
},
"scripts": {
"cs-fix": "php-cs-fixer fix",
"dependency-analyser": "composer-dependency-analyser",
"phpstan": "phpstan analyse -c phpstan.neon",
"rector": "rector"
}
}
Loading