Skip to content

Make Framework coding standard compliant #7166

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

Closed
wants to merge 96 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
7d7c327
- Removed the @codingStandardsIgnoreFile in every php file in the fra…
dverkade Oct 20, 2016
24e6743
- Ran phpcbf over all files in order to automatically fix coding stan…
dverkade Oct 24, 2016
8fe8e79
- Changed sample repository because it gave errors on the double slas…
dverkade Oct 24, 2016
e3f3688
Fixed coding standard error: No space found after comma in function call
dverkade Oct 24, 2016
ab2e947
Fixed coding standard error: Line exceeds maximum limit of 120 charac…
dverkade Oct 24, 2016
d71e431
Fixed coding standard error: Only one argument is allowed per line in…
dverkade Oct 24, 2016
11d271a
Fixed coding standard error: Use ::class notation instead.
dverkade Oct 24, 2016
10131b4
Fixed coding standard error: Empty line missed
dverkade Oct 24, 2016
7427576
Fixed coding standard error: Doc comment for "$locale" missing
dverkade Oct 24, 2016
b6238d2
Fixed coding standard error: Line exceeds maximum limit of 120 charac…
dverkade Oct 24, 2016
7dd2548
Fixed coding standard error: Line exceeds maximum limit of 120 charac…
dverkade Oct 24, 2016
08db17d
Fixed coding standard violation: Line exceeds maximum limit of 120 ch…
dverkade Oct 25, 2016
8ec994a
Fixed coding standard error: Line exceeds maximum limit of 120 charac…
dverkade Oct 25, 2016
efa9c54
Fixed coding standard violation: Var type missing for @var tag in var…
dverkade Oct 25, 2016
0538366
Fixed coding standard violation: Use ::class notation instead.
dverkade Oct 25, 2016
2880731
Fixed coding standard violation: Code must not contain multiple empty…
dverkade Oct 25, 2016
bc0d31a
Fixed coding standard violations:
dverkade Oct 25, 2016
af5343d
Fixed coding standard violation: Line indented incorrectly; expected …
dverkade Oct 25, 2016
809a685
Fixed coding standard violations:
dverkade Oct 25, 2016
824561e
Fixed coding standard violation: Empty line missed
dverkade Oct 25, 2016
aa821a2
Fixed coding standard violation: Empty line missed
dverkade Oct 25, 2016
21af3cb
Fixed coding standard violation: Use ::class notation instead.
dverkade Oct 25, 2016
3f16a5d
Fixed coding standard violations:
dverkade Oct 25, 2016
659ab34
Fixed coding standard violation: Only one argument is allowed per lin…
dverkade Oct 25, 2016
68519e0
Fixed coding standard violations:
dverkade Oct 25, 2016
4703ad2
Fixed coding standard violation: Missing @return tag in function comment
dverkade Oct 25, 2016
487bac3
Fixed coding violations:
dverkade Oct 25, 2016
abf7856
Fixed coding standard violations:
dverkade Oct 26, 2016
e8b1acb
Fixed coding standard violation: is_null must be avoided. Use strict …
dverkade Oct 26, 2016
210afe6
Fixed coding standard violation: is_null must be avoided. Use strict …
dverkade Oct 26, 2016
3fdb625
Fixed coding standard violations: is_null must be avoided. Use strict…
dverkade Oct 26, 2016
9681a73
- Fixed coding standard error Use ::class notation instead.
dverkade Nov 18, 2016
5d87dbd
Fixed coding standard error: Missing parameter name at position 1
dverkade Nov 18, 2016
482ce96
- Fixed coding standard error Line exceeds maximum limit of 120 chara…
dverkade Nov 18, 2016
df42723
Fixed typo mistake fixing error.
dverkade Nov 18, 2016
7d9ccb6
Fixed coding standard error: Opening parenthesis of a multi-line func…
dverkade Nov 18, 2016
8c6bcc7
- Fixed coding standard error: Expected 1 space(s) before asterisk; 0…
dverkade Nov 18, 2016
9933c46
- Fixed coding standard error: Variable "line_number" is not in valid…
dverkade Nov 18, 2016
7b2dc30
Resolved merge conflicts
dverkade Nov 19, 2016
a9be415
Fixed coding standard errors:
dverkade Nov 19, 2016
c1935f1
Fixed coding standard error: Line exceeds maximum limit of 120 charac…
dverkade Nov 19, 2016
8b937d9
- Changed type, removed extra space from comment
dverkade Nov 19, 2016
bf2ef25
Fixed coding standard error: Line exceeds maximum limit of 120 charac…
dverkade Nov 19, 2016
44c4b07
Trimmed whitespaces at the end of the line in order to fix coding sta…
dverkade Nov 19, 2016
6ea3f9a
Corrected coding standard errors:
dverkade Nov 20, 2016
4ac5bb1
Fixed coding standard error: Line exceeds maximum limit of 120 charac…
dverkade Nov 20, 2016
705375e
Fixed coding standard errors:
dverkade Nov 20, 2016
ee131c9
Fixed coding standard error: Line exceeds maximum limit of 120 charac…
dverkade Nov 20, 2016
e27f3e3
Fixed coding standard errors:
dverkade Nov 20, 2016
c061f65
Fixed coding standard error: Missing parameter name at position 1
dverkade Nov 20, 2016
e7e4213
Fixed coding standard error: There must be one blank line after the n…
dverkade Nov 20, 2016
281c74c
Surpressing coupling between objects for PHP MD
dverkade Nov 20, 2016
fa476ac
Surpressing coupling between objects for PHP MD
dverkade Nov 20, 2016
763a2c8
Surpressing coupling between objects for PHP MD
dverkade Nov 20, 2016
d9da868
Surpressing coupling between objects for PHP MD
dverkade Nov 20, 2016
a422e7d
Fixed coding standard errors:
dverkade Nov 20, 2016
87869d2
Fixed PHP MD error: Surpress npath complexity
dverkade Nov 20, 2016
0a11455
Fixed PHP MD error: Suppress Excessive method length
dverkade Nov 20, 2016
f062a2a
Fixed PHP MD error: Surpressed warning for excessive class complexity.
dverkade Nov 20, 2016
b36b01b
Fixed coding standard violation
dverkade Nov 20, 2016
1f914d5
Fixed coding standard violation: Line exceeds maximum limit of 120 ch…
dverkade Nov 20, 2016
4884f47
Fixed coding standard violation: Line exceeds maximum limit of 120 ch…
dverkade Nov 20, 2016
2727cfa
Fixed coding standard violations:
dverkade Nov 20, 2016
304ace3
- Changed Code Sniffer rule set in order to exclude all _files for cl…
dverkade Nov 20, 2016
119254e
Fixed coding standard violations:
dverkade Nov 20, 2016
dd5164f
Fixed coding standard violations:
dverkade Nov 20, 2016
f22f978
Fixed coding standard violations:
dverkade Nov 20, 2016
f8f68f6
Removed dubble class names
dverkade Nov 20, 2016
0992f88
Fixed coding standard violation: Line exceeds maximum limit of 120 ch…
dverkade Nov 20, 2016
fb4abaf
Fixed coding standard violations:
dverkade Nov 20, 2016
8824b29
Added PSR2 ref to Magento PHP Codesniffer ruleset.
dverkade Nov 20, 2016
3fbdf2c
- Combined testCodeStylePsr2() with the testCodeStyle() function.
dverkade Nov 20, 2016
43c2e57
Merge branch 'Combine_PSR2_code_sniffer_test_with_code_style_test' in…
dverkade Nov 20, 2016
77dd5d5
Changed the exclude pattern to be located under the ruleset node inst…
dverkade Nov 20, 2016
c7898aa
Merge branch 'Combine_PSR2_code_sniffer_test_with_code_style_test' in…
dverkade Nov 20, 2016
1ac6ed4
Fixed coding standard error:
dverkade Nov 22, 2016
1772739
Fixed coding standard error:
dverkade Nov 22, 2016
4293628
Added ignoring coding standard
dverkade Nov 22, 2016
0e68759
Fixed coding standard error:
dverkade Nov 22, 2016
f5317d2
Added Ignoring coding standard error
dverkade Nov 22, 2016
6390a7d
Fixed coding standard error, typo's in indenting
dverkade Nov 22, 2016
6cb43fc
Print the codesniffer version number to check which version is being …
dverkade Nov 24, 2016
1c0def9
Revert "Print the codesniffer version number to check which version i…
dverkade Nov 24, 2016
2f2351b
Checking PHP Codesniffer versions
dverkade Nov 24, 2016
1d1a5b4
Revert "Checking PHP Codesniffer versions"
dverkade Nov 24, 2016
1b6a747
@codingStandardIgnoreLine doesn't work correctly in docblocks. So com…
dverkade Nov 24, 2016
c3be4cd
Fixed coding standard error: Each class must be in a file by itself
dverkade Nov 24, 2016
091f5e9
Enabling static tests for PHP 7.0 images.
dverkade Nov 24, 2016
40f9729
Revert "Enabling static tests for PHP 7.0 images."
dverkade Nov 24, 2016
76eed97
Travis should run the static tests against PHP 7
dverkade Nov 24, 2016
5dd0920
Merge branch 'patch-16' of https://github.com/dverkade/magento2 into …
dverkade Nov 24, 2016
17b54a7
Fixed coding standard error: Function mysql() has been deprecated
dverkade Nov 26, 2016
ac4591c
- Changed SevenInterface to use "array()" instead of []. Code generat…
dverkade Nov 26, 2016
582d5c9
Changed back interface definition to check if this resolved broken bu…
dverkade Nov 26, 2016
9fe4d39
Added a global \ to setting the addTrait and Interfaces because the :…
dverkade Nov 26, 2016
40f89f9
Changed test to check for the correct changed interface name.
dverkade Nov 26, 2016
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
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ env:
cache:
apt: true
directories: $HOME/.composer/cache
matrix:
exclude:
- php: 7.0
env: TEST_SUITE=static
before_install: ./dev/travis/before_install.sh
install: composer install --no-interaction --prefer-dist
before_script: ./dev/travis/before_script.sh
Expand Down
37 changes: 6 additions & 31 deletions dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,37 +114,6 @@ function ($path) use ($directoriesToCheck, $fileTypes) {
return $changedFiles;
}

