Get the default handlers defined by the Jasny Typecast library

@return HandlerInterface[]
339164
public static function getDefaultHandlers(): array
    {
        $numberHandler = new NumberHandler();

        return [
            'array' => new ArrayHandler(),
            'boolean' => new BooleanHandler(),
            'float' => $numberHandler,
            'integer' => $numberHandler,
            'number' => $numberHandler,
            'mixed' => new MixedHandler(),
            'object' => new ObjectHandler(),
            'resource' => new ResourceHandler(),
            'string' => new StringHandler(),
            'multiple' => new MultipleHandler()
        ];
    }
131646
public function getAJAXTypeHandlers()
    {
        if ($this->ajaxTypeHandlers != null) {
            return $this->ajaxTypeHandlers;
        }

        $this->ajaxTypeHandlers = array();

        /** @noinspection PhpUndefinedFieldInspection */
        if (!$this->configFile->AJAXTypeHandlers->getName()) {
            return $this->ajaxTypeHandlers;
        }


        /** @noinspection PhpUndefinedFieldInspection */
        foreach ($this->configFile->AJAXTypeHandlers->class as $handler) {
            $class_array = array("class_name" => (string)$handler);
            if (isset($handler['link'])) {
                $class_array['link'] = $this->rootPath . "/" . $handler['link'];
            }
            $this->ajaxTypeHandlers[] = $class_array;
        }
        return $this->ajaxTypeHandlers;
    }
517629
private function buildDefaultAsyncHandler()
    {
        $isGuzzleHandler = $this->httpHandler instanceof Guzzle6HttpHandler
            || $this->httpHandler instanceof Guzzle5HttpHandler;

        return $isGuzzleHandler
            ? [$this->httpHandler, 'async']
            : [HttpHandlerFactory::build(), 'async'];
    }
983608
public function getDefaultParameters()
    {
        return [
            'vendor' => null,
            'testMode' => false,
            'referrerId' => null,
            'language' => null,
            'useOldBasketFormat' => false,
            'exitOnResponse' => false,
            'apply3DSecure' => null,
            'useAuthenticate' => null,
            'accountType' => null,
        ];
    }
930680
public function getDeafultHandlers()
	{
		return [

			// return hash of input file

			'contenthash' => function ($file) {

				if ( ! isset($this->hasher))
				{
					$this->hasher = new Hasher;
				}

				return $this->hasher->file($file);
			},

			// return ext of input file

			'ext' => function ($file) {

				return $file->getClientOriginalExtension();
			}

		];
	}
799577
protected function defaultHandler()/*# : bool */
    {
        $status = $this->result->getStatus();
        $handler = $this->result->getHandler() ?: $this->getHandler($status);

        if ($handler) {
            $param = ['result' => $this->result];
            $callable = $this->getResolver()->resolve($handler);
            if ($this->trigger(self::EVENT_BEFORE_HANDLER, $param)) {
                call_user_func($callable, $this->result);
                $this->trigger(self::EVENT_AFTER_HANDLER, $param);
            }
        }
        return false;
    }
526912
public function getHandlers()
    {
        $handlers = &gplcart_static('mail.handlers');

        if (isset($handlers)) {
            return $handlers;
        }

        $handlers = (array) gplcart_config_get(GC_FILE_CONFIG_MAIL);
        $this->hook->attach('mail.handlers', $handlers, $this);
        return $handlers;
    }
163041
protected function getDefaultLoopListeners()
    {
        $listeners = [];

        if (ProcessForker::isSupported() && $this->config->usePcntl()) {
            $listeners[] = new ProcessForker();
        }

        if (RunkitReloader::isSupported()) {
            $listeners[] = new RunkitReloader();
        }

        return $listeners;
    }
1207405
protected function assignToHandlers(array $objects)
    {
        $result = [];
        $perType = TypedUtils::groupByType($objects);
        foreach ($this->handlers as $handler) {
            $remainingTypes = array_keys($perType);
            $handlerTypes = $handler->getSupportedEntityTypes();
            $useTypes = $handlerTypes === null ? $remainingTypes : array_intersect($handlerTypes, $remainingTypes);
            if (count($useTypes) > 0) {
                $assigned = [];
                foreach ($useTypes as $type) {
                    $assigned[] = $perType[$type];
                    unset($perType[$type]);
                }
                $result[] = [$handler, Arrays::flatten($assigned)];
                if (count($perType) === 0) {
                    // Done
                    break;
                }
            }
        }

        return $result;
    }
