PHPackages                             setono/symfony-main-request-trait - 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. setono/symfony-main-request-trait

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

setono/symfony-main-request-trait
=================================

A PHP trait that makes the main/master request issue work on multiple Symfony versions

v1.0.0(3y ago)0348.7k—6.6%25MITPHPPHP &gt;=7.4

Since Jun 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Setono/symfony-main-request-trait)[ Packagist](https://packagist.org/packages/setono/symfony-main-request-trait)[ RSS](/packages/setono-symfony-main-request-trait/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (5)

Symfony Main Request Trait
==========================

[](#symfony-main-request-trait)

[![Latest Version](https://camo.githubusercontent.com/8fa5be54ca34688ae0f383c8fd5ce47da951e78fb90f8030bde62a6dea83bacb/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f73796d666f6e792d6d61696e2d726571756573742d74726169742f762f737461626c65)](https://packagist.org/packages/setono/symfony-main-request-trait)[![Software License](https://camo.githubusercontent.com/8818a09c4eb094f212a7153833e9866677b52340ec95582f21822c8b54435e64/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f73796d666f6e792d6d61696e2d726571756573742d74726169742f6c6963656e7365)](LICENSE)[![Build Status](https://github.com/Setono/symfony-main-request-trait/workflows/build/badge.svg)](https://github.com/Setono/symfony-main-request-trait/actions)[![Code Coverage](https://camo.githubusercontent.com/20f86ecb5b0f1123e5ef392a23feb41567fb7c80e14ec6e4cdfcd2cabe476e38/68747470733a2f2f636f6465636f762e696f2f67682f5365746f6e6f2f73796d666f6e792d6d61696e2d726571756573742d74726169742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Setono/symfony-main-request-trait)[![Mutation testing](https://camo.githubusercontent.com/eee392c4c1a2537b4d9c9b4de1fe5cb0d688f844d22f9686f1787f934db8c5be/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532465365746f6e6f25324673796d666f6e792d6d61696e2d726571756573742d74726169742532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/Setono/symfony-main-request-trait/master)

A convenience library for library maintainers of Symfony bundles or libraries using Symfony components. When Symfony changed the naming from `master` to `main` in multiple places this had the consequence that certain methods were deprecated in Symfony v5 and removed in v6.

This library will let you support Symfony v4-v6 and not even think about the renaming :)

Installation
------------

[](#installation)

```
composer require setono/symfony-main-request-trait
```

Usage
-----

[](#usage)

**Example with the `RequestStack`**

```
