8000 minor #15765 Fixed properties not explicitily declared (deguif) · symfony/symfony@61550dc · GitHub
[go: up one dir, main page]

Skip to content

Commit 61550dc

Browse files
committed
minor #15765 Fixed properties not explicitily declared (deguif)
This PR was merged into the 2.7 branch. Discussion ---------- Fixed properties not explicitily declared | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | n/a | License | MIT Commits ------- d2b3fe4 Fixed properties not explicitily declared
2 parents 22100a2 + d2b3fe4 commit 61550dc

File tree

10 files changed

+67
-55
lines changed

10 files changed

+67
-55
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
105105

106106
private function validate($content, $file = null)
107107
{
108-
$this->parser = new Parser();
108+
$parser = new Parser();
109109
try {
110-
$this->parser->parse($content);
110+
$parser->parse($content);
111111
} catch (ParseException $e) {
112112
return array('file' => $file, 'valid' => false, 'message' => $e->getMessage());
113113
}

src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public function process(ContainerBuilder $container)
6464
}
6565

6666
$this->currentId = $id;
67-
$this->currentDefinition = $definition;
6867
$this->currentScope = $scope = $definition->getScope();
6968

7069
if (ContainerInterface::SCOPE_CONTAINER === $scope) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
3434
private $clonesIndex = 0;
3535
private $rootRefs;
3636
private $charset;
37+
private $requestStack;
3738
private $dumper;
3839
private $dumperIsInjected;
3940