635161
public static function getDefaultHandler()
    {
        $default = $future = null;

        if (extension_loaded('curl')) {
            $config = [
                'select_timeout' => getenv('GUZZLE_CURL_SELECT_TIMEOUT') ?: 1
            ];
            if ($maxHandles = getenv('GUZZLE_CURL_MAX_HANDLES')) {
                $config['max_handles'] = $maxHandles;
            }
            if (function_exists('curl_reset')) {
                $default = new CurlHandler();
                $future = new CurlMultiHandler($config);
            } else {
                $default = new CurlMultiHandler($config);
            }
        }

        if (ini_get('allow_url_fopen')) {
            $default = !$default
                ? new StreamHandler()
                : Middleware::wrapStreaming($default, new StreamHandler());
        } elseif (!$default) {
            throw new \RuntimeException('Guzzle requires cURL, the '
                . 'allow_url_fopen ini setting, or a custom HTTP handler.');
        }

        return $future ? Middleware::wrapFuture($default, $future) : $default;
    }
634967
protected function getDefaultParameters(): array
	{
		$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
		$last = end($trace);
		$debugMode = static::detectDebugMode();

		return [
			'appDir' => isset($trace[2]['file']) ? dirname($trace[2]['file']) : null,
			'wwwDir' => isset($last['file']) ? dirname($last['file']) : null,
			'debugMode' => $debugMode,
			'productionMode' => !$debugMode,
			'consoleMode' => PHP_SAPI === 'cli',
		];
	}
460628
protected function getDefaultParameters()
    {
        $defaultParameters = array('--no-debug' => true);

        if ($this->input->hasOption('env')) {
            $env = $this->input->hasOption('env');
            $defaultParameters['--env'] = $env ? $this->input->getOption('env') : 'dev';
        }

        if ($this->input->hasOption('verbose') && true === $this->input->getOption('verbose')) {
            $defaultParameters['--verbose'] = true;
        }

        return $defaultParameters;
    }
658768
public function getDefaultOptions(): array
    {
        $options = parent::getDefaultOptions();

        // Check the "type" attribute. If it is not set,
        // let's define it by default to "submit".
        if (! isset($options['attributes']['type'])) {
            $options['attributes']['type'] = 'submit';
        }

        // By default, disable button field type to be mapped
        // to a data object.
        $options['mapped'] = false;

        return $options;
    }
1171943
protected function getDefaultTypeHandler($value) {
		//get value type
		$type = gettype($value);
	
		switch ($type) {
			case 'null':
				return null;
			case 'array':
				//check empty array
				if (count($value) == 0)
					return null;
				elseif (count($value) == 1) //get first value type hanlder
					return $this->getDefaultTypeHandler(current($value));
				
				$typeHandler = null;
				
				//obtain type by checking inner values
				foreach ($value as $val) {
					$typeHandler = $this->getDefaultTypeHandler($val);
					//get type of the first not null value
					if (!is_null($typeHandler))
						break;
				}
				
				return $typeHandler;

			case 'object':
				//get object class
				$classname = get_class($value);	
				//use class as type
				$typeHandler = $this->typeManager->getTypeHandler($classname);
				if ($typeHandler !== false)
					return $typeHandler;
				//no typehandler found, throw exception
				throw new \RuntimeException("No default type handler found for class '$classname'");
	
			case 'resource':
				//unsupported, throw exception
				throw new \RuntimeException("Argument of type 'resource' is not supported");

			default:
				//generic type
				return $this->typeManager->getTypeHandler($type);
		}
	}
41213
public function info()
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->info();
        }

        return [];
    }
