Skip to content

Commit

Permalink
initial work on 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsizemore committed May 4, 2024
1 parent 2b98ee6 commit 9e4ca2f
Show file tree
Hide file tree
Showing 28 changed files with 1,793 additions and 1,363 deletions.
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.php-cs-fixer.dist.php export-ignore
/examples export-ignore
/tests export-ignore
/composer.lock export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/phpunit.xml export-ignore
/psalm.xml export-ignore
/renovate.json export-ignore
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Bug Report
description: Existing feature does not behave as expected.
labels: [ "bug", "unverified" ]
body:
- type: markdown
attributes:
value: |
Before reporting a bug, make sure Esi\SimpleTpl is up-to-date and the problem is/was not reported already.
- type: textarea
id: problem-description
attributes:
label: Problem description
description: Please describe the problem you have encountered
validations:
required: true
- type: textarea
id: minimal-reproducer
attributes:
label: Minimal Reproducer
description: |
Please provide a minimal code snippet that should be run to reproduce the problem.
If relevant, provide the expected output, the actual output and/or the error that occurred, if any.
Please use markdown syntax for each code snippet.
validations:
required: true
- type: input
id: version
attributes:
label: Library Version
description: Which version of Esi\SimpleTpl is being run? (in X.Y.Z format)
validations:
required: true
- type: input
id: php-version
attributes:
label: PHP version
description: Which PHP version is Esi\SimpleTpl being run on?
validations:
required: true
- type: dropdown
id: run-method
attributes:
label: How do you run Esi\SimpleTpl?
multiple: false
options:
- Composer package
- Manual installation
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Contribution Checks
options:
- label: I have verified whether this problem has already been reported.
required: false
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Feature Request
description: I have a suggestion for a new feature (and possibly want to implement it).
labels: [ "enhancement", "unverified" ]
body:
- type: markdown
attributes:
value: |
> [!IMPORTANT]
> Before requesting a new feature, make sure your version of Esi\SimpleTpl is up-to-date.
- type: textarea
id: feature-request
attributes:
label: Feature Request
description: Please describe the feature you would like to see implemented.
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Contribution Checks
options:
- label: I have verified whether this feature request was already discussed.
required: false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Support question?
url: https://github.com/ericsizemore/simple_tpl/discussions/categories/q-a
about: If you have any questions about configuring or using Esi\SimpleTpl, please open a new Q&A discussion.
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Pull Request
<!--
PR title needs to be prefixed with a conventional commit type
(chore,ci,deprecate,docs,feat,fix,refactor,revert)
It should also be brief and descriptive for a good changelog entry
examples: "feat: add new implementation" or "fix: remove unused imports"
-->

## Proposed Changes
<!-- Describe what the changes are and link to a Discussion or Issue if one exists -->

## Readiness Checklist

### Author/Contributor

- [ ] You have read [CONTRIBUTING](https://github.com/ericsizemore/simple_tpl/blob/master/CONTRIBUTING.md)
- [ ] If documentation is needed for this change, has that been included in this pull request
- [ ] run `composer run-script test` and ensure you have test coverage for the lines you are introducing
- [ ] run `composer run-script phpstan` and fix any issues that you have introduced
- [ ] run `composer run-script psalm` and fix any issues that you have introduced
- [ ] run `composer run-script cs:check` and fix any issues that you have introduced

### Reviewer

- [ ] Label as either `fix`, `documentation`, or `enhancement`
- [ ] Additionally label as `verified` or `unverified`
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
.idea/
vendor/
build/
dochtml/
.php-cs-fixer.cache
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
.idea/php.xml
.idea/simple_tpl.iml
clover.xml
21 changes: 11 additions & 10 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
(c) 2006 - 2024 Eric Sizemore <admin@secondversion.com>
This file is licensed under the GNU Public License v3. For the full
copyright and license information, please view the LICENSE.md file
that was distributed with this source code.
This file is licensed under The MIT License. For the full copyright and
license information, please view the LICENSE.md file that was distributed
with this source code.
EOF;

$config = new PhpCsFixer\Config();
Expand Down Expand Up @@ -37,13 +37,13 @@
'fully_qualified_strict_types' => true,
'header_comment' => ['comment_type' => 'PHPDoc', 'header' => $header, 'separate' => 'top'],
'heredoc_to_nowdoc' => true,
//'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
'native_constant_invocation' => ['fix_built_in' => false, 'include' => ['DIRECTORY_SEPARATOR', 'PHP_INT_SIZE', 'PHP_SAPI', 'PHP_VERSION_ID'], 'scope' => 'namespaced', 'strict' => true],
'no_leading_import_slash' => true,
'no_unneeded_import_alias' => true,
'no_unused_imports' => true,
'ordered_class_elements' => [
//'global_namespace_import' => ['import_classes' => true, 'import_constants' => false, 'import_functions' => true],
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
'native_constant_invocation' => ['fix_built_in' => false, 'include' => ['DIRECTORY_SEPARATOR', 'PHP_INT_SIZE', 'PHP_SAPI', 'PHP_VERSION_ID'], 'scope' => 'namespaced', 'strict' => true],
'no_leading_import_slash' => true,
'no_unneeded_import_alias' => true,
'no_unused_imports' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
'case',
Expand Down Expand Up @@ -110,6 +110,7 @@
->setLineEnding("\n")
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . '/examples')
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
)
Expand Down
136 changes: 136 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# .scrutinizer.yml
build:
image: default-bionic
environment:
php: 8.2.15
nodes:
analysis:
dependencies:
before:
- 'composer --global config allow-plugins true'
- 'composer config allow-plugins true'
project_setup:
override:
- 'true'
tests:
override:
- php-scrutinizer-run
- composer --global config allow-plugins true
- composer config allow-plugins true
- command: phpcs-run
use_website_config: true
filter:
excluded_paths:
- 'tests/*'

checks:
php: true

coding_style:
php:
indentation:
general:
use_tabs: false
size: 4
switch:
indent_case: true
spaces:
general:
linefeed_character: newline
before_parentheses:
function_declaration: false
closure_definition: false
function_call: false
if: true
for: true
while: true
switch: true
catch: true
array_initializer: false
around_operators:
assignment: true
logical: true
equality: true
relational: true
bitwise: true
additive: true
multiplicative: true
shift: true
unary_additive: false
concatenation: true
negation: false
before_left_brace:
class: true
function: true
if: true
else: true
for: true
while: true
do: true
switch: true
try: true
catch: true
finally: true
before_keywords:
else: true
while: true
catch: true
finally: true
within:
brackets: false
array_initializer: false
grouping: false
function_call: false
function_declaration: false
if: false
for: false
while: false
switch: false
catch: false
type_cast: false
ternary_operator:
before_condition: true
after_condition: true
before_alternative: true
after_alternative: true
in_short_version: false
other:
before_comma: false
after_comma: true
before_semicolon: false
after_semicolon: true
after_type_cast: true
braces:
classes_functions:
class: new-line
function: new-line
closure: end-of-line
if:
opening: end-of-line
always: true
else_on_new_line: false
for:
opening: end-of-line
always: true
while:
opening: end-of-line
always: true
do_while:
opening: end-of-line
always: true
while_on_new_line: false
switch:
opening: end-of-line
try:
opening: end-of-line
catch_on_new_line: false
finally_on_new_line: false
upper_lower_casing:
keywords:
general: lower
constants:
true_false_null: undefined

tools:
php_code_coverage: true
external_code_coverage: true

0 comments on commit 9e4ca2f

Please sign in to comment.