Skip to content

Commit

Permalink
chore: update package skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
grmvoid committed Jan 16, 2025
1 parent ffe5688 commit 51f5c3a
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 46 deletions.
69 changes: 44 additions & 25 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php declare(strict_types=1);

/*
* This file is part of the sxbrsky/dependency-injection.
* This file is part of the :vendor/:package_name.
*
* Copyright (C) 2024 Dominik Szamburski
* Copyright (C) 2024 :vendor
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
Expand All @@ -16,28 +16,47 @@
->ignoreVCSIgnored(true);

$config = new \PhpCsFixer\Config();
$config
->setFinder($finder)
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'include' => true,
'new_with_braces' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'multiline_whitespace_before_semicolons' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
]);
$config->setFinder($finder)
->setRules(
[
'@PSR12' => 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,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'braces' => [
'allow_single_line_closure' => true,
'position_after_anonymous_constructs' => 'same',
'position_after_functions_and_oop_constructs' => 'next',
'position_after_control_structures' => 'same',
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
]
);

return $config;
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) [Year] Vendor Name
Copyright (c) [Year] :vendor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# package-skeleton
# :package_name

<div align="center">

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/sxbrsky/php-package-skeleton/ci.yml)
![Packagist Downloads](https://img.shields.io/packagist/dt/sxbrsky/package-skeleton)
![Packagist Version](https://img.shields.io/packagist/v/sxbrsky/package-skeleton)
![Packagist License](https://img.shields.io/packagist/l/sxbrsky/package-skeleton)
![Packagist Downloads](https://img.shields.io/packagist/dt/:vendor/:package_name)
![Packagist Version](https://img.shields.io/packagist/v/:vendor/:package_name)
![Packagist License](https://img.shields.io/packagist/l/:vendor/:package_name)

</div>

:package_description

## Resources

- [Issues](https://github.com/sxbrsky/php-package-skeleton/issues/)
- [Issues](https://github.com/:vendor/:package_name/issues/)
- [Documentation]()

## License
Expand Down
20 changes: 11 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
{
"name": "sxbrsky/package-skeleton",
"description": "Boilerplate PHP library.",
"name": ":vendor/:package_name",
"description": ":package_description",
"license": "MIT",
"type": "library",
"keywords": [],
"authors": [
{
"name": "Dominik Szamburski",
"email": "[email protected]"
"name": ":author_name",
"email": ":author_email"
}
],
"homepage": "https://github.com/:vendor/:package_name",
"require": {
"php": ">=8.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "dev-master",
"phpstan/phpstan": "2.0.x-dev",
"phpunit/phpunit": "^11.4.x-dev"
"friendsofphp/php-cs-fixer": "^3.68",
"phpstan/phpstan": "^2.1.x-dev",
"phpstan/phpstan-strict-rules": "^2.0.x-dev",
"phpunit/phpunit": "^11.5"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"Vendor\\Project\\": "src/"
"Vendor\\Skeleton\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Vendor\\Project\\Tests\\Unit\\": "tests/unit/"
"Vendor\\Skeleton\\Tests\\": "tests/"
}
},
"config": {
Expand Down
2 changes: 2 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors:
20 changes: 15 additions & 5 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- phpstan-baseline.neon

parameters:
tmpDir: .phpstan.cache
level: max
treatPhpDocTypesAsCertain: false
paths:
- src
level: max

paths:
- src/

excludePaths:
- */vendor/

checkImplicitMixed: true
checkBenevolentUnionTypes: true
treatPhpDocTypesAsCertain: false
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
</testsuites>
<source restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
<directory suffix=".php">./src</directory>
</include>
</source>
<php>
<ini name="error_reporting" value="24575"/>
</php>
</phpunit>

File renamed without changes.

0 comments on commit 51f5c3a

Please sign in to comment.