mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/17176] Resolve deprecation notices
PHPBB3-17176
This commit is contained in:
@@ -73,7 +73,7 @@ class config extends Extension
|
||||
*/
|
||||
protected function convert_30_acm_type($acm_type)
|
||||
{
|
||||
if (preg_match('#^[a-z]+$#', $acm_type))
|
||||
if (preg_match('#^[a-z]+$#', $acm_type ?? ''))
|
||||
{
|
||||
return 'phpbb\\cache\\driver\\' . $acm_type;
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ class ordered_service_collection extends service_collection
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getIterator()
|
||||
public function getIterator(): \Iterator
|
||||
{
|
||||
if (!$this->is_ordered)
|
||||
{
|
||||
@@ -59,27 +59,27 @@ class ordered_service_collection extends service_collection
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetExists($index)
|
||||
public function offsetExists($key): bool
|
||||
{
|
||||
if (!$this->is_ordered)
|
||||
{
|
||||
$this->sort_services();
|
||||
}
|
||||
|
||||
return parent::offsetExists($index);
|
||||
return parent::offsetExists($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetGet($index)
|
||||
public function offsetGet($key): mixed
|
||||
{
|
||||
if (!$this->is_ordered)
|
||||
{
|
||||
$this->sort_services();
|
||||
}
|
||||
|
||||
return parent::offsetGet($index);
|
||||
return parent::offsetGet($key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -46,7 +46,7 @@ class service_collection extends \ArrayObject
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getIterator()
|
||||
public function getIterator(): \Iterator
|
||||
{
|
||||
return new service_collection_iterator($this);
|
||||
}
|
||||
@@ -54,9 +54,9 @@ class service_collection extends \ArrayObject
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetGet($index)
|
||||
public function offsetGet($key): mixed
|
||||
{
|
||||
return $this->container->get($index);
|
||||
return $this->container->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -39,7 +39,7 @@ class service_collection_iterator extends \ArrayIterator
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function current()
|
||||
public function current(): mixed
|
||||
{
|
||||
return $this->collection->offsetGet($this->key());
|
||||
}
|
||||
|
Reference in New Issue
Block a user