Skip to content

Commit

Permalink
add dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mimmi20 committed May 13, 2024
1 parent aff11e8 commit 0abdf68
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ updates:
- dependency-name: "psr/container"
versions:
- ">= 0"
# - dependency-name: phpunit/phpunit
# versions:
# - ">= 0"
- dependency-name: "nikic/php-parser"
versions:
- ">= 0"
# - dependency-name: mezzio/mezzio-authentication
# versions:
# - ">= 0"
Expand Down
65 changes: 38 additions & 27 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",

"extends": ["github>whitesource/merge-confidence:beta"],
"extends": ["mergeConfidence:all-badges"],

"enabled": true,

"enabled": false,
"assignees": [
"mimmi20"
],
"automerge": false,
"branchConcurrentLimit": 0,
"commitBody": "Signed-off-by: {{{gitAuthor}}}",
"commitBodyTable": true,
"dependencyDashboard": false,
"enabledManagers": ["composer", "github-actions", "npm"],
"ignoreUnstable": true,
"configMigration": true,
"configWarningReuseIssue": false,
"dependencyDashboard": true,
"dependencyDashboardApproval": true,
"dependencyDashboardOSVVulnerabilitySummary": "all",
"labels": [
"dependencies",
"patch"
"dependencies"
],
"lockFileMaintenance": {
"enabled": false
},
"osvVulnerabilityAlerts": true,
"platformAutomerge": false,
"prBodyColumns": [
"Package",
Expand All @@ -33,41 +33,52 @@
"Update": "{{{updateType}}}",
"Change": "[{{#if displayFrom}}`{{{displayFrom}}}` -> {{else}}{{#if currentValue}}`{{{currentValue}}}` -> {{/if}}{{/if}}{{#if displayTo}}`{{{displayTo}}}`{{else}}`{{{newValue}}}`{{/if}}]({{#if depName}}https://renovatebot.com/diffs/npm/{{replace '/' '%2f' depName}}/{{{currentVersion}}}/{{{newVersion}}}{{/if}})"
},
"prConcurrentLimit": 0,
"prCreation": "immediate",
"prHourlyLimit": 0,
"rangeStrategy": "bump",
"rebaseWhen": "behind-base-branch",
"reviewers": [
"mimmi20"
],
"rollbackPrs": true,
"schedule": ["at 4:00 am on Monday"],
"semanticCommits": "disabled",
"separateMajorMinor": true,
"separateMinorPatch": false,
"timezone": "Europe/Berlin",
"updateLockFiles": false,
"updateNotScheduled": false,
"packageRules": [
{
"groupName": "PHP",
"matchDepNames": ["php"],
"allowedVersions": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"ignoreUnstable": false,
"rangeStrategy": "widen"
},
{
"groupName": "Node",
"matchDepNames": ["node"],
"allowedVersions": "~19.5.0 || ~20.0.0 || ~21.0.0 || ~22.0.0",
"ignoreUnstable": false,
"rangeStrategy": "widen"
},
{
"groupName": "devDependencies",
"matchDepTypes": ["devDependencies", "peerDependencies"],
"rangeStrategy": "widen"
},
{
"matchPackageNames": ["nikic/php-parser"],
"rangeStrategy": "widen"
},
{
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch-dependencies",
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"minor",
"patch"
]
},
{
"groupName": "PHP",
"matchPackageNames": ["php"],
"allowedVersions": "^8.1",
"ignoreUnstable": false,
"rangeStrategy": "widen"
}
],
"vulnerabilityAlerts": {
"enabled": true
"enabled": true,
"labels": ["security"]
}
}
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
composer-options: "--optimize-autoloader --prefer-dist --prefer-stable -v"
skip-php-install: false
skip-npm-install: true

