Browse Source

Add changes from rector rule ReturnNeverTypeRector

Adam Halfar 1 year ago
parent
commit
68eebeb5c0

+ 1 - 1
tests/TestCase/ORM/EntityTest.php

@@ -481,7 +481,7 @@ class EntityTest extends TestCase
         $this->assertFalse($entity->has(['id', 'nope']));
 
         $entity = new class extends Entity {
-            protected function _getThings()
+            protected function _getThings(): never
             {
                 throw new Exception('_getThings() should not have been called');
             }

+ 2 - 2
tests/test_app/TestApp/Controller/PostsController.php

@@ -226,7 +226,7 @@ class PostsController extends AppController
     /**
      * @return \Cake\Http\Response
      */
-    public function throw_exception()
+    public function throw_exception(): never
     {
         $this->Flash->error('Error 1');
         throw new OutOfBoundsException('oh no!');
@@ -235,7 +235,7 @@ class PostsController extends AppController
     /**
      * @return \Cake\Http\Response
      */
-    public function throw_chained()
+    public function throw_chained(): never
     {
         $inner = new RuntimeException('inner badness');
         throw new OutOfBoundsException('oh no!', 1, $inner);

+ 1 - 1
tests/test_app/TestApp/Controller/RequestActionController.php

@@ -166,7 +166,7 @@ class RequestActionController extends AppController
      * @throws \Cake\Http\Exception\NotFoundException
      * @return void
      */
-    public function error_method()
+    public function error_method(): never
     {
         throw new NotFoundException('Not there or here.');
     }

+ 1 - 1
tests/test_app/TestApp/Controller/TestsAppsController.php

@@ -73,7 +73,7 @@ class TestsAppsController extends AppController
         return $this->response->withType('json');
     }
 
-    public function throw_exception()
+    public function throw_exception(): never
     {
         throw new RuntimeException('Foo');
     }

+ 1 - 1
tests/test_app/TestApp/Datasource/FakeConnection.php

@@ -58,7 +58,7 @@ class FakeConnection implements ConnectionInterface
     {
     }
 
-    public function setCacher(CacheInterface $cacher)
+    public function setCacher(CacheInterface $cacher): never
     {
         throw new RuntimeException('Not implemented');
     }