mirror of
https://github.com/flarum/core.git
synced 2025-08-16 21:34:08 +02:00
Remove deprecated code from beta 16 (#2705)
This commit is contained in:
committed by
GitHub
parent
374189d48e
commit
908d087e00
@@ -74,28 +74,6 @@ class ApiSerializer implements ExtenderInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add to or modify the attributes array of this serializer.
|
||||
*
|
||||
* @param callable|string $callback
|
||||
*
|
||||
* The callback can be a closure or an invokable class, and should accept:
|
||||
* - $serializer: An instance of this serializer.
|
||||
* - $model: An instance of the model being serialized.
|
||||
* - $attributes: An array of existing attributes.
|
||||
*
|
||||
* The callable should return:
|
||||
* - An array of additional attributes to merge with the existing array.
|
||||
* Or a modified $attributes array.
|
||||
*
|
||||
* @deprecated in beta 16, removed in beta 17
|
||||
* @return self
|
||||
*/
|
||||
public function mutate($callback)
|
||||
{
|
||||
return $this->attributes($callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Establish a simple hasOne relationship from this serializer to another serializer.
|
||||
* This represents a one-to-one relationship.
|
||||
|
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Extend;
|
||||
|
||||
use Flarum\Extension\Extension;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
|
||||
/**
|
||||
* This class is used to wrap old bootstrap.php closures (as used in versions up
|
||||
* to 0.1.0-beta7) in the new Extender format.
|
||||
*
|
||||
* This gives extensions the chance to work with the new API without making any
|
||||
* changes, and have some time to convert to the pure usage of extenders.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
class Compat implements ExtenderInterface
|
||||
{
|
||||
private $callback;
|
||||
|
||||
public function __construct($callback)
|
||||
{
|
||||
$this->callback = $callback;
|
||||
}
|
||||
|
||||
public function extend(Container $container, Extension $extension = null)
|
||||
{
|
||||
$container->call($this->callback);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user