analytics:
name: "Project Analysis"
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@
"infection/infection": "^0.27.11",
"laminas/laminas-servicemanager": "^4.1.0",
"mimmi20/coding-standard": "^5.2.29",
"nikic/php-parser": "^4.19.1",
"nikic/php-parser": "^v4.19.1 || ^v5.0.2",
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.67",
"phpstan/phpstan-deprecation-rules": "^1.1.4",
"phpstan/phpstan-phpunit": "^1.3.16",
"phpunit/phpunit": "^10.5.20",
"rector/rector": "^1.0.5"
"rector/rector": "^1.0.5",
"symplify/phpstan-rules": "^12.4.9",
"tomasvotruba/cognitive-complexity": "^0.2.3",
"tomasvotruba/type-coverage": "^0.2.8",
"tomasvotruba/unused-public": "^0.3.9"
},
"conflict": {
"container-interop/container-interop": "<1.2.0",
Expand Down
80 changes: 80 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,85 @@ parameters:
missingCheckedExceptionInThrows: true
tooWideThrowType: true

cognitive_complexity:
class: 9
function: 9

type_coverage:
return: 100
param: 100
property: 100
# also, how many files has declare strict types
declare: 100

unused_public:
methods: true
properties: true
constants: true
local_methods: true

# ignoreErrors:
# - '~Call to static method .* with .* will always evaluate to true~'

rules:
# code complexity
- Symplify\PHPStanRules\Rules\Explicit\NoMixedPropertyFetcherRule
- Symplify\PHPStanRules\Rules\Explicit\NoMixedMethodCallerRule
- Symplify\PHPStanRules\Rules\Enum\RequireEnumDocBlockOnConstantListPassRule
- Symplify\PHPStanRules\Rules\NoDynamicNameRule
- Symplify\PHPStanRules\Rules\Explicit\NoRelativeFilePathRule
# - Symplify\PHPStanRules\Rules\NoReturnArrayVariableListRule # todo: fix

- Symplify\PHPStanRules\Rules\NoProtectedClassElementRule
- Symplify\PHPStanRules\Rules\ForbiddenExtendOfNonAbstractClassRule
- Symplify\PHPStanRules\Rules\Complexity\ForbiddenSameNamedNewInstanceRule

# domain
- Symplify\PHPStanRules\Rules\Domain\RequireExceptionNamespaceRule
- Symplify\PHPStanRules\Rules\Domain\RequireAttributeNamespaceRule
- Symplify\PHPStanRules\Rules\Enum\RequireUniqueEnumConstantRule
- Symplify\PHPStanRules\Rules\ForbiddenParamTypeRemovalRule
- Symplify\PHPStanRules\Rules\PreventParentMethodVisibilityOverrideRule

# paths
- Symplify\PHPStanRules\Rules\NoMissingDirPathRule
- Symplify\PHPStanRules\Rules\NoAbstractMethodRule
- Symplify\PHPStanRules\Rules\NoReferenceRule # References are required
- Symplify\PHPStanRules\Rules\NoArrayAccessOnObjectRule

- Symplify\PHPStanRules\Rules\NoNullableArrayPropertyRule
- Symplify\PHPStanRules\Rules\BoolishClassMethodPrefixRule

# dead-code
- Symplify\PHPStanRules\Rules\NoIssetOnObjectRule

# explicit naming
- Symplify\PHPStanRules\Rules\ForbiddenMultipleClassLikeInOneFileRule

# comlexity
- Symplify\PHPStanRules\Rules\Complexity\ForbiddenSameNamedNewInstanceRule
- Symplify\PHPStanRules\Rules\NarrowType\NoReturnFalseInNonBoolClassMethodRule

- Symplify\PHPStanRules\Rules\Complexity\ForbiddenArrayMethodCallRule
# - Symplify\PHPStanRules\Rules\CheckRequiredInterfaceInContractNamespaceRule
- Symplify\PHPStanRules\Rules\NoEmptyClassRule

# naming
- Symplify\PHPStanRules\Rules\RequireAttributeNameRule

# regexes
- Symplify\PHPStanRules\Rules\AnnotateRegexClassConstWithRegexLinkRule
- Symplify\PHPStanRules\Rules\NoInlineStringRegexRule
- Symplify\PHPStanRules\Rules\RegexSuffixInRegexConstantRule

# naming
- Symplify\PHPStanRules\Rules\Explicit\ExplicitClassPrefixSuffixRule
- Symplify\PHPStanRules\Rules\NoReturnSetterMethodRule
- Symplify\PHPStanRules\Rules\NoVoidGetterMethodRule
- Symplify\PHPStanRules\Rules\UppercaseConstantRule
- Symplify\PHPStanRules\Rules\ClassNameRespectsParentSuffixRule
- Symplify\PHPStanRules\Rules\CheckTypehintCallerTypeRule
- Symplify\PHPStanRules\Rules\CheckClassNamespaceFollowPsr4Rule

includes:
- vendor/symplify/phpstan-rules/config/collector-rules.neon
3 changes: 3 additions & 0 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function __invoke(): array
* @throws void
*
* @phpcs:disable Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed
* @api
*/
public function getAuthorizationConfig(): array
{
Expand Down Expand Up @@ -80,6 +81,8 @@ public function getAuthorizationConfig(): array
* @return array<string, array<string, string>>
*
* @throws void
*
* @api
*/
public function getDependencies(): array
{
Expand Down

0 comments on commit 0abdf68

Please sign in to comment.