PHPackages                             fousheezy/slim-core - 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. fousheezy/slim-core

ActiveLib

fousheezy/slim-core
===================

Core util classes for Slim Framework

1.1.1(10y ago)0375MITPHP

Since Sep 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/fousheezy/slim-core)[ Packagist](https://packagist.org/packages/fousheezy/slim-core)[ RSS](/packages/fousheezy-slim-core/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (4)Used By (0)

Slim Core Utils
===============

[](#slim-core-utils)

Slim core utility classes which can be re-used across applications.

Installation
============

[](#installation)

`composer require fousheezy/slim-core`

Documentation
=============

[](#documentation)

FzySlimCore\\Util\\Container
----------------------------

[](#fzyslimcoreutilcontainer)

A factory for quickly adding services to the Slim app container

**function registerServices**

- `\Slim\Slim $app`: the slim app to which services will be added
- `array $config`: the array of services configured

This function iterates over the configuration keys, each of which should contain an array. In each of these arrays, the string will be the name you reference on the slim app (e.g. `$app->config_key`)

- **callables**: this array of string key =&gt; callable pairs sets result of invoking the callable as the service value
- **factories**: this array of string key =&gt; string value pairs instantiates the class defined in the value- this class must implement the `\FzySlimCore\Factory\ServiceFactoryInterface`. The result of invoking `getService(\Slim\Slim $app)` becomes the service.
- **invokables**: this array of string key =&gt; string value pairs instantiates the class defined in value as a singleton. **However** if the key maps to an array, the array is used as a configuration for instantiating a class.

### Invokable Array

[](#invokable-array)

Instantiating a service via an array configuration in the invokables section is very convenient.

- The array must contain a `class` key, which will specify a string class name to be instantiated.
- The array can optionally contain an `arguments` key which specifies an array of constructor arguments for the class. **Note** You can specify a service by using a string `"@serviceKey"` which the container class will automatically convert into the real service for you.
- The array can optionally contain a `calls` key which specifies a list of object methods to be invoked after instantiation. This is done by setting `calls` to an array of arrays. Each sub-array should have two values; the first value is treated as a string method name, and the second value is treated as an array of arguments to be passed to that method. As with the constructor, @ prefixed strings will be converted to their representative services.

Example:

```
'invokables' => [
    'my_service' => '\MyNamespace\Service\MyService',
    'second_service' => [
        'class' => '\MyNamespace\Service\SecondService'
        'arguments' => ['@my_service', 'a regular string', 3],
        'calls' => [
            ['registerHandler', ['@my_service3', 45]]
            ['setTimeout', [1]]
        ]
    ],
    'my_service3' => '\MyNamespace\Service\ThirdService',
]

```

In the example above, the $app will have 3 services `my_service`, `second_service` and `my_service3`. The first and last services are simple string definitions so they will be instantiated and returned

```
/* @var $service \MyNamespace\Service\MyService */
$service = $app->my_service;

```

```
/* @var $service \MyNamespace\Service\ThirdService */
$service = $app->my_service3;

```

The `second_service` key will effectively run the following in order, when setting itself up:

```
    $service = new \MyNamespace\Service\SecondService($app->my_service, 'a regular string', 3);
    $service->registerHandler($app->my_service3, 45);
    $service->setTimeout(1);
    $app->second_service = $service;

```

FzySlimCore\\Util\\Mode
-----------------------

[](#fzyslimcoreutilmode)

A utility class for setting mode configurations on the slim app

**static function configureModes**

- `\Slim\Slim $app`: the slim app to which the modes will be applied
- `array $modeConfigs`: the array of modes to be configured

This function iterates over the mode configurations. Each key is treated as the mode name, each value is the array of configurations specific to that mode

FzySlimCore\\Util\\Page
-----------------------

[](#fzyslimcoreutilpage)

A class to contain pagination parameter information.

FzySlimCore\\Util\\Params
-------------------------

[](#fzyslimcoreutilparams)

A class to contain an iterable set of data and access it without checking for whether the key exists.

FzySlimCore\\Util\\Result
-------------------------

[](#fzyslimcoreutilresult)

A pagination result class which standardizes the format of REST responses.

###  Health Score

29

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~13 days

Total

3

Last Release

3828d ago

### Community

Maintainers

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

---

Top Contributors

[![foush](https://avatars.githubusercontent.com/u/708458?v=4)](https://github.com/foush "foush (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fousheezy-slim-core/health.svg)

```
[![Health](https://phpackages.com/badges/fousheezy-slim-core/health.svg)](https://phpackages.com/packages/fousheezy-slim-core)
```

###  Alternatives

[slim/twig-view

Slim Framework 4 view helper built on top of the Twig 3 templating component

3707.8M192](/packages/slim-twig-view)[php-di/slim-bridge

PHP-DI integration in Slim

1786.5M82](/packages/php-di-slim-bridge)[bacula-web/bacula-web

The open source web based reporting and monitoring tool for Bacula

1537.5k](/packages/bacula-web-bacula-web)

PHPackages © 2026

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