Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5961551
PHP.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
PHP.php
View Options
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of phpunit/php-code-coverage.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
SebastianBergmann\CodeCoverage\Report
;
use
function
dirname
;
use
function
file_put_contents
;
use
function
serialize
;
use
function
strpos
;
use
SebastianBergmann\CodeCoverage\CodeCoverage
;
use
SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException
;
use
SebastianBergmann\CodeCoverage\Util\Filesystem
;
final
class
PHP
{
public
function
process
(
CodeCoverage
$coverage
,
?
string
$target
=
null
):
string
{
$coverage
->
clearCache
();
$buffer
=
"<?php
return
\u
nserialize(<<<'END_OF_COVERAGE_SERIALIZATION'"
.
PHP_EOL
.
serialize
(
$coverage
)
.
PHP_EOL
.
'END_OF_COVERAGE_SERIALIZATION'
.
PHP_EOL
.
');'
;
if
(
$target
!==
null
)
{
if
(!
strpos
(
$target
,
'://'
)
!==
false
)
{
Filesystem
::
createDirectory
(
dirname
(
$target
));
}
if
(@
file_put_contents
(
$target
,
$buffer
)
===
false
)
{
throw
new
WriteOperationFailedException
(
$target
);
}
}
return
$buffer
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 08:11 (1 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4e/6f/3c51394b5cfc8a9a7db56328462b
Default Alt Text
PHP.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment