Skip to content

Commit 94d95ca

Browse files
authored
Apply scaffolder (#178)
1 parent 1464f58 commit 94d95ca

File tree

15 files changed

+115
-125
lines changed

15 files changed

+115
-125
lines changed

.editorconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ indent_style = space
1010
indent_size = 4
1111
trim_trailing_whitespace = true
1212

13-
[*.php]
14-
ij_php_space_before_short_closure_left_parenthesis = false
15-
ij_php_space_after_type_cast = true
16-
1713
[*.md]
1814
trim_trailing_whitespace = false
1915

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: cs fixer
1+
name: Code Style
22

33
on: [ pull_request_target ]
44

.github/workflows/psalm.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
pull_request:
3+
push:
4+
branches:
5+
- master
6+
7+
name: static analysis
8+
9+
jobs:
10+
psalm:
11+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
12+
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
os:
18+
- ubuntu-latest
19+
php:
20+
- "8.2"
21+
- "8.3"
22+
- "8.4"
23+
- "8.5"
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v6
28+
29+
- name: Install PHP with extensions
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
coverage: none
33+
php-version: ${{ matrix.php }}
34+
tools: composer:v2, cs2pr
35+
36+
- name: Install Composer dependencies
37+
uses: ramsey/composer-install@v3
38+
39+
- name: Static analysis
40+
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle --php-version=${{ matrix.php }} | cs2pr --graceful-warnings --colorize

.github/workflows/static.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
.idea
33

44
# Composer
5-
/vendor
5+
/vendor/
66
/composer.lock
77

88
# PHPUnit
9-
/phpunit.phar
109
/phpunit.xml
11-
/.phpunit.cache
12-
13-
# PHP CS Fixer
14-
/.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
return (new Config())
1515
->setParallelConfig(ParallelConfigFactory::detect())
16+
->setCacheFile(__DIR__ . '/runtime/.php-cs-fixer.cache')
1617
->setRules([
1718
'@PER-CS3.0' => true,
1819
'no_unused_imports' => true,

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) 2025-2026 Sergei Predvoditelev.
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
4+
following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
7+
disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided with the distribution.
11+
12+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
13+
derived from this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

LICENSE.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DEFAULT_GOAL := help
2+
3+
scaffolder: ## Run scaffolder
4+
docker run \
5+
--volume .:/project \
6+
--user $(shell id -u):$(shell id -g) \
7+
--interactive --tty --rm --init \
8+
ghcr.io/phptg/scaffolder:latest \
9+
$(RUN_ARGS)
10+
11+
# Output the help for each task, see https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
12+
help: ## This help.
13+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ If you have any questions or problems with this package, use [author telegram ch
144144
## License
145145

146146
The `phptg/bot-api` is free software. It is released under the terms of the BSD License.
147-
Please see [`LICENSE`](./LICENSE.md) for more information.
147+
Please see [`LICENSE`](./LICENSE) for more information.
148148

149149
## Credits
150150

0 commit comments

Comments
 (0)