Skip to content

Commit 899ba6b

Browse files
committed
Fixed coding standard violations in the Framework\Backup namespace, so that they will be included in the CI tools. Fixed the following:
- Removed @codingStandardsIgnoreFile from the head of the files. - Fixed line length - Fixed identation - Changed class comment to the top of the class where it is in every other file instead of the top of the file.
1 parent f8b51d3 commit 899ba6b

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

Diff for: lib/internal/Magento/Framework/Backup/Archive/Tar.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* Extended version of \Magento\Framework\Archive\Tar that supports filtering
119
*
@@ -23,14 +21,15 @@ class Tar extends \Magento\Framework\Archive\Tar
2321
protected $_skipFiles = [];
2422

2523
/**
26-
* Overridden \Magento\Framework\Archive\Tar::_createTar method that does the same actions as it's parent but filters
27-
* files using \Magento\Framework\Backup\Filesystem\Iterator\Filter
24+
* Overridden \Magento\Framework\Archive\Tar::_createTar method that does the same actions as it's parent but
25+
* filters files using \Magento\Framework\Backup\Filesystem\Iterator\Filter
2826
*
2927
* @param bool $skipRoot
3028
* @param bool $finalize
3129
* @return void
3230
*
3331
* @see \Magento\Framework\Archive\Tar::_createTar()
32+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3433
*/
3534
protected function _createTar($skipRoot = false, $finalize = false)
3635
{
@@ -41,7 +40,10 @@ protected function _createTar($skipRoot = false, $finalize = false)
4140
\RecursiveIteratorIterator::SELF_FIRST
4241
);
4342

44-
$iterator = new \Magento\Framework\Backup\Filesystem\Iterator\Filter($filesystemIterator, $this->_skipFiles);
43+
$iterator = new \Magento\Framework\Backup\Filesystem\Iterator\Filter(
44+
$filesystemIterator,
45+
$this->_skipFiles
46+
);
4547

4648
foreach ($iterator as $item) {
4749
$this->_setCurrentFile($item->getPathname());

Diff for: lib/internal/Magento/Framework/Backup/Db/BackupFactory.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\Backup\Db;
108

119
class BackupFactory
@@ -32,8 +30,11 @@ class BackupFactory
3230
* @param string $backupInstanceName
3331
* @param string $backupDbInstanceName
3432
*/
35-
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $backupInstanceName, $backupDbInstanceName)
36-
{
33+
public function __construct(
34+
\Magento\Framework\ObjectManagerInterface $objectManager,
35+
$backupInstanceName,
36+
$backupDbInstanceName
37+
) {
3738
$this->_objectManager = $objectManager;
3839
$this->_backupInstanceName = $backupInstanceName;
3940
$this->_backupDbInstanceName = $backupDbInstanceName;

Diff for: lib/internal/Magento/Framework/Backup/Factory.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?php
22
/**
3-
* Backup object factory.
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
86

9-
// @codingStandardsIgnoreFile
10-
7+
/**
8+
* Backup object factory.
9+
*/
1110
namespace Magento\Framework\Backup;
1211

1312
class Factory

Diff for: lib/internal/Magento/Framework/Backup/Filesystem.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\Backup;
108

119
use Magento\Framework\App\ObjectManager;
@@ -108,7 +106,8 @@ public function create()
108106

109107
$filesInfo = $fsHelper->getInfo(
110108
$this->getRootDir(),
111-
\Magento\Framework\Backup\Filesystem\Helper::INFO_READABLE | \Magento\Framework\Backup\Filesystem\Helper::INFO_SIZE,
109+
\Magento\Framework\Backup\Filesystem\Helper::INFO_READABLE |
110+
\Magento\Framework\Backup\Filesystem\Helper::INFO_SIZE,
112111
$this->getIgnorePaths()
113112
);
114113

@@ -162,8 +161,8 @@ public function validateAvailableDiscSpace($backupDir, $size)
162161
if ($requiredSpace > $freeSpace) {
163162
throw new \Magento\Framework\Backup\Exception\NotEnoughFreeSpace(
164163
new \Magento\Framework\Phrase(
165-
'Warning: necessary space for backup is ' . (ceil($requiredSpace) / 1024)
166-
. 'MB, but your free disc space is ' . (ceil($freeSpace) / 1024) . 'MB.'
164+
'Warning: necessary space for backup is ' . (ceil($requiredSpace) / 1024)
165+
. 'MB, but your free disc space is ' . (ceil($freeSpace) / 1024) . 'MB.'
167166
)
168167
);
169168
}

0 commit comments

Comments
 (0)