Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed coding standard violations in the Framework\Backup namespace #9318

Merged
merged 1 commit into from
Apr 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/internal/Magento/Framework/Backup/Archive/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Extended version of \Magento\Framework\Archive\Tar that supports filtering
*
Expand All @@ -23,14 +21,15 @@ class Tar extends \Magento\Framework\Archive\Tar
protected $_skipFiles = [];

/**
* Overridden \Magento\Framework\Archive\Tar::_createTar method that does the same actions as it's parent but filters
* files using \Magento\Framework\Backup\Filesystem\Iterator\Filter
* Overridden \Magento\Framework\Archive\Tar::_createTar method that does the same actions as it's parent but
* filters files using \Magento\Framework\Backup\Filesystem\Iterator\Filter
*
* @param bool $skipRoot
* @param bool $finalize
* @return void
*
* @see \Magento\Framework\Archive\Tar::_createTar()
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _createTar($skipRoot = false, $finalize = false)
{
Expand All @@ -41,7 +40,10 @@ protected function _createTar($skipRoot = false, $finalize = false)
\RecursiveIteratorIterator::SELF_FIRST
);

$iterator = new \Magento\Framework\Backup\Filesystem\Iterator\Filter($filesystemIterator, $this->_skipFiles);
$iterator = new \Magento\Framework\Backup\Filesystem\Iterator\Filter(
$filesystemIterator,
$this->_skipFiles
);

foreach ($iterator as $item) {
$this->_setCurrentFile($item->getPathname());
Expand Down
9 changes: 5 additions & 4 deletions lib/internal/Magento/Framework/Backup/Db/BackupFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Framework\Backup\Db;

class BackupFactory
Expand All @@ -32,8 +30,11 @@ class BackupFactory
* @param string $backupInstanceName
* @param string $backupDbInstanceName
*/
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $backupInstanceName, $backupDbInstanceName)
{
public function __construct(
\Magento\Framework\ObjectManagerInterface $objectManager,
$backupInstanceName,
$backupDbInstanceName
) {
$this->_objectManager = $objectManager;
$this->_backupInstanceName = $backupInstanceName;
$this->_backupDbInstanceName = $backupDbInstanceName;
Expand Down
7 changes: 3 additions & 4 deletions lib/internal/Magento/Framework/Backup/Factory.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php
/**
* Backup object factory.
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Backup object factory.
*/
namespace Magento\Framework\Backup;

class Factory
Expand Down
9 changes: 4 additions & 5 deletions lib/internal/Magento/Framework/Backup/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Framework\Backup;

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

$filesInfo = $fsHelper->getInfo(
$this->getRootDir(),
\Magento\Framework\Backup\Filesystem\Helper::INFO_READABLE | \Magento\Framework\Backup\Filesystem\Helper::INFO_SIZE,
\Magento\Framework\Backup\Filesystem\Helper::INFO_READABLE |
\Magento\Framework\Backup\Filesystem\Helper::INFO_SIZE,
$this->getIgnorePaths()
);

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