Skip to content

Commit 5b703f7

Browse files
committed
minor #10717 unified return null usages (fabpot)
This PR was merged into the 2.3 branch. Discussion ---------- unified return null usages | Q | A | ------------- | --- | License | MIT This PR unifies the way we return `null` from a function or method: * always use `return;` instead of `return null;` (the current code base uses both); * never use `return;` at the end of a function/method. Commits ------- d1d569b unified return null usages
2 parents 740e2e3 + 1d39ee7 commit 5b703f7

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

Bundle/Bundle.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ public function getPath()
141141
*/
142142
public function getParent()
143143
{
144-
return null;
145144
}
146145

147146
/**

HttpCache/Store.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function lookup(Request $request)
121121
$key = $this->getCacheKey($request);
122122

123123
if (!$entries = $this->getMetadata($key)) {
124-
return null;
124+
return;
125125
}
126126

127127
// find a cached entry that matches the request.
@@ -135,7 +135,7 @@ public function lookup(Request $request)
135135
}
136136

137137
if (null === $match) {
138-
return null;
138+
return;
139139
}
140140

141141
list($req, $headers) = $match;
@@ -146,7 +146,6 @@ public function lookup(Request $request)
146146
// TODO the metaStore referenced an entity that doesn't exist in
147147
// the entityStore. We definitely want to return nil but we should
148148
// also purge the entry from the meta-store when this is detected.
149-
return null;
150149
}
151150

152151
/**

Profiler/FileProfilerStorage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function purge()
116116
public function read($token)
117117
{
118118
if (!$token || !file_exists($file = $this->getFilename($token))) {
119-
return null;
119+
return;
120120
}
121121

122122
return $this->createProfileFromData($token, unserialize(file_get_contents($file)));
@@ -215,7 +215,7 @@ protected function readLineFromFile($file)
215215
$position = ftell($file);
216216

217217
if (0 === $position) {
218-
return null;
218+
return;
219219
}
220220

221221
while (true) {

Profiler/PdoProfilerStorage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ public function read($token)
7777
if (isset($data[0]['data'])) {
7878
return $this->createProfileFromData($token, $data[0]);
7979
}
80-
81-
return null;
8280
}
8381

8482
/**

Profiler/Profiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,13 @@ public function get($name)
273273
private function getTimestamp($value)
274274
{
275275
if (null === $value || '' == $value) {
276-
return null;
276+
return;
277277
}
278278

279279
try {
280280
$value = new \DateTime(is_numeric($value) ? '@'.$value : $value);
281281
} catch (\Exception $e) {
282-
return null;
282+
return;
283283
}
284284

285285
return $value->getTimestamp();

0 commit comments

Comments
 (0)