src/Symfony/Component/HttpKernel/HttpCache/Esi.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ public function renderIncludeTag($uri, $alt = null, $ignoreErrors = true, $comme
200200
*/
201201
public function process(Request $request, Response $response)
202202
{
203-
$this->request = $request;
204203
$type = $response->headers->get('Content-Type');
205204
if (empty($type)) {
206205
$type = 'text/html';

src/Symfony/Component/HttpKernel/HttpCache/Ssi.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public function renderIncludeTag($uri, $alt = null, $ignoreErrors = true, $comme
113113
*/
114114
public function process(Request $request, Response $response)
115115
{
116-
$this->request = $request;
117116
$type = $response->headers->get('Content-Type');
118117
if (empty($type)) {
119118
$type = 'text/html';

src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class HttpCacheTestCase extends \PHPUnit_Framework_TestCase
2828
protected $responses;
2929
protected $catch;
3030
protected $esi;
31+
protected $store;
3132

3233
protected function setUp()
3334
{

src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestMultipleHttpKernel extends HttpKernel implements ControllerResolverInt
2323
protected $bodies = array();
2424
protected $statuses = array();
2525
protected $headers = array();
26-
protected $call = false;
26+
protected $called = false;
2727
protected $backendRequest;
2828

2929
public function __construct($responses)
@@ -75,6 +75,6 @@ public function hasBeenCalled()
7575

7676
public function reset()
7777
{
78-
$this->call = false;
78+
$this->called = false;
7979
}
8080
}

src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
class JsonEncoderTest extends \PHPUnit_Framework_TestCase
1919
{
20+
private $encoder;
21+
private $serializer;
22+
2023
protected function setUp()
2124
{
2225
$this->encoder = new JsonEncoder();

src/Symfony/Component/Serializer/Tests/SerializerTest.php

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ public function testInterface()
3838
*/
3939
public function testNormalizeNoMatch()
4040
{
41-
$this->serializer = new Serializer(array($this->getMock('Symfony\Component\Serializer\Normalizer\CustomNormalizer')));
42-
$this->serializer->normalize(new \stdClass(), 'xml');
41+
$serializer = new Serializer(array($this->getMock('Symfony\Component\Serializer\Normalizer\CustomNormalizer')));
42+
$serializer->normalize(new \stdClass(), 'xml');
4343
}
4444

4545
public function testNormalizeTraversable()
4646
{
47-
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
48-
$result = $this->serializer->serialize(new TraversableDummy(), 'json');
47+
$serializer = new Serializer(array(), array('json' => new JsonEncoder()));
48+
$result = $serializer->serialize(new TraversableDummy(), 'json');
4949
$this->assertEquals('{"foo":"foo","bar":"bar"}', $result);
5050
}
5151

5252
public function testNormalizeGivesPriorityToInterfaceOverTraversable()
5353
{
54-
$this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
55-
$result = $this->serializer->serialize(new NormalizableTraversableDummy(), 'json');
54+
$serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
55+
$result = $serializer->serialize(new NormalizableTraversableDummy(), 'json');
5656
$this->assertEquals('{"foo":"normalizedFoo","bar":"normalizedBar"}', $result);
5757
}
5858

@@ -61,58 +61,58 @@ public function testNormalizeGivesPriorityToInterfaceOverTraversable()
6161
*/
6262
public function testNormalizeOnDenormalizer()
6363
{
64-
$this->serializer = new Serializer(array(new TestDenormalizer()), array());
65-
$this->assertTrue($this->serializer->normalize(new \stdClass(), 'json'));
64+
$serializer = new Serializer(array(new TestDenormalizer()), array());
65+
$this->assertTrue($serializer->normalize(new \stdClass(), 'json'));
6666
}
6767

6868
/**
6969
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
7070
*/
7171
public function testDenormalizeNoMatch()
7272
{
73-
$this->serializer = new Serializer(array($this->getMock('Symfony\Component\Serializer\Normalizer\CustomNormalizer')));
74-
$this->serializer->denormalize('foo', 'stdClass');
73+
$serializer = new Serializer(array($this->getMock('Symfony\Component\Serializer\Normalizer\CustomNormalizer')));
74+
$serializer->denormalize('foo', 'stdClass');
7575
}
7676

7777
/**
7878
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
7979
*/
8080
public function testDenormalizeOnNormalizer()
8181
{
82-
$this->serializer = new Serializer(array(new TestNormalizer()), array());
82+
$serializer = new Serializer(array(new TestNormalizer()), array());
8383
$data = array('title' => 'foo', 'numbers' => array(5, 3));
84-
$this->assertTrue($this->serializer->denormalize(json_encode($data), 'stdClass', 'json'));
84+
$this->assertTrue($serializer->denormalize(json_encode($data), 'stdClass', 'json'));
8585
}
8686

8787
public function testCustomNormalizerCanNormalizeCollectionsAndScalar()
8888
{
89-
$this->serializer = new Serializer(array(new TestNormalizer()), array());
90-
$this->assertNull($this->serializer->normalize(array('a', 'b')));
91-
$this->assertNull($this->serializer->normalize(new \ArrayObject(array('c', 'd'))));
92-
$this->assertNull($this->serializer->normalize(array()));
93-
$this->assertNull($this->serializer->normalize('test'));
89+
$serializer = new Serializer(array(new TestNormalizer()), array());
90+
$this->assertNull($serializer->normalize(array('a', 'b')));
91+
$this->assertNull($serializer->normalize(new \ArrayObject(array('c', 'd'))));
92+
$this->assertNull($serializer->normalize(array()));
93+
$this->assertNull($serializer->normalize('test'));
9494
}
9595

9696
public function testSerialize()
9797
{
98-
$this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder()));
98+
$serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder()));
9999
$data = array('title' => 'foo', 'numbers' => array(5, 3));
100-
$result = $this->serializer->serialize(Model::fromArray($data), 'json');
100+
$result = $serializer->serialize(Model::fromArray($data), 'json');
101101
$this->assertEquals(json_encode($data), $result);
102102
}
103103

104104
public function testSerializeScalar()
105105
{
106-
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
107-
$result = $this->serializer->serialize('foo', 'json');
106+
$serializer = new Serializer(array(), array('json' => new JsonEncoder()));
107+
$result = $serializer->serialize('foo', 'json');
108108
$this->assertEquals('"foo"', $result);
109109
}
110110

111111
public function testSerializeArrayOfScalars()
112112
{
113-
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
113+
$serializer = new Serializer(array(), array('json' => new JsonEncoder()));
114114
$data = array('foo', array(5, 3));
115-
$result = $this->serializer->serialize($data, 'json');
115+
$result = $serializer->serialize($data, 'json');
116116
$this->assertEquals(json_encode($data), $result);
117117
}
118118

@@ -121,36 +121,36 @@ public function testSerializeArrayOfScalars()
121121
*/
122122
public function testSerializeNoEncoder()
123123
{
124-
$this->serializer = new Serializer(array(), array());
124+
$serializer = new Serializer(array(), array());
125125
$data = array('title' => 'foo', 'numbers' => array(5, 3));
126-
$this->serializer->serialize($data, 'json');
126+
$serializer->serialize($data, 'json');
127127
}
128128

129129
/**
130130
* @expectedException \Symfony\Component\Serializer\Exception\LogicException
131131
*/
132132
public function testSerializeNoNormalizer()
133133
{
134-
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
134+
$serializer = new Serializer(array(), array('json' => new JsonEncoder()));
135135
$data = array('title' => 'foo', 'numbers' => array(5, 3));
136-
$this->serializer->serialize(Model::fromArray($data), 'json');
136+
$serializer->serialize(Model::fromArray($data), 'json');
137137
}
138138

139139
public function testDeserialize()
140140
{
141-
$this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder()));
141+
$serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder()));
142142
$data = array('title' => 'foo', 'numbers' => array(5, 3));
143-
$result = $this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
143+
$result = $serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
144144
$this->assertEquals($data, $result->toArray());
145145
}
146146

