dirname
symfony/var-dumper
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Returns a parent directory's path
dirname
(
string $path
,
int $levels
=
1
):
string
foreach (
get_declared_classes
() as
$class
) {
if (
'C'
===
$class
[
0
] &&
str_starts_with
(
$class
,
'ComposerAutoloaderInit'
)) {
$r
= new
\ReflectionClass
(
$class
);
$v
=
\dirname
(
$r
->
getFileName
(),
2
);
if (
is_file
(
$v
.
'/composer/installed.json'
)) {
self
::
$vendorRoots
[] =
$v
.
\DIRECTORY_SEPARATOR
;
}
Caster/LinkStub.php
}
$inVendor
=
false
;
if (isset(
self
::
$composerRoots
[
$dir
=
\dirname
(
$file
)])) {
return
self
::
$composerRoots
[
$dir
];
}
Caster/LinkStub.php
break;
}
if (
$parent
===
\dirname
(
$parent
)) {
return
self
::
$composerRoots
[
$dir
] =
false
;
}
Caster/LinkStub.php
return
self
::
$composerRoots
[
$dir
] =
false
;
}
$parent
=
\dirname
(
$parent
);
}
return
self
::
$composerRoots
[
$dir
] =
$parent
.
\DIRECTORY_SEPARATOR
;
Caster/LinkStub.php
public function
testShouldReturnTraceForConcreteTwigWithError
()
{
require_once
\dirname
(
__DIR__
).
'/Fixtures/Twig.php'
;
$innerExc
= (new
\__TwigTemplate_VarDumperFixture_u75a09
(
null
,
__FILE__
))->
provideError
();
$nestingWrapper
= new
\stdClass
();
Tests/Caster/ExceptionCasterTest.php
public function
testFrameWithTwig
()
{
require_once
\dirname
(
__DIR__
).
'/Fixtures/Twig.php'
;
$f
= [
new
FrameStub
([
Tests/Caster/ExceptionCasterTest.php
$f
= [
new
FrameStub
([
'file'
=>
\dirname
(
__DIR__
).
'/Fixtures/Twig.php'
,
'line'
=>
33
,
'class'
=>
'__TwigTemplate_VarDumperFixture_u75a09'
,
]),
Tests/Caster/ExceptionCasterTest.php
'class'
=>
'__TwigTemplate_VarDumperFixture_u75a09'
,
]),
new
FrameStub
([
'file'
=>
\dirname
(
__DIR__
).
'/Fixtures/Twig.php'
,
'line'
=>
34
,
'class'
=>
'__TwigTemplate_VarDumperFixture_u75a09'
,
'object'
=> new
\__TwigTemplate_VarDumperFixture_u75a09
(
null
,
__FILE__
),
Tests/Caster/ExceptionCasterTest.php