Skip to content

Commit

Permalink
MAGETWO-72390: Remove the usage of the DataObject for response manage…
Browse files Browse the repository at this point in the history
…ment #10808

 - Merge Pull Request #10808 from dmanners/magento2:remove-data-object-from-json-controllers
 - Merged commits:
   1. 25b0343
  • Loading branch information
ishakhsuvarov committed Sep 7, 2017
2 parents d844e31 + 25b0343 commit 5a27387
Show file tree
Hide file tree
Showing 11,229 changed files with 125,672 additions and 92,741 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .github/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Order deny,allow
Deny from all
46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at engcom@magento.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/.metadata
/.project
/.settings
/.vscode
atlassian*
/nbproject
/robots.txt
Expand Down
4 changes: 0 additions & 4 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@
order allow,deny
deny from all
</Files>
<Files CONTRIBUTING.md>
order allow,deny
deny from all
</Files>
<Files COPYING.txt>
order allow,deny
deny from all
Expand Down
4 changes: 0 additions & 4 deletions .htaccess.sample
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,6 @@
order allow,deny
deny from all
</Files>
<Files CONTRIBUTING.md>
order allow,deny
deny from all
</Files>
<Files COPYING.txt>
order allow,deny
deny from all
Expand Down
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sudo: required
dist: trusty
group: edge
addons:
apt:
packages:
Expand Down Expand Up @@ -28,8 +29,7 @@ env:
- TEST_SUITE=integration INTEGRATION_INDEX=1
- TEST_SUITE=integration INTEGRATION_INDEX=2
- TEST_SUITE=integration INTEGRATION_INDEX=3
- TEST_SUITE=functional ACCEPTANCE_INDEX=1
- TEST_SUITE=functional ACCEPTANCE_INDEX=2
- TEST_SUITE=functional
matrix:
exclude:
- php: 7.0
Expand All @@ -39,9 +39,7 @@ matrix:
- php: 7.0
env: TEST_SUITE=js GRUNT_COMMAND=static
- php: 7.0
env: TEST_SUITE=functional ACCEPTANCE_INDEX=1
- php: 7.0
env: TEST_SUITE=functional ACCEPTANCE_INDEX=2
env: TEST_SUITE=functional
cache:
apt: true
directories:
Expand All @@ -50,13 +48,14 @@ cache:
- $HOME/node_modules
- $HOME/yarn.lock
before_install: ./dev/travis/before_install.sh
install: composer install --no-interaction --prefer-dist
install: composer install --no-interaction
before_script: ./dev/travis/before_script.sh
script:
# Set arguments for variants of phpunit based tests; '|| true' prevents failing script when leading test fails
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true

# The scripts for grunt/phpunit type tests
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
4 changes: 2 additions & 2 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@
date_default_timezone_set('UTC');

/* Adjustment of precision value for several versions of PHP */
ini_set('precision', 17);
ini_set('serialize_precision', 17);
ini_set('precision', 15);
ini_set('serialize_precision', 15);
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Backend\Block\Widget\Grid\Container
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class UnreadMessagePopup extends \Magento\Backend\Block\Template
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/ToolbarEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @since 100.0.2
*/
class ToolbarEntry extends \Magento\Backend\Block\Template
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class Window extends \Magento\Backend\Block\Template
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml;

/**
* @api
* @since 100.0.2
*/
abstract class Notification extends \Magento\Backend\App\AbstractAction
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,35 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

use Magento\Backend\App\Action;
use Magento\Framework\Controller\ResultFactory;

class AjaxMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notification
{
/**
* @var \Magento\AdminNotification\Model\NotificationService
*/
private $notificationService;

/**
* @param Action\Context $context
* @param \Magento\AdminNotification\Model\NotificationService|null $notificationService
* @throws \RuntimeException
*/
public function __construct(
Action\Context $context,
\Magento\AdminNotification\Model\NotificationService $notificationService = null
) {
parent::__construct($context);
$this->notificationService = $notificationService?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\AdminNotification\Model\NotificationService::class);
}

/**
* Mark notification as read (AJAX action)
*
* @return void
* @return \Magento\Framework\Controller\Result\Json|void
* @throws \InvalidArgumentException
*/
public function execute()
{
Expand All @@ -21,17 +44,15 @@ public function execute()
$notificationId = (int)$this->getRequest()->getPost('id');
$responseData = [];
try {
$this->_objectManager->create(
\Magento\AdminNotification\Model\NotificationService::class
)->markAsRead(
$notificationId
);
$this->notificationService->markAsRead($notificationId);
$responseData['success'] = true;
} catch (\Exception $e) {
$responseData['success'] = false;
}
$this->getResponse()->representJson(
$this->_objectManager->create(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($responseData)
);

/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
$resultJson->setData($responseData);
return $resultJson;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* AdminNotification update frequency source
*
* @codeCoverageIgnore
* @api
* @since 100.0.2
*/
class Frequency implements \Magento\Framework\Option\ArrayInterface
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @api
* @since 100.0.2
*/
class Feed extends \Magento\Framework\Model\AbstractModel
{
Expand Down
5 changes: 2 additions & 3 deletions app/code/Magento/AdminNotification/Model/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* AdminNotification Inbox model
*
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox _getResource()
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox getResource()
* @method int getSeverity()
* @method \Magento\AdminNotification\Model\Inbox setSeverity(int $value)
* @method string getDateAdded()
Expand All @@ -29,7 +27,8 @@
* @method int getIsRemove()
* @method \Magento\AdminNotification\Model\Inbox setIsRemove(int $value)
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Framework\Model\AbstractModel implements NotifierInterface, InboxInterface
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/AdminNotification/Model/InboxInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* AdminNotification Inbox interface
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
interface InboxInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* Notification service model
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class NotificationService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\Grid;

/**
* @api
* @since 100.0.2
*/
class Collection extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
namespace Magento\AdminNotification\Model\ResourceModel;

/**
* AdminNotification Inbox model
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;

/**
* @api
* @since 100.0.2
*/
class Critical extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;

/**
* @api
* @since 100.0.2
*/
class Unread extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\System;

/**
* @api
* @since 100.0.2
*/
class Message extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\System\Message;

/**
* @api
* @since 100.0.2
*/
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\System\Message\Collection;

/**
* @api
* @since 100.0.2
*/
class Synchronized extends \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection
{
/**
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/AdminNotification/Model/System/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/**
* @codeCoverageIgnore
* @api
* @since 100.0.2
*/
class Message extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\Notification\MessageInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Magento\Store\Model\Store;

/**
* @deprecated
* @deprecated 100.1.0
*/
class Baseurl implements \Magento\Framework\Notification\MessageInterface
{
Expand Down
Loading

0 comments on commit 5a27387

Please sign in to comment.