147147
public function testDeserializeUseCache()
148148
{
149-
$this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder()));
149+
$serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder()));
150150
$data = array('title' => 'foo', 'numbers' => array(5, 3));
151-
$this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
151+
$serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
152152
$data = array('title' => 'bar', 'numbers' => array(2, 8));
153-
$result = $this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
153+
$result = $serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
154154
$this->assertEquals($data, $result->toArray());
155155
}
156156

@@ -159,65 +159,65 @@ public function testDeserializeUseCache()
159159
*/
160160
public function testDeserializeNoNormalizer()
161161
{
162-
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
162+
$serializer = new Serializer(array(), array('json' => new JsonEncoder()));
163163
$data = array('title' => 'foo', 'numbers' => array(5, 3));
164-
$this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
164+
$serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
165165
}
166166

167167
/**
168168
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
169169
*/
170170
public function testDeserializeWrongNormalizer()
171171
{
172-
$this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
172+
$serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
173173
$data = array('title' => 'foo', 'numbers' => array(5, 3));
174-
$this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
174+
$serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
175175
}
176176

177177
/**
178178
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
179179
*/
180180
public function testDeserializeNoEncoder()
181181
{
182-
$this->serializer = new Serializer(array(), array());
182+
$serializer = new Serializer(array(), array());
183183
$data = array('title' => 'foo', 'numbers' => array(5, 3));
184-
$this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
184+
$serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json');
185185
}
186186

187187
public function testDeserializeSupported()
188188
{
189-
$this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array());
189+
$serializer = new Serializer(array(new GetSetMethodNormalizer()), array());
190190
$data = array('title' => 'foo', 'numbers' => array(5, 3));
191-
$this->assertTrue($this->serializer->supportsDenormalization(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'));
191+
$this->assertTrue($serializer->supportsDenormalization(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'));
192192
}
193193

194194
public function testDeserializeNotSupported()
195195
{
196-
$this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array());
196+
$serializer = new Serializer(array(new GetSetMethodNormalizer()), array());
197197
$data = array('title' => 'foo', 'numbers' => array(5, 3));
198-
$this->assertFalse($this->serializer->supportsDenormalization(json_encode($data), 'stdClass', 'json'));
198+
$this->assertFalse($serializer->supportsDenormalization(json_encode($data), 'stdClass', 'json'));
199199
}
200200

201201
public function testDeserializeNotSupportedMissing()
202202
{
203-
$this->serializer = new Serializer(array(), array());
203+
$serializer = new Serializer(array(), array());
204204
$data = array('title' => 'foo', 'numbers' => array(5, 3));
205-
$this->assertFalse($this->serializer->supportsDenormalization(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'));
205+
$this->assertFalse($serializer->supportsDenormalization(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'));
206206
}
207207

208208
public function testEncode()
209209
{
210-
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
210+
$serializer = new Serializer(array(), array('json' => new JsonEncoder()));
211211
$data = array('foo', array(5, 3));
212-
$result = $this->serializer->encode($data, 'json');
212+
$result = $serializer->encode($data, 'json');
213213
$this->assertEquals(json_encode($data), $result);
214214
}
215215

216216
public function testDecode()
217217
{
218-
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
218+
$serializer = new Serializer(array(), array('json' => new JsonEncoder()));
219219
$data = array('foo', array(5, 3));
220-
$result = $this->serializer->decode(json_encode($data), 'json');
220+
$result = $serializer->decode(json_encode($data), 'json');
221221
$this->assertEquals($data, $result);
222222
}
223223
}

src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
4444
*/
4545
private $context;
4646

47+
/**
48+
* @var string
49+
*/
50+
private $defaultPropertyPath;
51+
52+
/**
53+
* @var array
54+
*/
55+
private $defaultGroups;
56+
4757
/**
4858
* @var MetadataFactoryInterface
4959
*/

0 commit comments

Comments
 (0)
0