<commit_before><?php
namespace phpFastCache\Helper;

use InvalidArgumentException;
use phpFastCache\CacheManager;
use phpFastCache\Core\Item\ExtendedCacheItemInterface;
use phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface;
use phpFastCache\EventManager;
use Psr\Cache\CacheItemInterface;

/**
 * Class ActOnAll
 * @package phpFastCache\Helper
 */
class ActOnAll implements ExtendedCacheItemPoolInterface
{

    /**
     * @var array|\phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface[]
     */
    protected $instances = [];

    /**
     * ActOnAll constructor.
     */
    public function __construct()
    {
        $this->instances =& CacheManager::getInternalInstances();
    }

    /**
     * @return \Closure
     */
    protected function getGenericCallback()
    {
        return function($method, $args){
            $getterMethod = (strpos($method, 'get') === 0);
            $return = false;

            if($getterMethod){
                $return = [];
            }

            foreach ($this->instances as $instance)
            {
                $reflectionMethod = new \ReflectionMethod(get_class($instance), $method);
                if($getterMethod){
                    $return[ $instance->getDriverName() ] = $reflectionMethod->invokeArgs($instance, $args);<commit_msg>Fixed type on ActOnAll interface<commit_after><?php
namespace phpFastCache\Helper;

use phpFastCache\CacheManager;
use phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface;
use phpFastCache\EventManager;
use Psr\Cache\CacheItemInterface;

/**
 * Class ActOnAll
 * @package phpFastCache\Helper
 */
class ActOnAll implements ExtendedCacheItemPoolInterface
{

    /**
     * @var ExtendedCacheItemPoolInterface[]
     */
    protected $instances = [];

    /**
     * ActOnAll constructor.
     */
    public function __construct()
    {
        $this->instances =& CacheManager::getInternalInstances();
    }

    /**
     * @return \Closure
     */
    protected function getGenericCallback()
    {
        return function($method, $args){
            $getterMethod = (strpos($method, 'get') === 0);
            $return = false;

            if($getterMethod){
                $return = [];
            }

            foreach ($this->instances as $instance)
            {
                $reflectionMethod = new \ReflectionMethod(get_class($instance), $method);
                if($getterMethod){
                    $return[ $instance->getDriverName() ] = $reflectionMethod->invokeArgs($instance, $args);
{'fraction_non_alphanumeric': 0.12130885873902633, 'fraction_numerical': 0.0007980845969672786, 'mean_word_length': 2.5610795454545454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '913869', 'n_tokens_mistral': 706, 'n_tokens_neox': 664, 'n_words': 125}