src/mako/database/connections/Connection.php
protected function prepareQueryAndParams(string $query, array $params): array
	{
		// Replace IN clause placeholder with escaped values

		replace:

		if(strpos($query, '([?])') !== false)
		{
			foreach($params as $key => $value)
			{
				if(is_array($value))
				{
					array_splice($params, $key, 1, $value);

					$query = preg_replace('/\(\[\?\]\)/', '(' . trim(str_repeat('?, ', count($value)), ', ') . ')', $query, 1);

					goto replace;
				}
			}
		}

		// Return query and parameters

		return [$query, $params];
	}
protected function prepareQueryAndParams(string $query, array $params): array
	{
		// Replace IN clause placeholder with escaped values

		replace:

		if(strpos($query, '([?])') !== false)
		{
			foreach($params as $key => $value)
			{
				if(is_array($value))
				{
					array_splice($params, $key, 1, $value);

					$query = preg_replace('/\(\[\?\]\)/', '(' . trim(str_repeat('?, ', count($value)), ', ') . ')', $query, 1);

					goto replace;
				}
			}
		}

		// Return query and parameters

		return [$query, $params];
	}
protected function prepareQueryAndParams ( string $ query , array $ params ) : array { // Replace IN clause placeholder with escaped values replace : if ( strpos ( $ query , '([?])' ) !== false ) { foreach ( $ params as $ key => $ value ) { if ( is_array ( $ value ) ) { array_splice ( $ params , $ key , 1 , $ value ) ; $ query = preg_replace ( '/\(\[\?\]\)/' , '(' . trim ( str_repeat ( '?, ' , count ( $ value ) ) , ', ' ) . ')' , $ query , 1 ) ; goto replace ; } } } // Return query and parameters return [ $ query , $ params ] ; }
Prepare query and params.

@param  string $query  SQL Query
@param  array  $params Query parameters
@return array
Prepare query and params .