Apply a user supplied function to every member of Session array

@param callable $callback
@param mixed $userData
@return array
778013
public static function Walk($callback, $userData = null) {
		self::start ();
		array_walk ( $_SESSION, $callback, $userData );
		return $_SESSION;
	}
1093922
public static function call( $callback, array $parameters = [], $defaultMethod = null )
	{
		if ( is_string( $callback ) && strpos( $callback, '@' ) !== false || $defaultMethod )
		{
			$segments = explode( '@', $callback );
			$method = count( $segments ) == 2 ? $segments[1] : $defaultMethod;

			if ( is_null( $method ) )
				throw new \InvalidArgumentException( 'Method not provided.' );

			$callback = [static::resolve( $segments[0] ), $method];
		}

		$dependencies = static::getMethodDependencies( $callback, $parameters );

		return call_user_func_array( $callback, $dependencies );
	}
731015
static function executeCallback($callback, array $params = array()) {
    // If callback has @
    if (is_string($callback) && strpos($callback, '@') !== false) {
      // Split
      $arrCallback = explode('@', $callback);
      // Set object
      $object = class_exists($arrCallback[0]) ? (new $arrCallback[0]()) : null;
      // Set method
      $method = isset($arrCallback[0]) ? $arrCallback[0] : null;
      // Set callback
      $callback = array($object, $method);
    }
    // If not callable
    if ( ! is_callable($callback)) {
      // Throw error
      throw new InvalidCallback('Callback must be callable');
    }
    // Execute and return
    return call_user_func_array($callback, $params);
  }
660278
public function each($callback)
    {
        array_walk($this->array, function($value, $key) use ($callback) {
            $callback($key, $value);
        });

        return $this;
    }
1276346
public function createNew(array $authData, array $userData) {
        // first save the new user
        $userModel  = new Model_User();
        $userId     = $userModel->insert($userData);
        $userData   = $userModel->find($userId)->current();
        $authData['user_id'] = $userId;
        $this->insert($authData);

        $this->getObserver('Authenticatable')->updateLoginStats($userId);
        return $userData;
    }
266209
public function run(callable $callback, ...$params)
    {
        $item = array_shift($this->instances);
        if (empty($item)) {
            return call_user_func_array($callback, $params);
        }
        return $item->handle($callback, function () use ($callback, $params) {
            return $this->run($callback, ...$params);
        });
    }
171172
public function each($data = [], Closure $callback)
    {
        $factory = $this->getFactory();
        $results = array();
        foreach ($data as $item) {
            $callback($factory, $item);
            $results[] = $factory->getResults();
        }

        return $results;
    }
978602
public function each(callable $callback)
    {
        foreach ($this->collection as $key => $value) {
            $callback($value, $key);
        }
    }
455648
public function each(callable $callback, $count = 1000)
    {
        $result = $this->getBuilder()->each($callback, $count);

        // Reset query builder
        $this->resetBuilder();

        return $result;
    }
994845
protected static function callback($callback)
    {
        if( is_string($callback) && ! is_callable($callback) )
        {
            return self::controllerCallback($callback);
        }

        return $callback;
    }
103672
private function updateData($callback = null): void
    {
        $queryBuilder = $this->dbUtils->getConn()->createQueryBuilder();
        if ($this->limit === 0) {
            $this->setLimit($this->dbUtils->countResults($this->entity));
        }

        $this->expression->evaluateExpressions(
            $this->configEntities[$this->entity]['pre_actions']
        );

        $startAt = 0; // The first part of the limit (offset)
        $num = 0; // The number of rows updated
        while ($num < $this->limit) {
            $rows = $queryBuilder
                ->select('*')->from($this->entity)
                ->setFirstResult($startAt)->setMaxResults($this->batchSize)
                ->orderBy($this->priKey)
                ->execute();

            // I need to read line by line if I have to update the table
            // to make sure I do update by update (slower but no other choice for now)
            foreach ($rows as $row) {
                // Call the right method according to the mode
                $this->{$this->updateMode[$this->mode]}($row);

                if ($callback !== null) {
                    $callback(++$num);
                }
                // Have to exit now as we have reached the max
                if ($num >= $this->limit) {
                    break 2;
                }
            }
            // Move the offset
            // Make sure the loop ends if we have nothing to process
            $num = $startAt += $this->batchSize;
        }
        // Run a final method if defined
        if ($this->mode === 'batch') {
            $this->loadDataInBatch('update');
        }

        $this->expression->evaluateExpressions(
            $this->configEntities[$this->entity]['post_actions']
        );
    }
930615
public function each( $callback ) {

			if ( is_callable( $callback ) ) {

				for ( $i=0; $i < $this->len; $i++ ) {

					if ( call_user_func( $callback, $this->items[$i], $i, $this ) === false ) {
						break;
					}

				}

			}

			return $this;

		}
175388
private function triggerCallback($callback, $arguments)
    {
        if (is_array($callback)) {
            $this->import($callback[0]);
            return call_user_func_array(array($this->{$callback[0]}, $callback[1]), $arguments);
        } elseif (is_callable($callback)) {
            return call_user_func_array($callback, $arguments);
        }

        return null;
    }
1201105
protected function _afterLogin(array $userData, &$targetUrl) {
        if ($loginHelper = $this->_getLoginHelper()) {
            $loginHelper->afterLogin($userData, $targetUrl);
        }
    }
782412
public function login( UserData $user ) {
		// clear session
		foreach ( $_SESSION as $key => $value ) {
			unset( $_SESSION[$key] );
		}

		// generate new session id
		session_regenerate_id( true );

		// store user info in session
		$this->setUser( $user );
	}
137388
public static function hydrate(stdClass $callback)
    {
        $hydrated = new CallbackEntity();

        if (isset($callback->id)) {
            $hydrated->setId($callback->id);
        }

        if (isset($callback->internal)) {
            $hydrated->setInternal($callback->internal);
        }

        if (isset($callback->observe_organization)) {
            $hydrated->setObserveOrganization($callback->observe_organization);
        }

        if (isset($callback->url)) {
            $hydrated->setUrl($callback->url);
        }

        if (isset($callback->reports) && is_array($callback->reports)) {
            $hydrated->setReports($callback->reports);
        }

        if (isset($callback->created_at)) {
            $hydrated->setCreatedAt(new DateTime($callback->created_at));
        }

        if (isset($callback->created_by)) {
            $hydrated->setCreatedBy(UserHydrator::hydrate($callback->created_by));
        }

        if (isset($callback->users) && is_array($callback->users)) {
            $hydrated->setUsers(UserHydrator::hydrateCollection($callback->users));
        }

        if (isset($callback->applications) && is_array($callback->applications)) {
            $hydrated->setApplications(ApplicationHydrator::hydrateCollection($callback->applications));
        }

        if (isset($callback->scans) && is_array($callback->scans)) {
            $hydrated->setScans(ScanHydrator::hydrateCollection($callback->scans));
        }

        return $hydrated;
    }
1336142
public boolean addUserData(Object userData) {
		if (this.userData == null) {
			this.userData = new ArrayList<>();
		}
		return this.userData.add(userData);
	}