@param callable|null|string $callbackOrValue
@param string|null          $className

@return Badge
353932
public function badge($callbackOrValue = null, $className = null)
    {
        $badge = $this->container->make('Maatwebsite\Sidebar\Badge');

        if (is_callable($callbackOrValue)) {
            $this->call($callbackOrValue, $badge);
        } elseif ($callbackOrValue) {
            $badge->setValue($callbackOrValue);
        }

        if ($className) {
            $badge->setClass($className);
        }

        $this->addBadge($badge);

        return $badge;
    }
138518
function Badge({ className, children, color = "primary" }: Props): React.Node {
  const classes = cn(
    {
      badge: true,
      [`badge-${color}`]: color,
    },
    className
  );
  return <span className={classes}>{children}</span>;
}
857694
public function parser(
        string $className,
        $objectAnnotation = null,
        string $propertyName = "",
        string $methodName = "",
        $propertyValue = null
    ) {

        PoolCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue);
        return [$className, Scope::SINGLETON, ""];
    }
525906
public static function collect(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        if ($objectAnnotation instanceof Definition) {

            $name = $objectAnnotation->getName();
            self::$definitions[$className] = empty($name) ? $className : $name;
        }
    }
1279723
public function belongs($name, $foreignKeyOrCallback = null, $callback = null, $storeKey = null)
    {
        $foreignKey = null;
        if (func_num_args() < 4 && is_callable($foreignKeyOrCallback)) {
            $storeKey = $callback;
            $callback = $foreignKeyOrCallback;
        } else {
            $foreignKey = $foreignKeyOrCallback;
        }
        $foreignKey = $foreignKey ? : $this->rows
            ->getTable()
            ->getStructure()
            ->foreignKey($name, $this->getRows()->getTable()->getTableName());
        $relations = $this->getRows()->loadBelongRelations($name, $foreignKey, $callback, $storeKey);
        $this->loadedRelations[] = [
            $storeKey ? : $name, 'belongs', $foreignKey
        ];
        return $relations->find($this->$foreignKey);
    }
761690
public static function LasyClassVarAccessCallback ($name, $call_back) {
		if (!static::HasClassVar($name)) {
			static::$_ApplicationVariableTrait_Data[$name] = $call_back();
			static::$_ApplicationVariableTrait_ConstList[implode('=>', Arrays::AdjustArray($name))] = false;
		}
		return static::$_ApplicationVariableTrait_Data[$name];
	}
256792
protected function setResult($hydratorset = null, $callback = null) {

        $res = $this->builder->getQuery()->execute();
        $call = "Searcher\\Searcher\\Hydrators\\" . ucfirst($hydratorset) . "Hydrator";

        if ($res->valid() === true) {

            if(class_exists($call) === true) {

                $res = (new $call($res))->extract($callback);

            }
            return $res;
        }
        return null;

    }
1049100
public function provideResolver(FieldValue $fieldValue): Closure
    {
        if ($fieldValue->parentIsRootType()) {
            $resolverClass = Utils::namespaceClassname(
                Str::studly($fieldValue->getFieldName()),
                $fieldValue->defaultNamespacesForParent(),
                function (string $class): bool {
                    return method_exists($class, 'resolve');
                }
            );

            if (! $resolverClass) {
                throw new DefinitionException(
                    "Could not locate a default resolver for the field {$fieldValue->getFieldName()}"
                );
            }

            return Closure::fromCallable(
                [app($resolverClass), 'resolve']
            );
        }

        return Closure::fromCallable(
            Executor::getDefaultFieldResolver()
        );
    }
85169
protected function convertCallbackToClosure($callback, $namespace)
    {
        if ($callback instanceof Closure || is_callable($callback)) {
            return $callback;
        } elseif (is_string($callback)) {
            $namespace = rtrim($namespace, '\\').'\\';
            $arrCallback = explode('::', $callback);
            $isStaticCall = count($arrCallback) == 2;
            if ($isStaticCall) {
                $className = $namespace.$arrCallback[0];
                return [$className, $arrCallback[1]];
            } else {
                $arrCallback = explode(':', $callback);
                $className = $namespace.$arrCallback[0];
                // Must be replaced with a safer way to instantiate an object
                $obj = $this->container->get($className);
                return [$obj, $arrCallback[1]];
            }
        }
    }
