Skip to content

Commit 30c09e5

Browse files
authored
[5.4] Extend deprecation for editors and captcha to 7 (joomla#45819)
* Extend deprecation for editors and captcha to 7 and adopted phpstan
1 parent 18fcf37 commit 30c09e5

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

libraries/src/Captcha/Captcha.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function __construct($captcha, $options)
8686
$this->provider = $registry->get($captcha);
8787
} else {
8888
@trigger_error(
89-
'Use of legacy Captcha is deprecated. Use onCaptchaSetup event to register your Captcha provider.',
89+
'Use of legacy Captcha is deprecated. Use onCaptchaSetup event to register your Captcha provider. Will be removed in 7.0.',
9090
E_USER_DEPRECATED
9191
);
9292

@@ -130,10 +130,10 @@ public static function getInstance($captcha, array $options = [])
130130
*
131131
* @return boolean True on success
132132
*
133-
* @since 2.5
134133
* @throws \RuntimeException
135134
*
136-
* @deprecated Without replacement
135+
* @since 2.5
136+
* @deprecated Without replacement. Will be removed in 7.0.
137137
*/
138138
public function initialise($id)
139139
{
@@ -253,7 +253,7 @@ public function setupField(CaptchaField $field, \SimpleXMLElement $element)
253253
*
254254
* @since 4.0.0
255255
*
256-
* @deprecated Without replacement
256+
* @deprecated Without replacement. Will be removed in 7.0.
257257
*/
258258
private function update($name, &$args)
259259
{
@@ -271,10 +271,10 @@ private function update($name, &$args)
271271
*
272272
* @return void
273273
*
274-
* @since 2.5
275274
* @throws \RuntimeException
276275
*
277-
* @deprecated Should use CaptchaRegistry
276+
* @since 2.5
277+
* @deprecated Should use CaptchaRegistry. Will be removed in 7.0.
278278
*/
279279
private function _load(array $options = [])
280280
{

libraries/src/Editor/Button/Button.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function get(string $name, $default = null)
7979
{
8080
if ($name === 'options') {
8181
@trigger_error(
82-
'Accessing options property is deprecated. To access the Button options use getOptions() method.',
82+
'Accessing options property is deprecated. To access the Button options use getOptions() method. Will be removed in 7.0.',
8383
\E_USER_DEPRECATED
8484
);
8585

@@ -102,7 +102,7 @@ public function set(string $name, $value): ButtonInterface
102102
{
103103
if ($name === 'options') {
104104
@trigger_error(
105-
'Accessing options property is deprecated. To set the Button options use setOptions() method.',
105+
'Accessing options property is deprecated. To set the Button options use setOptions() method. Will be removed in 7.0.',
106106
\E_USER_DEPRECATED
107107
);
108108

@@ -148,11 +148,11 @@ public function setOptions(array $options): ButtonInterface
148148
* @return string|null A value if the property name is valid, null otherwise.
149149
*
150150
* @since 5.0.0
151-
* @deprecated 6.0 This is a B/C proxy for deprecated read accesses
151+
* @deprecated 7.0 This is a B/C proxy for deprecated read accesses
152152
*/
153153
public function __get($name)
154154
{
155-
@trigger_error('Property access is deprecated in Joomla\CMS\Editor\Button class, use get/set methods.', \E_USER_DEPRECATED);
155+
@trigger_error('Property access is deprecated in Joomla\CMS\Editor\Button class, use get/set methods. Will be removed in 7.0.', \E_USER_DEPRECATED);
156156

157157
return $this->get($name);
158158
}
@@ -166,11 +166,11 @@ public function __get($name)
166166
* @return void
167167
*
168168
* @since 5.0.0
169-
* @deprecated 6.0 This is a B/C proxy for deprecated write accesses
169+
* @deprecated 7.0 This is a B/C proxy for deprecated write accesses
170170
*/
171171
public function __set($name, $value)
172172
{
173-
@trigger_error('Property access is deprecated in Joomla\CMS\Editor\Button class, use get/set methods.', \E_USER_DEPRECATED);
173+
@trigger_error('Property access is deprecated in Joomla\CMS\Editor\Button class, use get/set methods. Will be removed in 7.0.', \E_USER_DEPRECATED);
174174

175175
$this->set($name, $value);
176176
}

libraries/src/Editor/Button/ButtonsRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function initRegistry(array $options = []): ButtonsRegistryInterface
121121
continue;
122122
}
123123

124-
@trigger_error('6.0 Button "' . $plugin->name . '" instance should be set up onEditorButtonsSetup event.', \E_USER_DEPRECATED);
124+
@trigger_error('7.0 Button "' . $plugin->name . '" instance should be set up onEditorButtonsSetup event.', \E_USER_DEPRECATED);
125125

126126
// Transform Legacy buttons to Button object
127127
if ($legacyButton instanceof CMSObject || $legacyButton instanceof Registry) {

libraries/src/Editor/Editor.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function __construct(string $editor = 'none', ?DispatcherInterface $dispa
104104
} else {
105105
// Fallback to legacy editor logic
106106
@trigger_error(
107-
'6.0 Discovering an editor "' . $this->_name . '" outside of EditorsRegistry is deprecated.',
107+
'7.0 Discovering an editor "' . $this->_name . '" outside of EditorsRegistry is deprecated.',
108108
\E_USER_DEPRECATED
109109
);
110110

@@ -120,7 +120,7 @@ public function __construct(string $editor = 'none', ?DispatcherInterface $dispa
120120
'getButtons',
121121
function (AbstractEvent $event) {
122122
@trigger_error(
123-
'6.0 Use Button "getButtons" event is deprecated, buttons should be set up onEditorButtonsSetup event.',
123+
'7.0 Use Button "getButtons" event is deprecated, buttons should be set up onEditorButtonsSetup event.',
124124
\E_USER_DEPRECATED
125125
);
126126

@@ -161,7 +161,7 @@ public static function getInstance($editor = 'none')
161161
*
162162
* @since 1.5
163163
*
164-
* @deprecated 6.0 Without replacement
164+
* @deprecated 7.0 Without replacement
165165
*/
166166
public function initialise()
167167
{
@@ -174,7 +174,7 @@ public function initialise()
174174
return;
175175
}
176176

177-
@trigger_error('6.0 Method onInit() for Editor instance is deprecated, without replacement.', \E_USER_DEPRECATED);
177+
@trigger_error('7.0 Method onInit() for Editor instance is deprecated, without replacement.', \E_USER_DEPRECATED);
178178

179179
if (method_exists($this->_editor, 'onInit')) {
180180
\call_user_func([$this->_editor, 'onInit']);
@@ -316,7 +316,7 @@ public function getButtons($editor, $buttons = true)
316316
*
317317
* @since 1.5
318318
*
319-
* @deprecated 6.0 Should use EditorRegistry
319+
* @deprecated 7.0 Should use EditorRegistry
320320
*/
321321
protected function _loadEditor($config = [])
322322
{
@@ -325,7 +325,7 @@ protected function _loadEditor($config = [])
325325
return false;
326326
}
327327

328-
@trigger_error('6.0 Editor "' . $this->_name . '" instance should be set up onEditorSetup event.', \E_USER_DEPRECATED);
328+
@trigger_error('7.0 Editor "' . $this->_name . '" instance should be set up onEditorSetup event.', \E_USER_DEPRECATED);
329329

330330
// Build the path to the needed editor plugin
331331
$name = InputFilter::getInstance()->clean($this->_name, 'cmd');

phpstan-baseline.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11479,7 +11479,7 @@ parameters:
1147911479
-
1148011480
message: '''
1148111481
#^Call to deprecated method _load\(\) of class Joomla\\CMS\\Captcha\\Captcha\:
11482-
Should use CaptchaRegistry$#
11482+
Should use CaptchaRegistry\. Will be removed in 7\.0\.$#
1148311483
'''
1148411484
identifier: method.deprecated
1148511485
count: 1

plugins/editors/tinymce/src/Extension/TinyMCE.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class TinyMCE extends CMSPlugin implements SubscriberInterface, Dispatcher
3939
use DatabaseAwareTrait;
4040
use DispatcherAwareTrait;
4141

42-
// @todo: KnownButtons, ToolbarPresets for backward compatibility. Remove in Joomla 6
42+
// @todo: KnownButtons, ToolbarPresets for backward compatibility. Remove in Joomla 7
4343
use KnownButtons;
4444
use ToolbarPresets;
4545

0 commit comments

Comments
 (0)