Skip to content

Commit eefcfc4

Browse files
committed
Update docs and removed useless files too
1 parent ac6efc7 commit eefcfc4

20 files changed

+74
-32
lines changed

docs/expressions.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Expressions
2+
===========
3+
4+
Starting with version 5.4, we now support parsing expressions and extracting types and references to elements from them.
5+
6+
.. info::
7+
8+
An expression is, for example, the default value for a property or argument, the definition of an enum case or a
9+
constant value. These are called expressions and can contain more complex combinations of operators and values.
10+
11+
As this library revolves around reflecting Static information, most parts of an expression are considered irrelevant;
12+
except for type information -such as type hints- and references to other elements, such as constants. As such, whenever
13+
an expression is interpreted, it will result in a string containing placeholders and an array containing the reflected
14+
parts -such as FQSENs-.
15+
16+
This means that the getters like ``getDefault()`` will return a string or when you provide the optional argument
17+
$isString as being false, it will return an Expression object; which, when cast to string, will provide the same result.
18+
19+
.. warning::
20+
21+
Deprecation: In version 6, we will remove the optional argument and always return an Expression object. When the
22+
result was used as a string nothing will change, but code that checks if the output is a string will no longer
23+
function starting from that version.
24+
25+
This will allow consumers to be able to extract types and links to elements from expressions. This allows consumers to,
26+
for example, interpret the default value for a constructor promoted properties when it directly instantiates an object.

docs/filtering.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/incremental-updates.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ Reflection
22
==========
33

44
.. toctree::
5-
:hidden:
6-
5+
expressions
76
meta-data

docs/inspecting.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/integrating-with-silex-and-cilex.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/usage.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/phpDocumentor/Reflection/Php/Argument.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
use phpDocumentor\Reflection\Type;
1717
use phpDocumentor\Reflection\Types\Mixed_;
1818

19+
use function is_string;
20+
use function trigger_error;
21+
22+
use const E_USER_DEPRECATED;
23+
1924
/**
2025
* Descriptor representing a single Argument of a method or function.
2126
*/
@@ -63,6 +68,7 @@ public function __construct(
6368
);
6469
$default = new Expression($default, []);
6570
}
71+
6672
$this->default = $default;
6773

6874
$this->type = $type;

src/phpDocumentor/Reflection/Php/Constant.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
use phpDocumentor\Reflection\Location;
2020
use phpDocumentor\Reflection\Metadata\MetaDataContainer as MetaDataContainerInterface;
2121

22+
use function is_string;
23+
use function trigger_error;
24+
25+
use const E_USER_DEPRECATED;
26+
2227
/**
2328
* Descriptor representing a constant
2429
*/
@@ -30,9 +35,7 @@ final class Constant implements Element, MetaDataContainerInterface
3035

3136
private ?DocBlock $docBlock;
3237

33-
/**
34-
* @var string|Expression|null
35-
*/
38+
/** @var string|Expression|null */
3639
private $value;
3740

3841
private Location $location;
@@ -70,8 +73,8 @@ public function __construct(
7073
);
7174
$value = new Expression($value, []);
7275
}
73-
$this->value = $value;
7476

77+
$this->value = $value;
7578
}
7679

7780
/**

src/phpDocumentor/Reflection/Php/EnumCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
use phpDocumentor\Reflection\Location;
1111
use phpDocumentor\Reflection\Metadata\MetaDataContainer as MetaDataContainerInterface;
1212

13+
use function is_string;
14+
use function trigger_error;
15+
16+
use const E_USER_DEPRECATED;
17+
1318
final class EnumCase implements Element, MetaDataContainerInterface
1419
{
1520
use MetadataContainer;
@@ -55,6 +60,7 @@ public function __construct(
5560
);
5661
$value = new Expression($value, []);
5762
}
63+
5864
$this->value = $value;
5965
}
6066

0 commit comments

Comments
 (0)