Skip to content

Commit

Permalink
[Upgrade] Add info about upgrading From 7.x to 8.0 (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregurco authored Jan 9, 2020
1 parent d13fb73 commit a0a4f9f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,48 @@

This document describes the changes needed when upgrading from one version to another.

## Upgrading From 7.x to 8.0

### Step 1: upgrade PHP and Symfony

Minimum required PHP version was raised to 7.1 and Symfony to 4.0.
[Rector](https://github.com/rectorphp/rector) can help you with migration.

### Step 2: remove usage of GuzzleEventListenerInterface

The interface `GuzzleEventListenerInterface` was removed.
Please read the [documentation](https://github.com/8p/EightPointsGuzzleBundle#listening-to-events) in case you want to listen pre/post translation events for specific client.

### Step 3: follow strict typing rules

If your classes are overriding some classes from bundle, then check that all methods are following arguments and return types.

### Step 4: replace usage of EightPointsGuzzleBundlePlugin interface

before:
```php
use EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundlePlugin;

class Foo implements EightPointsGuzzleBundlePlugin
{

}
```

after:
```php
use EightPoints\Bundle\GuzzleBundle\PluginInterface;

class Foo implements PluginInterface
{

}
```

## Upgrading From 6.x to 7.0

### Step 1: change namespace in AppKernel

before:
```php
public function registerBundles()
Expand All @@ -30,6 +69,7 @@ public function registerBundles()
```

### Step 2: change config key in app/config/config.yml

before:
```yaml
guzzle:
Expand All @@ -47,6 +87,7 @@ eight_points_guzzle:
```
### Step 3: move headers key under options config
before:
```yaml
guzzle:
Expand All @@ -69,6 +110,7 @@ eight_points_guzzle:
```
### Step 4: client call
before:
```php
$this->get('guzzle.client.api_crm');
Expand All @@ -80,6 +122,7 @@ $this->get('eight_points_guzzle.client.api_crm');
```

### Step 5: event listeners definition

before:
```xml
<service id="listenerID" class="Your\ListenerClass\That\Implements\GuzzleEventListenerInterface">
Expand All @@ -95,6 +138,7 @@ after:
```

### Step 6: if you have created any services, you should change name

before:
```xml
<argument type="service" id="guzzle.client.xyz" />
Expand Down

0 comments on commit a0a4f9f

Please sign in to comment.