@@ -53,9 +53,9 @@ private function client()
5353 $ subscribed =& $ this ->subscribed ;
5454 $ psubscribed =& $ this ->psubscribed ;
5555 $ loop = $ this ->loop ;
56- return $ pending = $ this ->factory ->createClient ($ this ->target )->then (function (Client $ client ) use ($ self , &$ pending , &$ idleTimer , &$ subscribed , &$ psubscribed , $ loop ) {
56+ return $ pending = $ this ->factory ->createClient ($ this ->target )->then (function (Client $ redis ) use ($ self , &$ pending , &$ idleTimer , &$ subscribed , &$ psubscribed , $ loop ) {
5757 // connection completed => remember only until closed
58- $ client ->on ('close ' , function () use (&$ pending , $ self , &$ subscribed , &$ psubscribed , &$ idleTimer , $ loop ) {
58+ $ redis ->on ('close ' , function () use (&$ pending , $ self , &$ subscribed , &$ psubscribed , &$ idleTimer , $ loop ) {
5959 $ pending = null ;
6060
6161 // foward unsubscribe/punsubscribe events when underlying connection closes
@@ -77,21 +77,21 @@ private function client()
7777 });
7878
7979 // keep track of all channels and patterns this connection is subscribed to
80- $ client ->on ('subscribe ' , function ($ channel ) use (&$ subscribed ) {
80+ $ redis ->on ('subscribe ' , function ($ channel ) use (&$ subscribed ) {
8181 $ subscribed [$ channel ] = true ;
8282 });
83- $ client ->on ('psubscribe ' , function ($ pattern ) use (&$ psubscribed ) {
83+ $ redis ->on ('psubscribe ' , function ($ pattern ) use (&$ psubscribed ) {
8484 $ psubscribed [$ pattern ] = true ;
8585 });
86- $ client ->on ('unsubscribe ' , function ($ channel ) use (&$ subscribed ) {
86+ $ redis ->on ('unsubscribe ' , function ($ channel ) use (&$ subscribed ) {
8787 unset($ subscribed [$ channel ]);
8888 });
89- $ client ->on ('punsubscribe ' , function ($ pattern ) use (&$ psubscribed ) {
89+ $ redis ->on ('punsubscribe ' , function ($ pattern ) use (&$ psubscribed ) {
9090 unset($ psubscribed [$ pattern ]);
9191 });
9292
9393 Util::forwardEvents (
94- $ client ,
94+ $ redis ,
9595 $ self ,
9696 array (
9797 'message ' ,
@@ -103,7 +103,7 @@ private function client()
103103 )
104104 );
105105
106- return $ client ;
106+ return $ redis ;
107107 }, function (\Exception $ e ) use (&$ pending ) {
108108 // connection failed => discard connection attempt
109109 $ pending = null ;
@@ -122,9 +122,9 @@ public function __call($name, $args)
122122 }
123123
124124 $ that = $ this ;
125- return $ this ->client ()->then (function (Client $ client ) use ($ name , $ args , $ that ) {
125+ return $ this ->client ()->then (function (Client $ redis ) use ($ name , $ args , $ that ) {
126126 $ that ->awake ();
127- return \call_user_func_array (array ($ client , $ name ), $ args )->then (
127+ return \call_user_func_array (array ($ redis , $ name ), $ args )->then (
128128 function ($ result ) use ($ that ) {
129129 $ that ->idle ();
130130 return $ result ;
@@ -148,11 +148,11 @@ public function end()
148148 }
149149
150150 $ that = $ this ;
151- return $ this ->client ()->then (function (Client $ client ) use ($ that ) {
152- $ client ->on ('close ' , function () use ($ that ) {
151+ return $ this ->client ()->then (function (Client $ redis ) use ($ that ) {
152+ $ redis ->on ('close ' , function () use ($ that ) {
153153 $ that ->close ();
154154 });
155- $ client ->end ();
155+ $ redis ->end ();
156156 });
157157 }
158158
@@ -166,8 +166,8 @@ public function close()
166166
167167 // either close active connection or cancel pending connection attempt
168168 if ($ this ->promise !== null ) {
169- $ this ->promise ->then (function (Client $ client ) {
170- $ client ->close ();
169+ $ this ->promise ->then (function (Client $ redis ) {
170+ $ redis ->close ();
171171 });
172172 if ($ this ->promise !== null ) {
173173 $ this ->promise ->cancel ();
@@ -208,8 +208,8 @@ public function idle()
208208 $ idleTimer =& $ this ->idleTimer ;
209209 $ promise =& $ this ->promise ;
210210 $ idleTimer = $ this ->loop ->addTimer ($ this ->idlePeriod , function () use (&$ idleTimer , &$ promise ) {
211- $ promise ->then (function (Client $ client ) {
212- $ client ->close ();
211+ $ promise ->then (function (Client $ redis ) {
212+ $ redis ->close ();
213213 });
214214 $ promise = null ;
215215 $ idleTimer = null ;
0 commit comments