/**
* Run the PSR2 code sniffs on the code
*
* @TODO: combine with testCodeStyle
* @return void
*/
public function testCodeStylePsr2()
{
$reportFile = self::$reportDir . '/phpcs_psr2_report.txt';
$wrapper = new Wrapper();
$codeSniffer = new CodeSniffer('PSR2', $reportFile, $wrapper);
if (!$codeSniffer->canRun()) {
$this->markTestSkipped('PHP Code Sniffer is not installed.');
}
if (version_compare($wrapper->version(), '1.4.7') === -1) {
$this->markTestSkipped('PHP Code Sniffer Build Too Old.');
}

$result = $codeSniffer->run(self::getWhitelist());

$output = "";
if (file_exists($reportFile)) {
$output = file_get_contents($reportFile);
}
$this->assertEquals(
0,
$result,
"PHP Code Sniffer has found {$result} error(s): " . PHP_EOL . $output
);
}

/**
* Run the magento specific coding standards on the code
*
Expand All @@ -155,9 +124,15 @@ public function testCodeStyle()
$reportFile = self::$reportDir . '/phpcs_report.txt';
$wrapper = new Wrapper();
$codeSniffer = new CodeSniffer(realpath(__DIR__ . '/_files/phpcs'), $reportFile, $wrapper);

if (!$codeSniffer->canRun()) {
$this->markTestSkipped('PHP Code Sniffer is not installed.');
}

if (version_compare($wrapper->version(), '1.4.7') === -1) {
$this->markTestSkipped('PHP Code Sniffer Build Too Old.');
}

$codeSniffer->setExtensions(['php', 'phtml']);
$result = $codeSniffer->run(self::getWhitelist(['php', 'phtml']));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
-->
<ruleset name="Magento">
<description>Magento coding standard.</description>
<!-- We don't want to test stub file for unit testing -->
<exclude-pattern>*/_files/*</exclude-pattern>
<rule ref="PSR2"/>
<rule ref="Zend.Files.ClosingTag"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
Expand Down
12 changes: 7 additions & 5 deletions lib/internal/Magento/Framework/Acl/AclResource/Provider.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\Acl\AclResource;

class Provider implements ProviderInterface
Expand All @@ -24,8 +22,10 @@ class Provider implements ProviderInterface
* @param \Magento\Framework\Config\ReaderInterface $configReader
* @param TreeBuilder $resourceTreeBuilder
*/
public function __construct(\Magento\Framework\Config\ReaderInterface $configReader, TreeBuilder $resourceTreeBuilder)
{
public function __construct(
\Magento\Framework\Config\ReaderInterface $configReader,
TreeBuilder $resourceTreeBuilder
) {
$this->_configReader = $configReader;
$this->_resourceTreeBuilder = $resourceTreeBuilder;
}
Expand All @@ -37,7 +37,9 @@ public function getAclResources()
{
$aclResourceConfig = $this->_configReader->read();
if (!empty($aclResourceConfig['config']['acl']['resources'])) {
return $this->_resourceTreeBuilder->build($aclResourceConfig['config']['acl']['resources']);
return $this->_resourceTreeBuilder->build(
$aclResourceConfig['config']['acl']['resources']
);
}
return [];
}
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/Magento/Framework/Api/DataObjectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ protected function _setDataValues($dataObject, array $data, $interfaceName)
* @param string $interfaceName
* @return $this
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
protected function setComplexValue(
$dataObject,
Expand Down Expand Up @@ -176,7 +177,7 @@ protected function setComplexValue(
if (is_subclass_of($returnType, \Magento\Framework\Api\ExtensibleDataInterface::class)) {
$object = $this->objectFactory->create($returnType, []);
$this->populateWithArray($object, $value, $returnType);
} else if (is_subclass_of($returnType, \Magento\Framework\Api\ExtensionAttributesInterface::class)) {
} elseif (is_subclass_of($returnType, \Magento\Framework\Api\ExtensionAttributesInterface::class)) {
foreach ($value as $extensionAttributeKey => $extensionAttributeValue) {
$extensionAttributeGetterMethodName
= 'get' . \Magento\Framework\Api\SimpleDataObjectConverter::snakeCaseToUpperCamelCase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function toNestedArray(
if (!empty($dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY])) {
/** @var AttributeValue[] $customAttributes */
$customAttributes = $dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY];
unset ($dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY]);
unset($dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY]);
foreach ($customAttributes as $attributeValue) {
if (!in_array($attributeValue[AttributeValue::ATTRIBUTE_CODE], $skipAttributes)) {
$dataObjectArray[$attributeValue[AttributeValue::ATTRIBUTE_CODE]]
Expand All @@ -59,7 +59,7 @@ public function toNestedArray(
if (!empty($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY])) {
/** @var array $extensionAttributes */
$extensionAttributes = $dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY];
unset ($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]);
unset($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]);
foreach ($extensionAttributes as $attributeKey => $attributeValue) {
if (!in_array($attributeKey, $skipAttributes)) {
$dataObjectArray[$attributeKey] = $attributeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
namespace Magento\Framework\Api\SearchCriteria\CollectionProcessor;


use Magento\Framework\Api\SearchCriteria\CollectionProcessor\JoinProcessor\CustomJoinInterface;
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
use Magento\Framework\Api\SearchCriteriaInterface;
Expand Down
5 changes: 2 additions & 3 deletions lib/internal/Magento/Framework/Api/SortOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public function __construct(array $data = [])
$this->validateDirection($this->getDirection());
}
}



/**
* Get sorting field.
*
Expand Down Expand Up @@ -78,7 +77,7 @@ public function setDirection($direction)

/**
* Validate direction argument ASC or DESC
*
*
* @param mixed $direction
* @return null
* @throws InputException
Expand Down
1 change: 0 additions & 1 deletion lib/internal/Magento/Framework/Api/SortOrderBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace Magento\Framework\Api;


/**
* Builder for sort order data object.
* @method SortOrder create()
Expand Down
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\Api\Test\Unit\Api;

/**
Expand All @@ -26,8 +24,8 @@ class ImageContentValidatorTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$this->imageContentValidator = $this->objectManager->getObject(
\Magento\Framework\Api\ImageContentValidator::class
$this->imageContentValidator = $this->objectManager->getObject(
\Magento\Framework\Api\ImageContentValidator::class
);
}

Expand Down
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\Api\Test\Unit\Api;

/**
Expand Down Expand Up @@ -57,7 +55,7 @@ protected function setUp()
{
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);

$this->directoryWriteMock = $this->getMockForAbstractClass(
$this->directoryWriteMock = $this->getMockForAbstractClass(
\Magento\Framework\Filesystem\Directory\WriteInterface::class
);
$this->fileSystemMock = $this->getMockBuilder(\Magento\Framework\Filesystem::class)
Expand All @@ -66,8 +64,9 @@ protected function setUp()
$this->fileSystemMock->expects($this->any())
->method('getDirectoryWrite')
->willReturn($this->directoryWriteMock);
$this->contentValidatorMock = $this->getMockBuilder(
\Magento\Framework\Api\ImageContentValidatorInterface::class)
$this->contentValidatorMock = $this->getMockBuilder(
\Magento\Framework\Api\ImageContentValidatorInterface::class
)
->disableOriginalConstructor()
->getMock();
$this->dataObjectHelperMock = $this->getMockBuilder(\Magento\Framework\Api\DataObjectHelper::class)
Expand All @@ -90,7 +89,7 @@ protected function setUp()
->disableOriginalConstructor()
->getMock();

$this->imageProcessor = $this->objectManager->getObject(
$this->imageProcessor = $this->objectManager->getObject(
\Magento\Framework\Api\ImageProcessor::class,
[
'fileSystem' => $this->fileSystemMock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile

namespace Magento\Framework\Api\Test\Unit\Code\Generator;

use Magento\Framework\Api\ExtensionAttribute\Config\Converter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile

namespace Magento\Framework\Api\Test\Unit\Code\Generator;

use Magento\Framework\Api\ExtensionAttribute\Config\Converter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
namespace Magento\Framework\Api\Test\Unit\Code\Generator;


/**
* Class SearchResultTest
*/
Expand Down
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\Api\Test\Unit;

use Magento\Framework\Api\CustomAttributesDataInterface;
Expand Down Expand Up @@ -144,7 +142,8 @@ public function testPopulateWithArrayWithSimpleAttributes()

$this->dataObjectHelper->populateWithArray(
$addressDataObject,
$data, \Magento\Customer\Api\Data\AddressInterface::class
$data,
\Magento\Customer\Api\Data\AddressInterface::class
);

$this->assertEquals($id, $addressDataObject->getId());
Expand Down Expand Up @@ -198,7 +197,8 @@ public function testPopulateWithArrayWithCustomAttribute()
->willReturn($customAttribute);
$this->dataObjectHelper->populateWithArray(
$addressDataObject,
$data, \Magento\Customer\Api\Data\AddressInterface::class
$data,
\Magento\Customer\Api\Data\AddressInterface::class
);

$this->assertEquals($id, $addressDataObject->getId());
Expand Down Expand Up @@ -260,7 +260,8 @@ public function testPopulateWithArrayWithCustomAttributes()
->willReturn($customAttribute);
$this->dataObjectHelper->populateWithArray(
$addressDataObject,
$data, \Magento\Customer\Api\Data\AddressInterface::class
$data,
\Magento\Customer\Api\Data\AddressInterface::class
);

$this->assertEquals($id, $addressDataObject->getId());
Expand Down
1 change: 0 additions & 1 deletion lib/internal/Magento/Framework/Api/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Uploader extends \Magento\Framework\File\Uploader
*/
public function __construct()
{

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

/**
* Deployment configuration writer
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Writer
{
Expand Down Expand Up @@ -101,7 +103,6 @@ public function saveConfig(array $data, $override = false)

foreach ($data as $fileKey => $config) {
if (isset($paths[$fileKey])) {

if ($this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->isExist($paths[$fileKey])) {
$currentData = $this->reader->load($fileKey);
if ($override) {
Expand Down
12 changes: 6 additions & 6 deletions lib/internal/Magento/Framework/App/Response/HttpInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function setHeader($name, $value, $replace = false);

/**
* Get header value by name
*
*
* Returns first found header by passed name.
* If header with specified name was not found returns false.
*
Expand All @@ -57,14 +57,14 @@ public function clearHeader($name);

/**
* Allow granular setting of HTTP response status code, version and phrase
*
*
* For example, a HTTP response as the following:
* HTTP 200 1.1 Your response has been served
* Can be set with the arguments
* $httpCode = 200
* $version = 1.1
* $phrase = 'Your response has been served'
*
*
* @param int|string $httpCode
* @param null|int|string $version
* @param null|string $phrase
Expand All @@ -74,17 +74,17 @@ public function setStatusHeader($httpCode, $version = null, $phrase = null);

/**
* Append the given string to the response body
*
*
* @param string $value
* @return self
*/
public function appendBody($value);

/**
* Set the response body to the given value
*
*
* Any previously set contents will be replaced by the new content.
*
*
* @param string $value
* @return self
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/App/SetupInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function getProjectUrl()
$isProjectInDocRoot = false !== strpos($this->projectRoot . '/', $this->docRoot . '/');
if (empty($this->server['HTTP_HOST'])) {
return '';
} else if (!$isProjectInDocRoot) {
} elseif (!$isProjectInDocRoot) {
return 'http://' . $this->server['HTTP_HOST'] . '/';
}
return 'http://' . $this->server['HTTP_HOST'] . substr($this->projectRoot . '/', strlen($this->docRoot));
Expand Down
Loading