Browse Source

Merge branch 'master' into 4.next

ADmad 6 years ago
parent
commit
7f591c3006

+ 0 - 20
phpstan-baseline.neon

@@ -391,31 +391,11 @@ parameters:
 			path: src/Http/Cookie/CookieCollection.php
 
 		-
-			message: "#^Method Cake\\\\Http\\\\Response\\:\\:withDisabledCache\\(\\) should return static\\(Cake\\\\Http\\\\Response\\) but returns Cake\\\\Http\\\\Response\\.$#"
-			count: 1
-			path: src/Http/Response.php
-
-		-
-			message: "#^Method Cake\\\\Http\\\\Response\\:\\:withCache\\(\\) should return static\\(Cake\\\\Http\\\\Response\\) but returns Cake\\\\Http\\\\Response\\.$#"
-			count: 1
-			path: src/Http/Response.php
-
-		-
-			message: "#^Method Cake\\\\Http\\\\Response\\:\\:withNotModified\\(\\) should return static\\(Cake\\\\Http\\\\Response\\) but returns Cake\\\\Http\\\\Response\\.$#"
-			count: 1
-			path: src/Http/Response.php
-
-		-
 			message: "#^Call to an undefined method DateTimeInterface\\:\\:setTimezone\\(\\)\\.$#"
 			count: 1
 			path: src/Http/Response.php
 
 		-
-			message: "#^Method Cake\\\\Http\\\\Response\\:\\:withFile\\(\\) should return static\\(Cake\\\\Http\\\\Response\\) but returns Cake\\\\Http\\\\Response\\.$#"
-			count: 1
-			path: src/Http/Response.php
-
-		-
 			message: "#^Access to an undefined property Psr\\\\Http\\\\Message\\\\UriInterface\\:\\:\\$webroot\\.$#"
 			count: 3
 			path: src/Http/ServerRequestFactory.php

+ 2 - 2
src/Error/ExceptionRenderer.php

@@ -403,9 +403,9 @@ class ExceptionRenderer implements ExceptionRendererInterface
      */
     protected function _outputMessageSafe(string $template): Response
     {
-        $helpers = ['Form', 'Html'];
         $builder = $this->controller->viewBuilder();
-        $builder->setHelpers($helpers, false)
+        $builder
+            ->setHelpers([], false)
             ->setLayoutPath('')
             ->setTemplatePath('Error');
         $view = $this->controller->createView('View');

+ 0 - 24
src/Http/ServerRequest.php

@@ -110,13 +110,6 @@ class ServerRequest implements ServerRequestInterface
     protected $trustedProxies = [];
 
     /**
-     * Contents of php://input
-     *
-     * @var string
-     */
-    protected $_input;
-
-    /**
      * The built in detectors used with `is()` can be modified with `addDetector()`.
      *
      * There are several ways to specify a detector, see \Cake\Http\ServerRequest::addDetector() for the
@@ -1648,23 +1641,6 @@ class ServerRequest implements ServerRequestInterface
     }
 
     /**
-     * Read data from php://input, mocked in tests.
-     *
-     * @return string contents of php://input
-     */
-    protected function _readInput(): string
-    {
-        if (empty($this->_input)) {
-            $fh = fopen('php://input', 'rb');
-            $content = stream_get_contents($fh);
-            fclose($fh);
-            $this->_input = $content;
-        }
-
-        return $this->_input;
-    }
-
-    /**
      * Update the request with a new request data element.
      *
      * Returns an updated request object. This method returns

+ 1 - 1
tests/TestCase/Error/ExceptionRendererTest.php

@@ -704,7 +704,7 @@ class ExceptionRendererTest extends TestCase
         $response = $ExceptionRenderer->render();
         $helpers = $controller->viewBuilder()->getHelpers();
         sort($helpers);
-        $this->assertEquals(['Form', 'Html'], $helpers);
+        $this->assertEquals([], $helpers);
         $this->assertStringContainsString('Helper class Fail', (string)$response->getBody());
     }