Skip to content

Commit

Permalink
Merge pull request #1812 from creative-commoners/pulls/2/deprecate-le…
Browse files Browse the repository at this point in the history
…ftandmainextension

API Deprecate LeftAndMainExtension
  • Loading branch information
GuySartorelli authored Aug 25, 2024
2 parents e9f6b53 + 611dc58 commit 2a05026
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions code/LeftAndMainExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,28 @@
namespace SilverStripe\Admin;

use SilverStripe\Core\Extension;
use SilverStripe\Dev\Deprecation;

/**
* Plug-ins for additional functionality in your LeftAndMain classes.
*
* @template T of LeftAndMain
* @extends Extension<T>
* @deprecated 2.3.0 Subclass SilverStripe\Core\Extension\Extension instead
*/
abstract class LeftAndMainExtension extends Extension
{
public function __construct()
{
// Wrapping with Deprecation::withNoReplacement() to avoid triggering deprecation notices
// as we are unable to update existing subclasses of this class until a new major
// unless we add in the pointless empty methods that are in this class
Deprecation::withNoReplacement(function () {
$class = Extension::class;
Deprecation::notice('2.3.0', "Subclass $class instead", Deprecation::SCOPE_CLASS);
});
parent::__construct();
}

public function init()
{
Expand Down

0 comments on commit 2a05026

Please sign in to comment.