Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1432206
ConvertParameters.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ConvertParameters.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\PgSQL
;
use
Doctrine\DBAL\SQL\Parser\Visitor
;
use
function
count
;
use
function
implode
;
final
class
ConvertParameters
implements
Visitor
{
/** @var list<string> */
private
array
$buffer
=
[];
/** @var array<array-key, int> */
private
array
$parameterMap
=
[];
public
function
acceptPositionalParameter
(
string
$sql
):
void
{
$position
=
count
(
$this
->
parameterMap
)
+
1
;
$this
->
parameterMap
[
$position
]
=
$position
;
$this
->
buffer
[]
=
'$'
.
$position
;
}
public
function
acceptNamedParameter
(
string
$sql
):
void
{
$position
=
count
(
$this
->
parameterMap
)
+
1
;
$this
->
parameterMap
[
$sql
]
=
$position
;
$this
->
buffer
[]
=
'$'
.
$position
;
}
public
function
acceptOther
(
string
$sql
):
void
{
$this
->
buffer
[]
=
$sql
;
}
public
function
getSQL
():
string
{
return
implode
(
''
,
$this
->
buffer
);
}
/** @return array<array-key, int> */
public
function
getParameterMap
():
array
{
return
$this
->
parameterMap
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 21:31 (1 d, 4 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8e/22/a69d62991f2dca40ad86f808dea8
Default Alt Text
ConvertParameters.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment