diff --git a/phpstan.neon b/phpstan.neon index 220fd4c74e9..ed288813e84 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,7 +4,6 @@ parameters: ignoreErrors: - '#Function wincache_ucache_[a-zA-Z0-9_]+ not found#' - '#Function xcache_[a-zA-Z0-9_]+ not found#' - - '#Function fastcgi_[a-zA-Z0-9_]+ not found#' - '#Cake\\Database\\Type\\[a-zA-Z0-9_]+Type::__construct\(\) does not call parent constructor from Cake\\Database\\Type#' - '#Constructor of class Cake\\[a-zA-Z0-9_\\]+ has an unused parameter#' - '#Call to an undefined method Cake\\Console\\Shell::main\(\)#' diff --git a/src/Cache/Engine/ApcEngine.php b/src/Cache/Engine/ApcEngine.php index fcdcf8c8d0a..5bf72fa2efa 100644 --- a/src/Cache/Engine/ApcEngine.php +++ b/src/Cache/Engine/ApcEngine.php @@ -230,6 +230,7 @@ public function groups() */ public function clearGroup($group) { + $success = false; apcu_inc($this->_config['prefix'] . $group, 1, $success); return $success; diff --git a/src/Console/CommandCollection.php b/src/Console/CommandCollection.php index 61d12a58101..4cf3e242422 100644 --- a/src/Console/CommandCollection.php +++ b/src/Console/CommandCollection.php @@ -116,7 +116,7 @@ public function has($name) * Get the target for a command. * * @param string $name The named shell. - * @return string|Cake\Console\Shell Either the shell class or an instance. + * @return string|\Cake\Console\Shell Either the shell class or an instance. * @throws \InvalidArgumentException when unknown commands are fetched. */ public function get($name) diff --git a/src/Http/Client/Request.php b/src/Http/Client/Request.php index 8da9af12340..72b72b4ceee 100644 --- a/src/Http/Client/Request.php +++ b/src/Http/Client/Request.php @@ -186,7 +186,7 @@ protected function addHeaders(array $headers) * @param string $name The name of the cookie to get/set * @param string|null $value Either the value or null when getting values. * @return mixed Either $this or the cookie value. - * @deprected 3.5.0 No longer used. CookieCollections now add `Cookie` header to the request + * @deprecated 3.5.0 No longer used. CookieCollections now add `Cookie` header to the request * before sending. Use Cake\Http\Cookie\CookieCollection::addToRequest() to make adding cookies * to a request easier. */ diff --git a/src/Http/Response.php b/src/Http/Response.php index a5f07758666..49897e3983b 100644 --- a/src/Http/Response.php +++ b/src/Http/Response.php @@ -1153,7 +1153,7 @@ public function mapType($ctype) * * @param string|null $charset Character set string. * @return string Current charset - * @deprecated 3.4.0 Use withCharset() instead. + * @deprecated 3.5.0 Use getCharset()/withCharset() instead. */ public function charset($charset = null) { @@ -1166,6 +1166,16 @@ public function charset($charset = null) return $this->_charset; } + /** + * Retruns the current charset. + * + * @return string + */ + public function getCharset() + { + return $this->_charset; + } + /** * Get a new instance with an updated charset. * @@ -1185,7 +1195,7 @@ public function withCharset($charset) * Sets the correct headers to instruct the client to not cache the response * * @return void - * @deprected 3.4.0 Use withDisabledCache() instead. + * @deprecated 3.4.0 Use withDisabledCache() instead. */ public function disableCache() { diff --git a/src/ORM/Association/DependentDeleteTrait.php b/src/ORM/Association/DependentDeleteTrait.php index 30d81ab6be8..f172d4c9a30 100644 --- a/src/ORM/Association/DependentDeleteTrait.php +++ b/src/ORM/Association/DependentDeleteTrait.php @@ -22,7 +22,7 @@ * * Included by HasOne and HasMany association classes. * - * @deprected 3.5.0 Unused in CakePHP now. This class will be removed in 4.0.0 + * @deprecated 3.5.0 Unused in CakePHP now. This class will be removed in 4.0.0 */ trait DependentDeleteTrait { diff --git a/tests/TestCase/Http/ResponseTest.php b/tests/TestCase/Http/ResponseTest.php index e2b8b02962d..2bf85ecd4f1 100644 --- a/tests/TestCase/Http/ResponseTest.php +++ b/tests/TestCase/Http/ResponseTest.php @@ -144,7 +144,7 @@ public function testCharset() } /** - * Tests withCharset method + * Tests the getCharset/withCharset methods * * @return void */ @@ -155,6 +155,7 @@ public function testWithCharset() $new = $response->withCharset('iso-8859-1'); $this->assertNotContains('iso', $response->getHeaderLine('Content-Type'), 'Old instance not changed'); + $this->assertSame('iso-8859-1', $new->getCharset()); $this->assertEquals('text/html; charset=iso-8859-1', $new->getHeaderLine('Content-Type')); }