Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue with private fields and late static bindings #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/PAGI/Client/Impl/ClientImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ class ClientImpl extends AbstractClient
* Current instance.
* @var ClientImpl
*/
private static $instance = false;
protected static $instance = false;

/**
* AGI input
* @var stream
*/
private $input;
protected $input;

/**
* AGI output
* @var stream
*/
private $output;
protected $output;

/**
* Sends a command to asterisk. Returns an array with:
Expand Down Expand Up @@ -164,13 +164,11 @@ protected function read()
*/
public static function getInstance(array $options = array())
{
if (self::$instance === false) {
$ret = new ClientImpl($options);
self::$instance = $ret;
} else {
$ret = self::$instance;
if (static::$instance === false) {
static::$instance = new static($options);
}
return $ret;

return static::$instance;
}

/**
Expand Down