672721
public function Save($callBackURL = null)
	{
		if ($this->request == null)
		{
			throw new GrabzItException("No parameters have been set.", GrabzItException::PARAMETER_MISSING_PARAMETERS);
		}

		$sig = $this->encode($this->request->getOptions()->_getSignatureString($this->applicationSecret, $callBackURL, $this->request->getTargetUrl()));
		
		$obj = $this->_take($sig, $callBackURL);
		
		if ($obj == null)
		{
			$obj = $this->_take($sig, $callBackURL);
		}
		
		if ($obj == null)
		{
			throw new GrabzItException("An unknown network error occurred, please try calling this method again.", GrabzItException::NETWORK_GENERAL_ERROR);
		}

		if ($obj->ID != null)
		{
			return $obj->ID->__toString();
		}
		
		return $obj->ID;
	}
226214
public static function collect(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        if ($objectAnnotation instanceof Breaker) {
            $breakerName = $objectAnnotation->getName();
            $breakerName = empty($breakerName) ? $className : $breakerName;

            self::$breakers[$breakerName] = $className;
        }
    }
1214005
public function when($value, $callback, $default = null)
    {
        if ($value) {
            return $callback($this, $value) ?: $this;
        } elseif ($default) {
            return $default($this, $value) ?: $this;
        }

        return $this;
    }
554274
public function put($keyOrValue, $value = null, $keySource = null)
    {
        $key = $value === null ? null : $keyOrValue;
        $value = $value === null ? $keyOrValue : $value;

        $keySource = $keySource ?: $value;

        $key = $key ?: $this->key($keySource);
        $tags = $this->categorizer->tags($keySource);
        $lifetime = $this->categorizer->lifetime($keySource);

        $this->callBeforeListeners('put', [$this->storageName, $key, $value, $tags, $lifetime]);
        $this->storage->put($key, $value, $tags, $lifetime);
        $this->callAfterListeners('put', [$this->storageName, $key, $value, $tags, $lifetime]);

        return $this;
    }
847178
public static function build(IIdentifiableObjectSet $dataSource, callable $objectValidationCallback = null) : IForm
    {
        return Form::create()->section('Object', [
            self::objectField(Field::create(), $dataSource, $objectValidationCallback),
        ])->build();
    }
871877
function createFilter($callbackOrFilterName, $options = null, $resursive = false)
    {
        if (is_callable($callbackOrFilterName)) {
            $filter = new Callback(array(
                'callback' => $callbackOrFilterName,
                'arguments' => $options
            ), $resursive);
        } elseif (is_string($callbackOrFilterName)) {
            if (class_exists('\Sirius\Filtration\Filter\\' . $callbackOrFilterName)) {
                $callbackOrFilterName = '\Sirius\Filtration\Filter\\' . $callbackOrFilterName;
            }
            // use the validator map
            if (isset($this->filtersMap[strtolower($callbackOrFilterName)])) {
                $callbackOrFilterName = $this->filtersMap[strtolower($callbackOrFilterName)];
            }
            if (class_exists($callbackOrFilterName) && is_subclass_of($callbackOrFilterName, '\Sirius\Filtration\Filter\AbstractFilter')) {
                $filter = new $callbackOrFilterName($options, $resursive);
            } else {
                throw new \InvalidArgumentException(sprintf('Impossible to determine the filter based on the name %s', (string) $callbackOrFilterName));
            }
        } elseif (is_object($callbackOrFilterName) && $callbackOrFilterName instanceof AbstractFilter) {
            $filter = $callbackOrFilterName;
        }
        if (! isset($filter)) {
            throw new \InvalidArgumentException('Invalid value for the $callbackorFilterName parameter');
        }
        return $filter;
    }
401001
public function hasAndBelongsTo($entity, callable $callback = null, $alias = null)
    {
        return $this->returnRelation(HasAndBelongsTo::class, $entity, $callback, $alias);
    }
1244994
public function filter($callback = null)
    {
        if ($callback !== null)
            $value = array_filter($this->value, $callback);
        else
            $value = array_filter($this->value);

        return $this->setValue($value);
    }