norkunas / onesignal-php-api

OneSignal API for PHP
MIT License
233 stars 82 forks source link

v0.1.11 introduces BC-break #56

Closed tixastronauta closed 7 years ago

tixastronauta commented 7 years ago

Release v.0.1.11 should be a major release as it introduces a bc-break.

My previously working code, now crashes because I'm not injecting a Client into OneSignal constructor. In v.0.1.10 there was no need to inject a Client because a new Guzzle Client was instantiated.

norkunas commented 7 years ago

@tixastronauta constructor in 0.1 doesn't changed and it instantiates guzzle as before you don't inject it

tixastronauta commented 7 years ago

@norkunas from my understanding that is not the case.

Constructor at 0.1.10

public function __construct(Config $config = null, Client $client = null)
{
    $this->config = ($config ?: new Config());
    $this->client = ($client ?: new Client([
        'defaults' => [
            'headers' => [
                'Accept' => 'application/json',
            ],
        ],
    ]));
}

Constructor at 0.1.11

public function __construct(Config $config = null, Client $client = null)
{
    $this->config = ($config ?: new Config());
    if (null !== $client) {
        $this->client = $client;
    }
}
norkunas commented 7 years ago

@tixastronauta sorry, master was target in release. should be good now.

tixastronauta commented 7 years ago

Awesome @norkunas 👍 ! Thank you!