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

ENH Don't use deprecated method #1255

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Extensions/ElementalLeftAndMainExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ElementalLeftAndMainExtension extends Extension
{
public function __construct()
{
Deprecation::withNoReplacement(
Deprecation::withSuppressedNotice(
fn () => Deprecation::notice('5.3.0', 'Will be replaced with YAML configuration', Deprecation::SCOPE_CLASS)
);
parent::__construct();
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/Resolvers/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Resolver
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedNotice(function () {
$message = 'Will be removed without equivalent functionality to replace it';
Deprecation::notice('5.3.0', $message, Deprecation::SCOPE_CLASS);
});
Expand Down
6 changes: 3 additions & 3 deletions src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public function canDelete($member = null)
if ($this->hasMethod('getPage')) {
if ($page = $this->getPage()) {
if ($page->hasExtension(Versioned::class)) {
return Deprecation::withNoReplacement(fn() => $page->canArchive($member));
return Deprecation::withSuppressedNotice(fn() => $page->canArchive($member));
} else {
return $page->canDelete($member);
}
Expand Down Expand Up @@ -1166,7 +1166,7 @@ public function getDescription()
*/
public function getTypeNice()
{
$description = Deprecation::withNoReplacement(fn () => $this->getDescription());
$description = Deprecation::withSuppressedNotice(fn () => $this->getDescription());
$desc = ($description) ? ' <span class="element__note"> &mdash; ' . $description . '</span>' : '';

return DBField::create_field(
Expand Down Expand Up @@ -1285,7 +1285,7 @@ public function EvenOdd()
*/
public static function getGraphQLTypeName(): string
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedNotice(function () {
Deprecation::notice('5.3.0', 'Will be replaced with getTypeName()');
});
// For GraphQL 3, use the static schema type name - except for BaseElement for which this is inconsistent.
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/FieldType/DBObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DBObjectType extends DBField
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedNotice(function () {
$message = 'Will be removed without equivalent functionality to replace it';
Deprecation::notice('5.3.0', $message, Deprecation::SCOPE_CLASS);
});
Expand Down
2 changes: 1 addition & 1 deletion src/TopPage/DataExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DataExtension extends BaseDataExtension

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedNotice(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with DNADesign\Elemental\Extensions\TopPageElementExtension',
Expand Down
2 changes: 1 addition & 1 deletion src/TopPage/FluentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FluentExtension extends DataExtension

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedNotice(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with DNADesign\Elemental\Extensions\TopPageFluentElementExtension',
Expand Down
2 changes: 1 addition & 1 deletion src/TopPage/SiteTreeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SiteTreeExtension extends BaseSiteTreeExtension

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedNotice(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with DNADesign\Elemental\Extensions\TopPageSiteTreeExtension',
Expand Down
Loading