DEP Upgrade installer dependencies (#10534)

This commit is contained in:
Sabina Talipova 2022-10-21 09:59:34 +13:00 committed by GitHub
parent 919cfcf435
commit 3601b7ab8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 22 deletions

View File

@ -24,15 +24,15 @@
"require": { "require": {
"php": "^8.1", "php": "^8.1",
"bramus/monolog-colored-line-formatter": "^2.0.3", "bramus/monolog-colored-line-formatter": "^2.0.3",
"composer/installers": "^2.1.1", "composer/installers": "^2.2",
"guzzlehttp/guzzle": "^7.4.5", "guzzlehttp/guzzle": "^7.5.0",
"guzzlehttp/psr7": "^2.4.0", "guzzlehttp/psr7": "^2.4.0",
"embed/embed": "^4.4.4", "embed/embed": "^4.4.4",
"league/csv": "^9.8.0", "league/csv": "^9.8.0",
"m1/env": "^2.2.0", "m1/env": "^2.2.0",
"monolog/monolog": "^1.27.1", "monolog/monolog": "^3.2.0",
"nikic/php-parser": "^4.14.0", "nikic/php-parser": "^4.15.0",
"psr/container": "^1.1.2", "psr/container": "^2.0",
"silverstripe/config": "^2", "silverstripe/config": "^2",
"silverstripe/assets": "^2", "silverstripe/assets": "^2",
"silverstripe/vendor-plugin": "^2", "silverstripe/vendor-plugin": "^2",
@ -100,8 +100,6 @@
] ]
}, },
"include-path": [ "include-path": [
"src/",
"src/includes/",
"thirdparty/" "thirdparty/"
], ],
"scripts": { "scripts": {
@ -111,4 +109,4 @@
}, },
"minimum-stability": "dev", "minimum-stability": "dev",
"prefer-stable": true "prefer-stable": true
} }

View File

@ -874,10 +874,8 @@ class Injector implements ContainerInterface
* *
* Will recursively call itself for each depth of dotting. * Will recursively call itself for each depth of dotting.
* *
* @param string $name
* @return boolean
*/ */
public function has($name) public function has(string $name): bool
{ {
return (bool)$this->getServiceName($name); return (bool)$this->getServiceName($name);
} }

View File

@ -7,6 +7,7 @@ use SilverStripe\Dev\Debug;
use SilverStripe\Control\Director; use SilverStripe\Control\Director;
use SilverStripe\Control\Email\Email; use SilverStripe\Control\Email\Email;
use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\FormatterInterface;
use Monolog\LogRecord;
/** /**
* Produce a friendly error message * Produce a friendly error message
@ -101,7 +102,7 @@ class DebugViewFriendlyErrorFormatter implements FormatterInterface
return $this; return $this;
} }
public function format(array $record) public function format(array|LogRecord $record)
{ {
// Get error code // Get error code
$code = empty($record['code']) ? $this->getStatusCode() : $record['code']; $code = empty($record['code']) ? $this->getStatusCode() : $record['code'];

View File

@ -4,6 +4,7 @@ namespace SilverStripe\Logging;
use SilverStripe\Dev\Debug; use SilverStripe\Dev\Debug;
use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\FormatterInterface;
use Monolog\LogRecord;
use Exception; use Exception;
/** /**
@ -11,7 +12,7 @@ use Exception;
*/ */
class DetailedErrorFormatter implements FormatterInterface class DetailedErrorFormatter implements FormatterInterface
{ {
public function format(array $record) public function format(array|LogRecord $record)
{ {
if (isset($record['context']['exception'])) { if (isset($record['context']['exception'])) {
/** @var Exception $exception */ /** @var Exception $exception */

View File

@ -4,6 +4,7 @@ namespace SilverStripe\Logging;
use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\FormatterInterface;
use Monolog\Handler\AbstractProcessingHandler; use Monolog\Handler\AbstractProcessingHandler;
use Monolog\LogRecord;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
use SilverStripe\Control\Director; use SilverStripe\Control\Director;
use SilverStripe\Control\HTTPResponse; use SilverStripe\Control\HTTPResponse;
@ -106,7 +107,7 @@ class HTTPOutputHandler extends AbstractProcessingHandler
* *
* @return FormatterInterface * @return FormatterInterface
*/ */
public function getFormatter() public function getFormatter(): FormatterInterface
{ {
if (Director::is_cli() && ($cliFormatter = $this->getCLIFormatter())) { if (Director::is_cli() && ($cliFormatter = $this->getCLIFormatter())) {
return $cliFormatter; return $cliFormatter;
@ -120,7 +121,7 @@ class HTTPOutputHandler extends AbstractProcessingHandler
* *
* @return FormatterInterface * @return FormatterInterface
*/ */
public function getDefaultFormatter() public function getDefaultFormatter(): FormatterInterface
{ {
return parent::getFormatter(); return parent::getFormatter();
} }
@ -141,7 +142,7 @@ class HTTPOutputHandler extends AbstractProcessingHandler
* @param array $record * @param array $record
* @return bool * @return bool
*/ */
protected function write(array $record) protected function write(LogRecord $record): void
{ {
ini_set('display_errors', 0); ini_set('display_errors', 0);
@ -164,7 +165,5 @@ class HTTPOutputHandler extends AbstractProcessingHandler
$response->setBody($record['formatted']); $response->setBody($record['formatted']);
$response->output(); $response->output();
return false === $this->getBubble();
} }
} }

View File

@ -3,6 +3,7 @@
namespace SilverStripe\Logging; namespace SilverStripe\Logging;
use Monolog\Handler\AbstractProcessingHandler; use Monolog\Handler\AbstractProcessingHandler;
use Monolog\LogRecord;
/** /**
* Echo the output as preformatted HTML, emulating console output in a browser. * Echo the output as preformatted HTML, emulating console output in a browser.
@ -17,10 +18,7 @@ use Monolog\Handler\AbstractProcessingHandler;
class PreformattedEchoHandler extends AbstractProcessingHandler class PreformattedEchoHandler extends AbstractProcessingHandler
{ {
/** protected function write(LogRecord $record): void
* @param array $record
*/
protected function write(array $record)
{ {
echo sprintf('<pre>%s</pre>', htmlspecialchars($record['formatted'], ENT_QUOTES, 'UTF-8')); echo sprintf('<pre>%s</pre>', htmlspecialchars($record['formatted'], ENT_QUOTES, 'UTF-8'));
} }