Skip to content

Commit

Permalink
Merge pull request #67 from magento-commerce/develop
Browse files Browse the repository at this point in the history
MCLOUD-8200: Release cloud tools
  • Loading branch information
oshmyheliuk authored Oct 18, 2021
2 parents ff1f609 + 32290b1 commit 43169af
Show file tree
Hide file tree
Showing 38 changed files with 418 additions and 503 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4']
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/auth.json
/codeception.yml
/_workdir
/*.code-workspace
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/ece-tools",
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
"type": "magento2-component",
"version": "2002.1.7",
"version": "2002.1.8",
"license": "OSL-3.0",
"repositories": {
"repo.magento.com": {
Expand All @@ -16,25 +16,25 @@
"ext-json": "*",
"ext-sockets": "*",
"colinmollenhour/credis": "^1.6.0",
"composer/composer": "^1.4||^2.0",
"composer/composer": "^1.4 || ^2.0",
"composer/semver": "@stable",
"graylog2/gelf-php": "^1.4.2",
"guzzlehttp/guzzle": "^6.2",
"guzzlehttp/guzzle": "^6.3||^7.3",
"illuminate/config": "^5.5",
"magento/magento-cloud-components": "^1.0.8",
"magento/magento-cloud-docker": "^1.0.0",
"magento/magento-cloud-patches": "^1.0.11",
"magento/quality-patches": "^1.1.0",
"monolog/monolog": "^1.16",
"nesbot/carbon": "^1.0||^2.0",
"monolog/monolog": "^1.25 || ^2.3",
"nesbot/carbon": "^1.0 || ^2.0",
"psr/container": "^1.0",
"psr/log": "^1.0",
"symfony/config": "^4.4",
"symfony/console": "^2.8||^4.0",
"symfony/dependency-injection": "^3.3||^4.3",
"symfony/process": "^2.1||^4.1",
"symfony/serializer": "^2.8||^3.3||^4.0",
"symfony/yaml": "^3.3||^4.0"
"symfony/config": "^4.4 || ^5.1",
"symfony/console": "^2.8 || ^4.0 || ^5.1",
"symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1",
"symfony/process": "^2.1 || ^4.1 || ^5.1",
"symfony/serializer": "^2.8 || ^3.3 || ^4.0",
"symfony/yaml": "^3.3 || ^4.0 || ^5.1"
},
"require-dev": {
"codeception/codeception": "^2.5.3",
Expand Down
13 changes: 7 additions & 6 deletions src/App/Logger/Formatter/JsonErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class JsonErrorFormatter extends JsonFormatter
/**
* @param ErrorInfo $errorInfo
* @param ReaderInterface $reader
* @param int $batchMode
* @param 1|2 $batchMode
* @param bool $appendNewline
*/
public function __construct(
Expand All @@ -50,22 +50,22 @@ public function __construct(
*
* {@inheritDoc}
*/
public function format(array $record)
public function format(array $record): string
{
try {
if (!isset($record['context']['errorCode'])) {
return false;
return '';
}

$loggedErrors = $this->reader->read();

if (isset($loggedErrors[$record['context']['errorCode']])) {
return false;
return '';
}

return parent::format($this->formatLog($record));
} catch (\Exception $e) {
return false;
} catch (\Exception $exception) {
return '';
}
}

Expand Down Expand Up @@ -98,6 +98,7 @@ private function formatLog(array $record): array
}

ksort($errorInfo);

return $errorInfo;
}
}
2 changes: 1 addition & 1 deletion src/App/Logger/Formatter/LineFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LineFormatter extends \Monolog\Formatter\LineFormatter
/**
* @inheritDoc
*/
public function format(array $record)
public function format(array $record): string
{
$errorLevels = [
Logger::getLevelName(Logger::WARNING),
Expand Down
2 changes: 1 addition & 1 deletion src/App/Logger/Gelf/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Handler extends GelfHandler
* @param array $record
* @codeCoverageIgnore
*/
protected function write(array $record)
protected function write(array $record): void
{
try {
parent::write($record);
Expand Down
4 changes: 2 additions & 2 deletions src/App/Logger/Gelf/HandlerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public function __construct(TransportFactory $transportFactory)
* Creates instance of Gelf handler.
*
* @param Repository $configuration
* @param int $minLevel
* @param mixed $minLevel
* @return Handler
* @throws LoggerException
*/
public function create(Repository $configuration, int $minLevel): Handler
public function create(Repository $configuration, $minLevel): Handler
{
$this->increaseSocketTimeout();

Expand Down
3 changes: 2 additions & 1 deletion src/App/Logger/Gelf/MessageFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Magento\MagentoCloud\App\Logger\Gelf;

use Monolog\Formatter\GelfMessageFormatter;
use Gelf\Message;

/**
* Extends functionality of GelfMessageFormatter.
Expand All @@ -33,7 +34,7 @@ public function setAdditional(array $additional)
/**
* @inheritdoc
*/
public function format(array $record)
public function format(array $record): Message
{
$message = parent::format($record);

Expand Down
Loading

0 comments on commit 43169af

Please sign in to comment.