PHPackages                             pimcore/static-resolver-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pimcore/static-resolver-bundle

ActivePimcore-bundle[Utility &amp; Helpers](/categories/utility)

pimcore/static-resolver-bundle
==============================

Pimcore Static Resolver Bundle

v2026.2.0(2w ago)4440.7k↓25.1%72proprietaryPHPPHP ~8.4.0 || ~8.5.0CI passing

Since Aug 11Pushed 4d ago8 watchersCompare

[ Source](https://github.com/pimcore/static-resolver-bundle)[ Packagist](https://packagist.org/packages/pimcore/static-resolver-bundle)[ RSS](/packages/pimcore-static-resolver-bundle/feed)WikiDiscussions 2026.x Synced 2d ago

READMEChangelog (10)Dependencies (38)Versions (62)Used By (2)

Static Resolver Bundle
======================

[](#static-resolver-bundle)

What is the Static Resolver Bundle?
-----------------------------------

[](#what-is-the-static-resolver-bundle)

The Static Resolver Bundle is a Pimcore bundle designed to encapsulate static method calls within a service-oriented architecture. It provides a straightforward mechanism to transform static methods into injectable services, promoting a cleaner, more testable, and well-organized codebase.

In many PHP applications, including Pimcore, static methods are commonly used for utility functions and global operations. While convenient, static methods have several drawbacks:

1. **Testing Difficulties**: Static methods are hard to mock in unit tests
2. **Tight Coupling**: Code using static calls is tightly coupled to the implementation
3. **Hidden Dependencies**: Static dependencies aren't explicit in class constructors

The Static Resolver Bundle addresses these issues by wrapping static calls in service classes that can be properly injected and mocked.

Architecture
------------

[](#architecture)

The bundle follows a consistent pattern for each static class it wraps:

1. **Contract Interfaces**: Define the methods that will be available (e.g., `DbResolverContractInterface`)
2. **Contract Implementations**: Implement the interfaces by wrapping static calls (e.g., `DbResolverContract`)
3. **Bundle-specific Interfaces**: Extend the contract interfaces and are marked as internal (e.g., `DbResolverInterface`)
4. **Bundle-specific Implementations**: Extend the contract implementations and implement the bundle-specific interfaces (e.g., `DbResolver`)

This layered approach allows for flexibility and maintainability while keeping the public API clean.

How to Use the Static Resolver Bundle
-------------------------------------

[](#how-to-use-the-static-resolver-bundle)

### Installation

[](#installation)

1. Install via Composer:

    ```
    composer require pimcore/static-resolver-bundle
    ```
2. Enable the bundle in `config/bundles.php`:

    ```
    use Pimcore\Bundle\StaticResolverBundle\PimcoreStaticResolverBundle;
    // ...

    return [
        // ...
        PimcoreStaticResolverBundle::class => ['all' => true],
        // ...
    ];
    ```

### Using Resolver Services

[](#using-resolver-services)

Instead of using static calls directly in your code, inject the appropriate resolver service and use its methods:

#### Before (with static calls):

[](#before-with-static-calls)

```
use Pimcore\Tool\Authentication;

final class SecurityService implements SecurityServiceInterface
{
    public function getPimcoreUser(): User
    {
        $pimcoreUser = Authentication::authenticateSession();
        if (!$pimcoreUser instanceof User) {
            throw new Exception('No pimcore user found');
        }

        return $pimcoreUser;
    }
}
```

#### After (with resolver service):

[](#after-with-resolver-service)

```
use Pimcore\Bundle\StaticResolverBundle\Contract\Lib\Tools\Authentication\AuthenticationResolverContractInterface;

final class SecurityService implements SecurityServiceInterface
{
     public function __construct(private readonly AuthenticationResolverContractInterface $authenticationResolver
    ) {
    }

    public function getPimcoreUser(): User
    {
        $pimcoreUser = $this->authenticationResolver->authenticateSession();
        if (!$pimcoreUser instanceof User) {
            throw new Exception('No pimcore user found');
        }

        return $pimcoreUser;
    }
}
```

### Available Resolver Services

[](#available-resolver-services)

The bundle provides resolver services for various Pimcore components:

1. **Database Operations**:

    - `Pimcore\Bundle\StaticResolverBundle\Contract\Db\DbResolverContractInterface`
2. **Model Operations**:

    - Various resolvers for DataObject, Asset, Document, etc.
3. **Library Tools**:

    - Authentication, Console, Email, etc.

### Benefits of Using Resolver Services

[](#benefits-of-using-resolver-services)

1. **Improved Testability**: Services can be easily mocked in unit tests
2. **Explicit Dependencies**: Dependencies are clearly visible in constructor parameters
3. **Loose Coupling**: Code depends on interfaces rather than concrete implementations
4. **Consistent API**: The resolver services provide a consistent API for static functionality

Example Use Cases
-----------------

[](#example-use-cases)

### Database Operations

[](#database-operations)

Instead of using `Pimcore\Db` static methods:

```
use Pimcore\Db;

$connection = Db::getConnection();
$data = $connection->fetchAllAssociative('SELECT * FROM users');
```

Use the DbResolver service:

```
use Pimcore\Bundle\StaticResolverBundle\Contract\Db\DbResolverContractInterface;

class UserRepository
{
    public function __construct(private readonly DbResolverContractInterface $dbResolver)
    {
    }

    public function getAllUsers(): array
    {
        $connection = $this->dbResolver->getConnection();
        return $connection->fetchAllAssociative('SELECT * FROM users');
    }
}
```

### Authentication

[](#authentication)

Instead of using `Pimcore\Tool\Authentication` static methods:

```
use Pimcore\Tool\Authentication;

$user = Authentication::authenticateSession();
```

Use the AuthenticationResolver service:

```
use Pimcore\Bundle\StaticResolverBundle\Contract\Lib\Tools\Authentication\AuthenticationResolverContractInterface;

class AuthService
{
    public function __construct(private readonly AuthenticationResolverContractInterface $authenticationResolver)
    {
    }

    public function getCurrentUser()
    {
        return $this->authenticationResolver->authenticateSession();
    }
}
```

Internal Use Examples
---------------------

[](#internal-use-examples)

For internal Pimcore use, you can use the Bundle-specific Interfaces (marked as `@internal`). These interfaces extend the Contract Interfaces and may provide additional functionality specific to Pimcore's internal needs.

### Database Operations (Internal Use)

[](#database-operations-internal-use)

```
use Pimcore\Bundle\StaticResolverBundle\Db\DbResolverInterface;

/**
 * @internal This class is for internal Pimcore use only
 */
class InternalPimcoreService
{
    public function __construct(private readonly DbResolverInterface $dbResolver)
    {
    }

    public function executeInternalQuery(): array
    {
        $connection = $this->dbResolver->getConnection();
        return $connection->fetchAllAssociative('SELECT * FROM internal_table');
    }
}
```

### Authentication (Internal Use)

[](#authentication-internal-use)

```
use Pimcore\Bundle\StaticResolverBundle\Lib\Tools\Authentication\AuthenticationResolverInterface;

/**
 * @internal This class is for internal Pimcore use only
 */
class InternalAuthService
{
    public function __construct(private readonly AuthenticationResolverInterface $authenticationResolver)
    {
    }

    public function validateInternalUser()
    {
        return $this->authenticationResolver->authenticateSession();
    }
}
```

Important Notes
---------------

[](#important-notes)

- All Contract Interfaces in this bundle are designed for third-party developers to use
- Bundle-specific Interfaces (marked as `@internal`) are intended for internal Pimcore use only
- The bundle provides a transition path from static methods to a more service-oriented architecture

Documentation Overview
----------------------

[](#documentation-overview)

- [Installation](doc/01_Installation.md)
- [Resolver Service Usage](doc/02_Resolver_Service_Usage.md)
- [Event Proxy Service Usage (deprecated)](doc/03_Event_Proxy_Service_Usage.md)
- [Interceptor Proxy Service Usage (deprecated)](doc/03_Interceptor_Proxy_Service_Usage.md)
- [Proxy Service Usage (deprecated)](doc/04_Proxy_Service_Usage.md)
- [Upgrade Notes](doc/02_Upgrade_Notes/README.md)

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance98

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~2 days

Total

41

Last Release

17d ago

Major Versions

v1.4.2 → 2.0.x-dev2024-11-28

v2.0.0 → v3.0.0-RC12025-04-22

1.4.x-dev → v2026.1.02026-04-08

v3.6.1 → v2026.1.12026-04-21

3.6.x-dev → 2026.1.x-dev2026-06-10

PHP version history (4 changes)v1.0.0-RC1PHP ~8.1.0 || ~8.2.0

v1.4.1PHP ~8.1.0 || ~8.2.0 || ~8.3.0

v3.0.0-RC1PHP ~8.3.0 || ~8.4.0

v2026.1.0PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/142037?v=4)[Bernhard Rusch](/maintainers/brusch)[@brusch](https://github.com/brusch)

![](https://www.gravatar.com/avatar/fb2f85a3d50811c4d9e10844b4677b8c407adde4173226450dd0bf386914a125?d=identicon)[fashxp](/maintainers/fashxp)

![](https://www.gravatar.com/avatar/1a4f3f1757235f1aa825553d8cc9a0f8fe4def6f406eb37e83220669d2eda268?d=identicon)[herbertroth](/maintainers/herbertroth)

---

Top Contributors

[![herbertroth](https://avatars.githubusercontent.com/u/126679157?v=4)](https://github.com/herbertroth "herbertroth (149 commits)")[![lukmzig](https://avatars.githubusercontent.com/u/30526586?v=4)](https://github.com/lukmzig "lukmzig (47 commits)")[![mcop1](https://avatars.githubusercontent.com/u/89011527?v=4)](https://github.com/mcop1 "mcop1 (40 commits)")[![martineiber](https://avatars.githubusercontent.com/u/11687066?v=4)](https://github.com/martineiber "martineiber (37 commits)")[![mattamon](https://avatars.githubusercontent.com/u/38959016?v=4)](https://github.com/mattamon "mattamon (30 commits)")[![berfinyuksel](https://avatars.githubusercontent.com/u/99557970?v=4)](https://github.com/berfinyuksel "berfinyuksel (11 commits)")[![fashxp](https://avatars.githubusercontent.com/u/8792145?v=4)](https://github.com/fashxp "fashxp (7 commits)")[![Corepex](https://avatars.githubusercontent.com/u/16717695?v=4)](https://github.com/Corepex "Corepex (6 commits)")[![alexz707](https://avatars.githubusercontent.com/u/562324?v=4)](https://github.com/alexz707 "alexz707 (6 commits)")[![jcPimcore](https://avatars.githubusercontent.com/u/259032526?v=4)](https://github.com/jcPimcore "jcPimcore (4 commits)")[![robertSt7](https://avatars.githubusercontent.com/u/104770750?v=4)](https://github.com/robertSt7 "robertSt7 (3 commits)")[![samyemad](https://avatars.githubusercontent.com/u/12701127?v=4)](https://github.com/samyemad "samyemad (2 commits)")[![astapc](https://avatars.githubusercontent.com/u/210384374?v=4)](https://github.com/astapc "astapc (2 commits)")[![kingjia90](https://avatars.githubusercontent.com/u/6014195?v=4)](https://github.com/kingjia90 "kingjia90 (2 commits)")[![jdreesen](https://avatars.githubusercontent.com/u/424602?v=4)](https://github.com/jdreesen "jdreesen (1 commits)")[![mcassier31](https://avatars.githubusercontent.com/u/127942915?v=4)](https://github.com/mcassier31 "mcassier31 (1 commits)")[![dvesh3](https://avatars.githubusercontent.com/u/5137917?v=4)](https://github.com/dvesh3 "dvesh3 (1 commits)")[![pimcore-deployments](https://avatars.githubusercontent.com/u/71881008?v=4)](https://github.com/pimcore-deployments "pimcore-deployments (1 commits)")[![bluvulture](https://avatars.githubusercontent.com/u/7668379?v=4)](https://github.com/bluvulture "bluvulture (1 commits)")[![blankse](https://avatars.githubusercontent.com/u/998558?v=4)](https://github.com/blankse "blankse (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pimcore-static-resolver-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/pimcore-static-resolver-bundle/health.svg)](https://phpackages.com/packages/pimcore-static-resolver-bundle)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.1k5.2k](/packages/shlinkio-shlink)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

46855.5k5](/packages/pimcore-data-importer)[pimcore/object-merger

13583.8k1](/packages/pimcore-object-merger)[pimcore/perspective-editor

Pimcore Perspective Editor

21425.7k](/packages/pimcore-perspective-editor)[pimcore/studio-ui-bundle

Pimcore Studio Ui Bundle

29118.5k19](/packages/pimcore-studio-ui-bundle)[oxid-esales/oxideshop-metapackage-ce

This is OXID eShop compilation metapackage.

13500.5k21](/packages/oxid-esales-oxideshop-metapackage-ce)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