498536
public function handleInstall(): array
    {
        $result = [];

        $handlers = AbstractOperation::getOperationHandlers($this->composer);
        $handlersMap = [];

        foreach ($handlers as $handler) {
            $handler = new $handler($this->package, $this->projectType, $this->composer);
            if ($handler instanceof SupportedProjectTypesInterface) {
                if (in_array($this->projectType->getMachineName(), $handler->getSupportedProjectTypes())) {
                    $handlersMap[] = $handler;
                }
            }
        }

        foreach ($this->projectType->getTypes() as $type) {
            if (isset($handlers[$type])) {
                $class = $handlers[$type];
                /** @var AbstractOperation $handler */
                $handler = new $class($this->package, $this->projectType, $this->composer);
                $handlersMap[] = $handler;
            }
        }

        foreach ($handlersMap as $handler) {
            if ($handler instanceof AvailableOperationInterface) {
                if (!$handler->isAvailable()) {
                    continue;
                }
            }
            $result[] = $handler->install();
        }

        return $result;
    }
350667
protected function loadDefaultHandlers()
    {
        $filter = $this->htmlCleaner;

        // INT / INTEGER
        $this->handlers[static::INTEGER] = $this->handlers['INT'] = function ($source) {
            // Only use the first integer value
            preg_match('/-?[0-9]+/', (string) $source, $matches);

            return isset($matches[0]) ? (int) $matches[0] : null;
        };

        // UINT
        $this->handlers[static::UINT] = function ($source) {
            // Only use the first integer value
            preg_match('/-?[0-9]+/', (string) $source, $matches);

            return isset($matches[0]) ? abs((int) $matches[0]) : null;
        };

        // FLOAT / DOUBLE
        $this->handlers[static::FLOAT] = $this->handlers['DOUBLE'] = function ($source) {
            // Only use the first floating point value
            preg_match('/-?[0-9]+(\.[0-9]+)?/', (string) $source, $matches);

            return isset($matches[0]) ? (float) $matches[0] : null;
        };

        // BOOLEAN / BOOL
        $this->handlers[static::BOOLEAN] = $this->handlers['BOOL'] = function ($source) {
            return (bool) $source;
        };

        // WORD
        $this->handlers[static::WORD] = function ($source) {
            return (string) preg_replace('/[^A-Z_]/i', '', $source);
        };

        // ALNUM
        $this->handlers[static::ALNUM] = function ($source) {
            return (string) preg_replace('/[^A-Z0-9]/i', '', $source);
        };

        // CMD
        $this->handlers[static::CMD] = function ($source) {
            $result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source);

            return ltrim($result, '.');
        };

        // BASE64
        $this->handlers[static::BASE64] = function ($source) {
            return (string) preg_replace('/[^A-Z0-9\/+=]/i', '', $source);
        };

        // STRING
        $this->handlers[static::STRING] = function ($source) use ($filter) {
            return (string) $filter->remove($filter->decode((string) $source));
        };

        // HTML
        $this->handlers[static::HTML] = function ($source) use ($filter) {
            return (string) $filter->remove((string) $source);
        };

        // ARRAY
        $this->handlers[static::ARRAY_TYPE] = function ($source) {
            return (array) $source;
        };

        // PATH
        $this->handlers[static::PATH] = function ($source) {
            $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/';
            preg_match($pattern, (string) $source, $matches);

            return isset($matches[0]) ? (string) $matches[0] : null;
        };

        // USERNAME
        $this->handlers[static::USERNAME] = function ($source) {
            return (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source);
        };

        // EMAIL
        $this->handlers[static::EMAIL] = function ($source) {
            return (string) filter_var($source, FILTER_SANITIZE_EMAIL);
        };

        // HTML
        $this->handlers[static::URL] = function ($source) {
            return (string) filter_var(
                $source,
                FILTER_SANITIZE_URL,
                FILTER_FLAG_QUERY_REQUIRED | FILTER_FLAG_PATH_REQUIRED
            );
        };

        // RAW
        $this->handlers[static::RAW] = function ($source) {
            return $source;
        };

        // UNKNOWN
        $this->defaultHandler = function ($source) use ($filter) {
            // Are we dealing with an array?
            if (is_array($source)) {
                foreach ($source as $key => $value) {
                    // Filter element for XSS and other 'bad' code etc.
                    if (is_string($value)) {
                        $source[$key] = $filter->remove($filter->decode($value));
                    }
                }

                return $source;
            } else {
                // Or a string?
                if (is_string($source) && !empty($source)) {
                    // Filter source for XSS and other 'bad' code etc.
                    return $filter->remove($filter->decode($source));
                } else {
                    // Not an array or string.. return the passed parameter
                    return $source;
                }
            }
        };
    }