Skip to content

Update dependency boundwize/structarmed to ^0.18.0 - #554

Merged
alexmerlin merged 1 commit into
7.0from
renovate/boundwize-structarmed-0.x
Sep 24, 2026
Merged

alexmerlin merged 1 commit into
7.0from
renovate/boundwize-structarmed-0.x

Conversation

@renovate

@renovate renovate Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
boundwize/structarmed ^0.17.12^0.18.0 age confidence

Release Notes

boundwize/structarmed (boundwize/structarmed)

v0.18.0: Released: StructArmed 0.18.0

Compare Source

ci build PHPStan

StructArmed 0.18.0 improves CI integration and expands YAGNI analysis to named functions.

This release introduces:

  • GitHub Actions annotations with the new --report=github;
  • path exclusions for Architecture::layer();
  • better control over the PHPUnit extension in CI;
  • Boundwize\StructArmed\Rule\UsedFunctionAwareRuleInterface and the new fixable MustBeUsedFunctionRule.

GitHub Actions Report

StructArmed can now report violations directly as GitHub Actions annotations:

vendor/bin/structarmed analyse --report=github

Each violation is emitted as a GitHub workflow error annotation, so violations appear directly on affected files and lines in pull requests.

StructArmed GitHub report annotations

The regular console report is appended after the annotations, so View details still opens a readable StructArmed report in the job log.

For example:

- name: Run StructArmed
  run: vendor/bin/structarmed analyse --report=github

The GitHub report intentionally exits with 0, allowing violations to be surfaced as annotations without failing the job itself.

Use the regular console or json report when violations should fail the job.

The github and json reports also disable the progress bar automatically.

Exclude Paths From Layers

Architecture::layer() now supports excluding one or more nested paths from a layer.

For example:

return Architecture::define()
    ->layer(
        'Logger',
        'src/Logger/',
        excludePath: 'src/Logger/Factory/',
    )
    ->layer('Factory', 'src/Logger/Factory/');

Files under src/Logger/Factory/ now belong to Factory without also belonging to Logger.

Multiple paths can be excluded:

->layer(
    'Logger',
    'src/Logger/',
    excludePath: [
        'src/Logger/Factory/',
        'src/Logger/Formatter/',
    ],
)

The exclusion only applies to that particular layer. A file may still resolve to another matching path layer, namespace-pattern layer, or the automatically registered Source layer.

This mirrors the existing exclusion support in layerPattern() and makes nested architecture boundaries easier to express without changing the directory structure.

YAGNI For Named Functions

The YAGNI preset can now detect unused named functions.

A new rule:

MustBeUsedFunctionRule

checks whether a function is called or otherwise referenced within the scanned code.

For example:

-function legacy_helper(): string
-{
-    return 'unused';
-}

The rule understands usages including:

  • regular function calls;
  • first-class callable references;
  • function-name strings such as 'App\helper';
  • calls from top-level code.

A function that only recursively calls itself still counts as unused.

MustBeUsedFunctionRule supports --fix, removing the unused function automatically. It can also clean up an empty surrounding if (! function_exists(...)) guard and remove the file when only boilerplate remains.

The rule is enabled automatically by:

Preset::YAGNI()

As with the other YAGNI rules, only usages inside the scanned paths are known. Functions intended as public extension points for external consumers can be excluded with skipRule() or skip paths.

UsedFunctionAwareRuleInterface

Custom function rules can opt into function-usage analysis through the new:

Boundwize\StructArmed\Rule\UsedFunctionAwareRuleInterface

It extends FunctionRuleInterface and makes the usage state available through:

$functionNode->isReferenced

For example:

final readonly class CustomRule implements UsedFunctionAwareRuleInterface
{
    public function appliesTo(FunctionNode $functionNode): bool
    {
        return $functionNode->isInLayer('Source');
    }

    public function evaluate(FunctionNode $functionNode): ?RuleViolation
    {
        if ($functionNode->isReferenced) {
            return null;
        }

        // ...
    }
}

Usage analysis is opt-in: StructArmed performs the additional work only when at least one active rule implements UsedFunctionAwareRuleInterface.

PHPUnit Extension Controls

The PHPUnit extension is now easier to control in CI.

Disable StructArmed For One PHPUnit Run

Set:

STRUCTARMED_DISABLED=1 vendor/bin/phpunit

StructArmed remains configured in phpunit.xml, but the extension skips architecture analysis for that run.

This is useful when StructArmed already runs as a dedicated CI step.

Disable Progress Output

PHPUnit's own --no-progress now also disables the StructArmed progress bar:

vendor/bin/phpunit --no-progress

To disable only StructArmed's progress output while preserving PHPUnit's progress display:

<extensions>
    <bootstrap class="Boundwize\StructArmed\PHPUnit\StructArmedExtension">
        <parameter name="progress" value="false"/>
    </bootstrap>
</extensions>

Dependency Update

StructArmed now requires:

"nikic/php-parser": "^5.9"

What's Changed

  • feat: Add GithubReport for Github output with --report=github in #​445
  • Bump nikic/php-parser version to ^5.9 in #​448
  • feat: Support excludePath in Architecture::layer() in #​450
  • feat: Append console report to github report output and exit 0 in #​458
  • feat: Add STRUCTARMED_DISABLED env to disable the PHPUnit extension in #​459
  • feat: Allow disabling progress bar in PHPUnit extension in #​460
  • feat: Add UsedFunctionAwareRuleInterface and MustBeUsedFunctionRule for YAGNI preset in #​462
  • Handle top-level function usage in #​463

Full Changelog: boundwize/structarmed@0.17.12...0.18.0

What's Changed

Full Changelog: boundwize/structarmed@0.17.12...0.18.0


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.80%. Comparing base (14b5de4) to head (b4b4381).

Additional details and impacted files
@@            Coverage Diff            @@
##                7.0     #554   +/-   ##
=========================================
  Coverage     63.80%   63.80%           
  Complexity      989      989           
=========================================
  Files           180      180           
  Lines          3404     3404           
=========================================
  Hits           2172     2172           
  Misses         1232     1232           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Sep 24, 2026

Copy link
Copy Markdown

Qodana for PHP

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Detected 109 dependencies

Third-party software list

This page lists the third-party software dependencies used in project

Dependency Version Licenses
brick/math 1.0.0 MIT
brick/varexporter 0.7.0 MIT
defuse/php-encryption v2.4.0 MIT
doctrine/collections 3.1.0 MIT
doctrine/common 3.5.0 MIT
doctrine/data-fixtures 2.2.1 MIT
doctrine/dbal 4.4.4 MIT
doctrine/deprecations 1.1.6 MIT
doctrine/event-manager 2.1.1 MIT
doctrine/inflector 2.1.0 MIT
doctrine/instantiator 2.1.0 MIT
doctrine/lexer 3.0.2 MIT
doctrine/migrations 3.9.7 MIT
doctrine/orm 3.7.2 MIT
doctrine/persistence 4.2.0 MIT
dotkernel/dot-cache 4.4.0 MIT
dotkernel/dot-cli 3.11.1 MIT
dotkernel/dot-data-fixtures 1.5.0 MIT
dotkernel/dot-dependency-injection 1.4.1 MIT
dotkernel/dot-errorhandler 4.0.2 MIT
dotkernel/dot-event 4.4.0 MIT
dotkernel/dot-log 4.0.6 MIT
dotkernel/dot-mail 5.4.3 MIT
dotkernel/dot-response-header 3.6.0 MIT
dotkernel/dot-router 1.1.0 MIT
egulias/email-validator 4.0.4 MIT
fig/http-message-util 1.1.5 MIT
laminas/laminas-authentication 2.19.0 BSD-3-Clause
laminas/laminas-cli 1.15.0 BSD-3-Clause
laminas/laminas-component-installer 3.8.0 BSD-3-Clause
laminas/laminas-config-aggregator 1.20.0 BSD-3-Clause
laminas/laminas-diactoros 3.8.0 BSD-3-Clause
laminas/laminas-escaper 2.18.0 BSD-3-Clause
laminas/laminas-eventmanager 3.15.0 BSD-3-Clause
laminas/laminas-filter 2.42.0 BSD-3-Clause
laminas/laminas-httphandlerrunner 2.14.0 BSD-3-Clause
laminas/laminas-hydrator 4.19.0 BSD-3-Clause
laminas/laminas-inputfilter 2.35.0 BSD-3-Clause
laminas/laminas-permissions-acl 2.18.0 BSD-3-Clause
laminas/laminas-permissions-rbac 3.8.0 BSD-3-Clause
laminas/laminas-servicemanager 3.24.0 BSD-3-Clause
laminas/laminas-stdlib 3.21.0 BSD-3-Clause
laminas/laminas-stratigility 4.3.1 BSD-3-Clause
laminas/laminas-validator 2.65.0 BSD-3-Clause
lcobucci/jwt 5.6.0 BSD-3-Clause
league/event 3.0.3 MIT
league/oauth2-server 9.4.1 MIT
league/uri-interfaces 7.8.1 MIT
league/uri 7.8.1 MIT
mezzio/mezzio-authentication-oauth2 3.1.0 BSD-3-Clause
mezzio/mezzio-authentication 1.13.0 BSD-3-Clause
mezzio/mezzio-authorization-acl 1.13.0 BSD-3-Clause
mezzio/mezzio-authorization-rbac 1.10.0 BSD-3-Clause
mezzio/mezzio-authorization 1.11.0 BSD-3-Clause
mezzio/mezzio-cors 1.16.0 BSD-3-Clause
mezzio/mezzio-fastroute 3.14.0 BSD-3-Clause
mezzio/mezzio-hal 2.13.0 BSD-3-Clause
mezzio/mezzio-helpers 5.20.0 BSD-3-Clause
mezzio/mezzio-problem-details 1.19.0 BSD-3-Clause
mezzio/mezzio-router 3.20.0 BSD-3-Clause
mezzio/mezzio-template 3.0.0 BSD-3-Clause
mezzio/mezzio 3.28.1 BSD-3-Clause
nikic/fast-route 1.3.1 BSD-3-Clause
nikic/php-parser v5.9.0 BSD-3-Clause
paragonie/random_compat v9.99.100 MIT
phpstan/phpdoc-parser 2.3.5 MIT
psr/cache 3.0.0 MIT
psr/clock 1.0.0 MIT
psr/container 1.1.2 MIT
psr/event-dispatcher 1.0.0 MIT
psr/http-client 1.0.3 MIT
psr/http-factory 1.1.0 MIT
psr/http-message 2.0 MIT
psr/http-server-handler 1.0.2 MIT
psr/http-server-middleware 1.0.2 MIT
psr/link 1.1.1 MIT
psr/log 3.0.2 MIT
radebatz/type-info-extras 1.0.8 MIT
ramsey/collection 2.1.1 MIT
ramsey/uuid-doctrine 2.1.0 MIT
ramsey/uuid 4.9.4 MIT
roave/psr-container-doctrine 6.2.0 BSD-2-Clause
spatie/array-to-xml 3.4.4 MIT
symfony/cache-contracts v3.7.1 MIT
symfony/cache v7.4.19 MIT
symfony/console v7.4.19 MIT
symfony/deprecation-contracts v3.7.1 MIT
symfony/event-dispatcher-contracts v3.7.1 MIT
symfony/event-dispatcher v8.1.5 MIT
symfony/filesystem v7.4.18 MIT
symfony/finder v8.1.7 MIT
symfony/mailer v7.4.19 MIT
symfony/mime v8.1.7 MIT
symfony/polyfill-ctype v1.37.0 MIT
symfony/polyfill-intl-grapheme v1.41.0 MIT
symfony/polyfill-intl-idn v1.42.0 MIT
symfony/polyfill-intl-normalizer v1.42.0 MIT
symfony/polyfill-mbstring v1.38.2 MIT
symfony/polyfill-php86 v1.41.0 MIT
symfony/service-contracts v3.7.3 MIT
symfony/stopwatch v8.1.0 MIT
symfony/string v8.1.7 MIT
symfony/type-info v8.1.5 MIT
symfony/var-exporter v7.4.18 MIT
symfony/yaml v8.1.6 MIT
webimpress/safe-writer 2.2.0 BSD-2-Clause
webmozart/assert 2.4.1 MIT
willdurand/negotiation 3.1.0 MIT
zircote/swagger-php 6.10.0 Apache-2.0
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@alexmerlin
alexmerlin merged commit aad9d6f into 7.0 Sep 24, 2026
40 checks passed
@alexmerlin
alexmerlin deleted the renovate/boundwize-structarmed-0.x branch September 24, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant