[DI][Serializer] Add missing deprecations
This commit is contained in:
parent
a55903628a
commit
90ba197cef
@ -70,12 +70,18 @@ class Compiler
|
|||||||
* @param string $type The type of the pass
|
* @param string $type The type of the pass
|
||||||
* @param int $priority Used to sort the passes
|
* @param int $priority Used to sort the passes
|
||||||
*/
|
*/
|
||||||
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/**, $priority = 0*/)
|
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
|
||||||
{
|
{
|
||||||
// For BC
|
|
||||||
if (func_num_args() >= 3) {
|
if (func_num_args() >= 3) {
|
||||||
$priority = func_get_arg(2);
|
$priority = func_get_arg(2);
|
||||||
} else {
|
} else {
|
||||||
|
if (__CLASS__ !== get_class($this)) {
|
||||||
|
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||||
|
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||||
|
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$priority = 0;
|
$priority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,10 +96,16 @@ class PassConfig
|
|||||||
*/
|
*/
|
||||||
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
|
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
|
||||||
{
|
{
|
||||||
// For BC
|
|
||||||
if (func_num_args() >= 3) {
|
if (func_num_args() >= 3) {
|
||||||
$priority = func_get_arg(2);
|
$priority = func_get_arg(2);
|
||||||
} else {
|
} else {
|
||||||
|
if (__CLASS__ !== get_class($this)) {
|
||||||
|
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||||
|
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||||
|
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$priority = 0;
|
$priority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,9 +310,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||||||
*
|
*
|
||||||
* @return ContainerBuilder The current instance
|
* @return ContainerBuilder The current instance
|
||||||
*/
|
*/
|
||||||
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/**, $priority = 0*/)
|
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/)
|
||||||
{
|
{
|
||||||
// For BC
|
|
||||||
if (func_num_args() >= 3) {
|
if (func_num_args() >= 3) {
|
||||||
$priority = func_get_arg(2);
|
$priority = func_get_arg(2);
|
||||||
} else {
|
} else {
|
||||||
|
@ -289,7 +289,18 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
|
|||||||
*/
|
*/
|
||||||
protected function instantiateObject(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes/*, $format = null*/)
|
protected function instantiateObject(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes/*, $format = null*/)
|
||||||
{
|
{
|
||||||
$format = func_num_args() >= 6 ? func_get_arg(5) : null;
|
if (func_num_args() >= 6) {
|
||||||
|
$format = func_get_arg(5);
|
||||||
|
} else {
|
||||||
|
if (__CLASS__ !== get_class($this)) {
|
||||||
|
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||||
|
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||||
|
@trigger_error(sprintf('Method %s() will have a 6th `$format = null` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$format = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isset($context[static::OBJECT_TO_POPULATE]) &&
|
isset($context[static::OBJECT_TO_POPULATE]) &&
|
||||||
|
@ -59,9 +59,9 @@ class AbstractObjectNormalizerDummy extends AbstractObjectNormalizer
|
|||||||
return in_array($attribute, array('foo', 'baz'));
|
return in_array($attribute, array('foo', 'baz'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function instantiateObject(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes)
|
public function instantiateObject(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes, $format = null)
|
||||||
{
|
{
|
||||||
return parent::instantiateObject($data, $class, $context, $reflectionClass, $allowedAttributes);
|
return parent::instantiateObject($data, $class, $context, $reflectionClass, $allowedAttributes, $format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user