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

CMSPlugin refactoring and magic late initialisation #39088

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
29 changes: 29 additions & 0 deletions libraries/src/Application/ApplicationAwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* Joomla! Content Management System
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\CMS\Application;

/**
* Interface defining an object aware of the global application object
*
* @since __DEPLOY_VERSION__
*/
interface ApplicationAwareInterface
{
/**
* Sets the application to use.
*
* @param CMSApplicationInterface $application The application
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function setApplication(CMSApplicationInterface $application): void;
}
53 changes: 53 additions & 0 deletions libraries/src/Application/ApplicationAwareTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

/**
* Joomla! Content Management System
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\CMS\Application;

/**
* Defines the trait for an Application Aware Class.
*
* @since __DEPLOY_VERSION__
*/
trait ApplicationAwareTrait
{
/**
* The application object
*
* @var CMSApplicationInterface
*
* @since __DEPLOY_VERSION__
*/
private $application;

/**
* Sets the application to use.
*
* @param CMSApplicationInterface $application The application
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function setApplication(CMSApplicationInterface $application): void
{
$this->application = $application;
}

/**
* Returns the internal application or null when not set.
*
* @return CMSApplicationInterface|null
*
* @since __DEPLOY_VERSION__
*/
protected function getApplication(): ?CMSApplicationInterface
{
return $this->application;
}
}
14 changes: 14 additions & 0 deletions libraries/src/Plugin/AutoloadLanguageAware.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

/**
* Joomla! Content Management System
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\CMS\Plugin;

interface AutoloadLanguageAware
nikosdion marked this conversation as resolved.
Show resolved Hide resolved
{
}
Loading