Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7452365
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
Sun, Nov 22, 22:12 (2 d, 5 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
19/56/7cb5bdf94d5e20654e8dbcf25b0d
Default Alt Text
ConvertParameters.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment