Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc8656c

Browse files
Merge branch '3.4' into 4.2
* 3.4: Add missing `@internal` annotations Disable Twig in the profiler menu when Twig is not used Mark some/most implementations of Serializable as `@internal` [Config] ensure moving away from Serializable wont break cache:clear [VarDumper] dont implement Serializable in Stub [Config] fix compat with wrapping autoloaders
2 parents 50a0bda + 823a95d commit bc8656c

File tree

17 files changed

+76
-25
lines changed

17 files changed

+76
-25
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{% endblock %}
3232

3333
{% block menu %}
34-
<span class="label">
34+
<span class="label {{ 0 == collector.templateCount ? 'disabled' }}">
3535
<span class="icon">{{ include('@WebProfiler/Icon/twig.svg') }}</span>
3636
<strong>Twig</strong>
3737
</span>

src/Symfony/Component/Config/Resource/ClassExistenceResource.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function isFresh($timestamp)
9595
}
9696

9797
/**
98-
* {@inheritdoc}
98+
* @internal
9999
*/
100100
public function serialize()
101101
{
@@ -107,7 +107,7 @@ public function serialize()
107107
}
108108

109109
/**
110-
* {@inheritdoc}
110+
* @internal
111111
*/
112112
public function unserialize($serialized)
113113
{
@@ -116,8 +116,10 @@ public function unserialize($serialized)
116116

117117
/**
118118
* @throws \ReflectionException When $class is not found and is required
119+
*
120+
* @internal
119121
*/
120-
private static function throwOnRequiredClass($class)
122+
public static function throwOnRequiredClass($class)
121123
{
122124
if (self::$autoloadedClass === $class) {
123125
return;

src/Symfony/Component/Config/Resource/ComposerResource.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,17 @@ public function isFresh($timestamp)
5151
return self::$runtimeVendors === $this->vendors;
5252
}
5353

54+
/**
55+
* @internal
56+
*/
5457
public function serialize()
5558
{
5659
return serialize($this->vendors);
5760
}
5861

62+
/**
63+
* @internal
64+
*/
5965
public function unserialize($serialized)
6066
{
6167
$this->vendors = unserialize($serialized);

src/Symfony/Component/Config/Resource/DirectoryResource.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,17 @@ public function isFresh($timestamp)
104104
return true;
105105
}
106106

107+
/**
108+
* @internal
109+
*/
107110
public function serialize()
108111
{
109112
return serialize([$this->resource, $this->pattern]);
110113
}
111114

115+
/**
116+
* @internal
117+
*/
112118
public function unserialize($serialized)
113119
{
114120
list($this->resource, $this->pattern) = unserialize($serialized);

src/Symfony/Component/Config/Resource/FileExistenceResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ public function isFresh($timestamp)
5959
}
6060

6161
/**
62-
* {@inheritdoc}
62+
* @internal
6363
*/
6464
public function serialize()
6565
{
6666
return serialize([$this->resource, $this->exists]);
6767
}
6868

6969
/**
70-
* {@inheritdoc}
70+
* @internal
7171
*/
7272
public function unserialize($serialized)
7373
{

src/Symfony/Component/Config/Resource/FileResource.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ public function isFresh($timestamp)
6363
return false !== ($filemtime = @filemtime($this->resource)) && $filemtime <= $timestamp;
6464
}
6565

66+
/**
67+
* @internal
68+
*/
6669
public function serialize()
6770
{
6871
return serialize($this->resource);
6972
}
7073

74+
/**
75+
* @internal
76+
*/
7177
public function unserialize($serialized)
7278
{
7379
$this->resource = unserialize($serialized);

src/Symfony/Component/Config/Resource/GlobResource.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public function isFresh($timestamp)
7777
return $this->hash === $hash;
7878
}
7979

80+
/**
81+
* @internal
82+
*/
8083
public function serialize()
8184
{
8285
if (null === $this->hash) {
@@ -86,6 +89,9 @@ public function serialize()
8689
return serialize([$this->prefix, $this->pattern, $this->recursive, $this->hash, $this->forExclusion, $this->excludedPrefixes]);
8790
}
8891

92+
/**
93+
* @internal
94+
*/
8995
public function unserialize($serialized)
9096
{
9197
list($this->prefix, $this->pattern, $this->recursive, $this->hash, $this->forExclusion, $this->excludedPrefixes) = unserialize($serialized) + [4 => false, []];

src/Symfony/Component/Config/Resource/ReflectionClassResource.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ public function __toString()
5858
return 'reflection.'.$this->className;
5959
}
6060

61+
/**
62+
* @internal
63+
*/
6164
public function serialize()
6265
{
6366
if (null === $this->hash) {
@@ -68,6 +71,9 @@ public function serialize()
6871
return serialize([$this->files, $this->className, $this->hash]);
6972
}
7073

74+
/**
75+
* @internal
76+
*/
7177
public function unserialize($serialized)
7278
{
7379
list($this->files, $this->className, $this->hash) = unserialize($serialized);

src/Symfony/Component/Config/ResourceCheckerConfigCache.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,19 @@ private function safelyUnserialize($file)
156156
{
157157
$e = null;
158158
$meta = false;
159+
$content = file_get_contents($file);
159160
$signalingException = new \UnexpectedValueException();
160161
$prevUnserializeHandler = ini_set('unserialize_callback_func', '');
161162
$prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler, $signalingException) {
162-
if (E_WARNING === $type && 'Class __PHP_Incomplete_Class has no unserializer' === $msg) {
163+
if (__FILE__ === $file) {
163164
throw $signalingException;
164165
}
165166

166167
return $prevErrorHandler ? $prevErrorHandler($type, $msg, $file, $line, $context) : false;
167168
});
168169

169170
try {
170-
$meta = unserialize(file_get_contents($file));
171+
$meta = unserialize($content);
171172
} catch (\Throwable $e) {
172173
if ($e !== $signalingException) {
173174
throw $e;

src/Symfony/Component/DependencyInjection/Config/ContainerParametersResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public function __toString()
3939
}
4040

4141
/**
42-
* {@inheritdoc}
42+
* @internal
4343
*/
4444
public function serialize()
4545
{
4646
return serialize($this->parameters);
4747
}
4848

4949
/**
50-
* {@inheritdoc}
50+
* @internal
5151
*/
5252
public function unserialize($serialized)
5353
{

0 commit comments

Comments
 (0)