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

[4.2] Post-installation messages UX #38064 code optimization #38099

Merged
merged 4 commits into from Jun 20, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -35,7 +35,7 @@ public function reset()
$this->checkToken('get');

/** @var MessagesModel $model */
$model = $this->getModel('Messages', '', array('ignore_request' => true));
$model = $this->getModel('Messages', '', ['ignore_request' => true]);
$eid = $this->input->getInt('eid');

if (empty($eid))
Expand All @@ -57,7 +57,7 @@ public function reset()
*/
public function unpublish()
{
$model = $this->getModel('Messages', '', array('ignore_request' => true));
$model = $this->getModel('Messages', '', ['ignore_request' => true]);

$id = $this->input->get('id');

Expand All @@ -83,7 +83,7 @@ public function unpublish()
*/
public function republish()
{
$model = $this->getModel('Messages', '', array('ignore_request' => true));
$model = $this->getModel('Messages', '', ['ignore_request' => true]);

$id = $this->input->get('id');

Expand All @@ -109,7 +109,7 @@ public function republish()
*/
public function archive()
{
$model = $this->getModel('Messages', '', array('ignore_request' => true));
$model = $this->getModel('Messages', '', ['ignore_request' => true]);

$id = $this->input->get('id');

Expand Down Expand Up @@ -137,7 +137,7 @@ public function action()
{
$this->checkToken('get');

$model = $this->getModel('Messages', '', array('ignore_request' => true));
$model = $this->getModel('Messages', '', ['ignore_request' => true]);

$id = $this->input->get('id');

Expand Down Expand Up @@ -178,7 +178,7 @@ public function hideAll()
$this->checkToken();

/** @var MessagesModel $model */
$model = $this->getModel('Messages', '', array('ignore_request' => true));
$model = $this->getModel('Messages', '', ['ignore_request' => true]);
$eid = $this->input->getInt('eid');

if (empty($eid))
Expand Down
Expand Up @@ -131,7 +131,7 @@ public function unpublishMessage($id)
*/
public function archiveMessage($id)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$id = (int) $id;

$query = $db->getQuery(true);
Expand All @@ -156,7 +156,7 @@ public function archiveMessage($id)
*/
public function republishMessage($id)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$id = (int) $id;

$query = $db->getQuery(true);
Expand Down Expand Up @@ -210,7 +210,7 @@ public function getItems()
->bind(':eid', $eid, ParameterType::INTEGER);

// Force filter only enabled messages
$query->where($db->quoteName('enabled') . ' IN (1,2)');
$query->whereIn($db->quoteName('enabled'), [1, 2]);
$db->setQuery($query);

try
Expand Down