PHPackages                             bartlomiejbeta/api-scope-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. [API Development](/categories/api)
4. /
5. bartlomiejbeta/api-scope-bundle

ActiveSymfony-bundle[API Development](/categories/api)

bartlomiejbeta/api-scope-bundle
===============================

Simple API query string scope recognizer

v3.0.1(7y ago)07.3k1[1 PRs](https://github.com/bartlomiejbeta/APIScopeBundle/pulls)MITPHPPHP ^7.1.3

Since Sep 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bartlomiejbeta/APIScopeBundle)[ Packagist](https://packagist.org/packages/bartlomiejbeta/api-scope-bundle)[ RSS](/packages/bartlomiejbeta-api-scope-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)Dependencies (4)Versions (13)Used By (0)

APIScopeBundle
==============

[](#apiscopebundle)

This Symfony bundle aims to provide simple serialization group recognize from query string (with basic security check if you need it).

[![Build Status](https://camo.githubusercontent.com/99395e1a884f04bbc6d2f188eb2cd653845896cd190b270fe8879c10c9eba39c/68747470733a2f2f7472617669732d63692e6f72672f626172746c6f6d69656a626574612f41504953636f706542756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/bartlomiejbeta/APIScopeBundle)

### Installation

[](#installation)

##### 1. Install via composer:

[](#1-install-via-composer)

```
composer require bartlomiejbeta/api-scope-bundle

```

##### 2. Register bundle in `AppKernel`:

[](#2-register-bundle-in-appkernel)

```
public function registerBundles()
{
    $bundles = array(
        // ...
		new BartB\APIScopeBundle\APIScopeBundle(),
    );
}
```

##### 3. Configure in `config.yml`:

[](#3-configure-in-configyml)

```
api_scope:
    scopes:
        api.get_item: #route name
            always_included: #will be always included to scopes bag
                - 'first_always_included_group'
                - 'second_always_included_group'
            supported_key_map:
                external1: { internal_name: 'scope.internal_name1'} #if `external1` will be in the query string than `scope.internal_name1` will be in the scopes bag
                external2:
                    internal_name: 'scope.internal_name2'
                    security: 'can-add-external2-scope' # security voter (check symfony security voter) attribution name (to check if scope can be applied)
```

### Usage

[](#usage)

#### 1. Simple

[](#1-simple)

```
/**
* @ScopeConverter()
* @Rest\Route("/api/item", name="api.get_item")
*/
public function getCarCollection(Request $request, ScopeCollection $scopeCollection): Response
{
	$view = $this->view($scopeCollection, Response::HTTP_OK);

	$scopesFromQueryString = $scopeCollection->getScopes()

	return $this->handleView($view);
}
```

##### example request:

[](#example-request)

```
.../api/item?with[]=external1

```

##### example response:

[](#example-response)

```
{"scopes":["first_always_included_group","second_always_included_group","scope.internal_name1"]}

```

#### 2. Configured

[](#2-configured)

```
/**
* @ScopeConverter(value="scopes",queryString="scope")
* @Rest\Route("/api/item", name="api.get_item")
*/
public function getCarCollection(Request $request, ScopeCollection $scopes): Response
{
	$view = $this->view($scope,Response::HTTP_OK);

	scopesFromQueryString = $scopeCollection->getScopes()

	return $this->handleView($view);
}
```

##### example request:

[](#example-request-1)

```
.../api/item?scope[]=external1&scope[]=external2

```

##### example response:

[](#example-response-1)

```
{"scopes":["first_always_included_group","second_always_included_group","scope.internal_name1","scope.internal_name2"]}

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

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

Recently: every ~68 days

Total

12

Last Release

2728d ago

Major Versions

0.1.0 → 1.0.02017-09-11

1.0.1 → v2.0.02018-02-18

v2.0.5 → v3.0.02018-11-16

PHP version history (2 changes)0.1.0PHP ^7.0

v3.0.1PHP ^7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/74ae63f212d957f86bee321c97a221bc5a464d55ffe7871778bcf8ae17a685fc?d=identicon)[bartlomiejbeta](/maintainers/bartlomiejbeta)

---

Top Contributors

[![bartlomiejbeta](https://avatars.githubusercontent.com/u/17701206?v=4)](https://github.com/bartlomiejbeta "bartlomiejbeta (22 commits)")

---

Tags

apiserializationscope

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bartlomiejbeta-api-scope-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/bartlomiejbeta-api-scope-bundle/health.svg)](https://phpackages.com/packages/bartlomiejbeta-api-scope-bundle)
```

###  Alternatives

[perimeter/rate-limit-bundle

Perimeter RateLimitBundle

411.5k](/packages/perimeter-rate-limit-bundle)

PHPackages © 2026

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