Skip to content

Commit

Permalink
Adhere to PSR-2 coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
boldbart committed Mar 3, 2017
1 parent c8234a3 commit 570f412
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
5 changes: 2 additions & 3 deletions Observer/AddOrderCommentToOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
class AddOrderCommentToOrder implements \Magento\Framework\Event\ObserverInterface
{
/**
* transfer the order comment from the quote object to the order object during the
* transfer the order comment from the quote object to the order object during the
* sales_model_service_quote_submit_before event
*
*
* @param \Magento\Framework\Event\Observer $observer
* @return void
*/
Expand All @@ -21,6 +21,5 @@ public function execute(\Magento\Framework\Event\Observer $observer)
$quote = $observer->getEvent()->getQuote();

$order->setData(OrderComment::COMMENT_FIELD_NAME, $quote->getData(OrderComment::COMMENT_FIELD_NAME));

}
}
2 changes: 1 addition & 1 deletion Setup/Uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $c

$setup->endSetup();
}
}
}
2 changes: 1 addition & 1 deletion Test/Integration/Model/OrderCommentManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Class OrderCommentManagementTest
* @package Bold\OrderComment\Test\Integration\Model
*
*
* @magentoDbIsolation enabled
*/
class OrderCommentManagementTest extends \PHPUnit_Framework_TestCase
Expand Down
2 changes: 1 addition & 1 deletion Test/Integration/Observer/AddOrderCommentToOrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Class AddOrderCommentToOrderTest
* @package Bold\OrderComment\Test\Integration\Observer
*
*
* tests if the comment gets passed from the quote to the order during order creation.
* @magentoDbIsolation enabled
*/
Expand Down
2 changes: 0 additions & 2 deletions Test/Unit/Model/OrderCommentManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public function testSaveComment()
$this->testObject->saveOrderComment($cartId, $orderCommentMock);

$this->assertEquals($comment, $this->quoteMock->getData(OrderComment::COMMENT_FIELD_NAME));

}

public function testSaveCommentWithTags()
Expand Down Expand Up @@ -137,6 +136,5 @@ public function testSaveCommentWithTags()
$this->testObject->saveOrderComment($cartId, $orderCommentMock);

$this->assertEquals(strip_tags($comment), $this->quoteMock->getData(OrderComment::COMMENT_FIELD_NAME));

}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "boldcommerce/magento2-ordercomments",
"description": "Magento 2 Module to add a comment field above the place order button in the checkout",
"version": "1.0.0",
"version": "1.0.1",
"require": {
"php": "~7.0.0"
},
Expand Down
10 changes: 5 additions & 5 deletions view/frontend/web/js/model/checkout/order-comment-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ define(
var quoteId = quote.getQuoteId();
var url;

if(isCustomer){
if (isCustomer) {
url = urlBuilder.createUrl('/carts/mine/set-order-comment', {})
}else{
} else {
url = urlBuilder.createUrl('/guest-carts/:cartId/set-order-comment', {cartId: quoteId});
}

Expand All @@ -37,7 +37,7 @@ define(
}
};

if(!payload.orderComment.comment){
if (!payload.orderComment.comment) {
return true;
}

Expand All @@ -51,11 +51,11 @@ define(
type: 'PUT',
async: false
}).done(
function(response){
function (response) {
result = true;
}
).fail(
function(response){
function (response) {
result = false;
errorProcessor.process(response);
}
Expand Down

0 comments on commit 570f412

Please sign in to comment.