8000 Mark some/most implementations of Serializable as `@internal` · symfony/symfony@7b9d73d · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b9d73d

Browse files
Mark some/most implementations of Serializable as @internal
1 parent 3cfb558 commit 7b9d73d

14 files changed

+63
-15
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function isFresh($timestamp)
9797
}
9898

9999
/**
100-
* {@inheritdoc}
100+
* @internal
101101
*/
102102
public function serialize()
103103
{
@@ -109,7 +109,7 @@ public function serialize()
109109
}
110110

111111
/**
112-
* {@inheritdoc}
112+
* @internal
113113
*/
114114
public function unserialize($serialized)
115115
{

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
@@ -73,6 +73,9 @@ public function isFresh($timestamp)
7373
return $this->hash === $hash;
7474
}
7575

76+
/**
77+
* @internal
78+
*/
7679
public function serialize()
7780
{
7881
if (null === $this->hash) {
@@ -82,6 +85,9 @@ public function serialize()
8285
return serialize([$this->prefix, $this->pattern, $this->recursive, $this->hash]);
8386
}
8487

88+
/**
89+
* @internal
90+
*/
8591
public function unserialize($serialized)
8692
{
8793
list($this->prefix, $this->pattern, $this->recursive, $this->hash) = unserialize($serialized);

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

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

60+
/**
61+
* @internal
62+
*/
6063
public function serialize()
6164
{
6265
if (null === $this->hash) {
@@ -67,6 +70,9 @@ public function serialize()
6770
return serialize([$this->files, $this->className, $this->hash]);
6871
}
6972

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

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

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

61+
/**
62+
* @internal
63+
*/
6164
public function serialize()
6265
{
6366
return serialize([$this->class, $this->filePath, $this->autowiringMetadata]);
6467
}
6568

69+
/**
70+
* @internal
71+
*/
6672
public function unserialize($serialized)
6773
{
6874
if (\PHP_VERSION_ID >= 70000) {

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
{

src/Symfony/Component/Form/FormError.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ public function getOrigin()
135135
}
136136

137137
/**
138-
* Serializes this error.
139-
*
140-
* @return string The serialized error
138+
* @internal
141139
*/
142140
public function serialize()
143141
{
@@ -151,9 +149,7 @@ public function serialize()
151149
}
152150

153151
/**
154-
* Unserializes a serialized error.
155-
*
156-
* @param string $serialized The serialized error
152+
* @internal
157153
*/
158154
public function unserialize($serialized)
159155
{

src/Symfony/Component/HttpKernel/Config/EnvParametersResource.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,17 @@ public function isFresh($timestamp)
6565
return $this->findVariables() === $this->variables;
6666
}
6767

68+
/**
69+
* @internal
70+
*/
6871
public function serialize()
6972
{
7073
return serialize(['prefix' => $this->prefix, 'variables' => $this->variables]);
7174
}
7275

76+
/**
77+
* @internal
78+
*/
7379
public function unserialize($serialized)
7480
{
7581
if (\PHP_VERSION_ID >= 70000) {

src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ abstract class DataCollector implements DataCollectorInterface, \Serializable
4040
*/
4141
private $cloner;
4242

43+
/**
44+
* @internal
45+
*/
4346
public function serialize()
4447
{
4548
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2);
@@ -48,6 +51,9 @@ public function serialize()
4851
return $isCalledFromOverridingMethod ? $this->data : serialize($this->data);
4952
}
5053

54+
/**
55+
* @internal
56+
*/
5157
public function unserialize($data)
5258
{
5359
$this->data = \is_array($data) ? $data : unserialize($data);

src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,17 @@ public function format($file, $line)
6161
return false;
6262
}
6363

64+
/**
65+
* @internal
66+
*/
6467
public function serialize()
6568
{
6669
return serialize($this->getFileLinkFormat());
6770
}
6871

72+
/**
73+
* @internal
74+
*/
6975
public function unserialize($serialized)
7076
{
7177
if (\PHP_VERSION_ID >= 70000) {

src/Symfony/Component/Validator/Constraint.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,7 @@ public function getTargets()
284284
*
285285
* @return array The properties to serialize
286286
*
287-
* @internal This method may be replaced by an implementation of
288-
* {@link \Serializable} in the future. Please don't use or
289-
* overwrite it.
287+
* @internal
290288
*/
291289
public function __sleep()
292290
{

0 commit comments

Comments
 (0)
0