@@ -29,18 +29,17 @@ class RedisProxiesTest extends TestCase
2929 */
3030 public function testRedisProxy ($ class )
3131 {
32- $ version = version_compare (phpversion ('redis ' ), '6 ' , '> ' ) ? '6 ' : '5 ' ;
33- $ proxy = file_get_contents (\dirname (__DIR__ , 2 )."/Traits/ {$ class }{$ version }Proxy.php " );
32+ $ proxy = file_get_contents (\dirname (__DIR__ , 2 )."/Traits/ {$ class }Proxy.php " );
3433 $ proxy = substr ($ proxy , 0 , 2 + strpos ($ proxy , '[]; ' ));
3534 $ expected = substr ($ proxy , 0 , 2 + strpos ($ proxy , '} ' ));
3635 $ methods = [];
3736
38- foreach ((new \ReflectionClass (\sprintf ('Symfony\Component\Cache\Traits \\%s%dProxy ' , $ class, $ version )))->getMethods () as $ method ) {
39- if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name )) {
37+ foreach ((new \ReflectionClass (\sprintf ('Symfony\Component\Cache\Traits \\%sProxy ' , $ class )))->getMethods () as $ method ) {
38+ if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name ) || $ method -> isInternal () ) {
4039 continue ;
4140 }
4241 $ return = '__construct ' === $ method ->name || $ method ->getReturnType () instanceof \ReflectionNamedType && 'void ' === (string ) $ method ->getReturnType () ? '' : 'return ' ;
43- $ methods [$ method ->name ] = "\n " .ProxyHelper::exportSignature ($ method , false , $ args )."\n" .<<<EOPHP
42+ $ methods [$ method ->name ] = "\n " .ProxyHelper::exportSignature ($ method , true , $ args )."\n" .<<<EOPHP
4443 {
4544 {$ return }\$this->initializeLazyObject()-> {$ method ->name }( {$ args });
4645 }
@@ -54,7 +53,7 @@ public function testRedisProxy($class)
5453 $ methods = [];
5554
5655 foreach ((new \ReflectionClass ($ class ))->getMethods () as $ method ) {
57- if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name ) ) {
56+ if ('__destruct ' === $ method ->name || ' reset ' === $ method ->name ) {
5857 continue ;
5958 }
6059 $ return = '__construct ' === $ method ->name || $ method ->getReturnType () instanceof \ReflectionNamedType && 'void ' === (string ) $ method ->getReturnType () ? '' : 'return ' ;
@@ -88,12 +87,12 @@ public function testRelayProxy()
8887 $ expectedMethods = [];
8988
9089 foreach ((new \ReflectionClass (RelayProxy::class))->getMethods () as $ method ) {
91- if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name ) || $ method ->isStatic ()) {
90+ if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name ) || $ method ->isInternal ()) {
9291 continue ;
9392 }
9493
9594 $ return = '__construct ' === $ method ->name || $ method ->getReturnType () instanceof \ReflectionNamedType && 'void ' === (string ) $ method ->getReturnType () ? '' : 'return ' ;
96- $ expectedMethods [$ method ->name ] = "\n " .ProxyHelper::exportSignature ($ method , false , $ args )."\n" .<<<EOPHP
95+ $ expectedMethods [$ method ->name ] = "\n " .ProxyHelper::exportSignature ($ method , true , $ args )."\n" .<<<EOPHP
9796 {
9897 {$ return }\$this->initializeLazyObject()-> {$ method ->name }( {$ args });
9998 }
@@ -102,7 +101,7 @@ public function testRelayProxy()
102101 }
103102
104103 foreach ((new \ReflectionClass (Relay::class))->getMethods () as $ method ) {
105- if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name ) || $ method ->isStatic ()) {
104+ if ('__destruct ' === $ method ->name || ' reset ' === $ method ->name || $ method ->isStatic ()) {
106105 continue ;
107106 }
108107 $ return = '__construct ' === $ method ->name || $ method ->getReturnType () instanceof \ReflectionNamedType && 'void ' === (string ) $ method ->getReturnType () ? '' : 'return ' ;
@@ -135,12 +134,12 @@ public function testRelayClusterProxy()
135134 $ expectedMethods = [];
136135
137136 foreach ((new \ReflectionClass (RelayClusterProxy::class))->getMethods () as $ method ) {
138- if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name ) || $ method ->isStatic ()) {
137+ if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name ) || $ method ->isInternal ()) {
139138 continue ;
140139 }
141140
142141 $ return = '__construct ' === $ method ->name || $ method ->getReturnType () instanceof \ReflectionNamedType && 'void ' === (string ) $ method ->getReturnType () ? '' : 'return ' ;
143- $ expectedMethods [$ method ->name ] = "\n " .ProxyHelper::exportSignature ($ method , false , $ args )."\n" .<<<EOPHP
142+ $ expectedMethods [$ method ->name ] = "\n " .ProxyHelper::exportSignature ($ method , true , $ args )."\n" .<<<EOPHP
144143 {
145144 {$ return }\$this->initializeLazyObject()-> {$ method ->name }( {$ args });
146145 }
@@ -149,7 +148,7 @@ public function testRelayClusterProxy()
149148 }
150149
151150 foreach ((new \ReflectionClass (RelayCluster::class))->getMethods () as $ method ) {
152- if ('reset ' === $ method ->name || method_exists (RedisProxyTrait::class, $ method ->name ) || $ method ->isStatic ()) {
151+ if ('__destruct ' === $ method ->name || ' reset ' === $ method ->name || $ method ->isStatic ()) {
153152 continue ;
154153 }
155154 $ return = '__construct ' === $ method ->name || $ method ->getReturnType () instanceof \ReflectionNamedType && 'void ' === (string ) $ method ->getReturnType () ? '' : 'return ' ;
0 commit comments