Skip to content

Commit 6f623f6

Browse files
authored
Reduziere Deprecations, löse kleinere Code Inspectons (Case 183951) (#55)
- Beerbe nicht-deprecated Klasse - Nutze first class callable syntax - Inline value - Entferne redundante Condition - Nutze Null-safe-Operator
1 parent 3924e8d commit 6f623f6

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

src/Config/WfdMetaConfigCacheFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private function fillCache($callback, ConfigCacheInterface $cache): void
8888
$cs->execute($cache->getPath(), function () use ($callback, $cache) {
8989
if (!$cache->isFresh()) {
9090
// Our turn and the cache is still stale. Rebuild. */
91-
\call_user_func($callback, $cache);
91+
$callback($cache);
9292
} // else: Our turn, but cache is fresh. Must have been rebuilt while we were blocked. Use it.
9393
});
9494
}

src/Controller/TemplateController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function templateAction(
111111

112112
if ($private) {
113113
$response->setPrivate();
114-
} elseif (false === $private || (null === $private && ($maxAge || $sharedAge))) {
114+
} elseif (false === $private || ($maxAge || $sharedAge)) {
115115
$response->setPublic();
116116
}
117117

src/DependencyInjection/WebfactoryWfdMetaExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
use Symfony\Component\Config\FileLocator;
1212
use Symfony\Component\DependencyInjection\ContainerBuilder;
13+
use Symfony\Component\DependencyInjection\Extension\Extension;
1314
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1415
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
15-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
1616

1717
class WebfactoryWfdMetaExtension extends Extension
1818
{

src/Provider.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ private function getTimestampOrNull($fetchValue): ?int
148148
return null;
149149
}
150150

151-
$dateTime = new DateTime($fetchValue);
152-
153-
return $dateTime->getTimestamp();
151+
return (new DateTime($fetchValue))->getTimestamp();
154152
}
155153
}

src/Util/CriticalSection.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ private function getLock(string $name): LockInterface
132132
*/
133133
private function debug(string $message): void
134134
{
135-
if ($this->logger) {
136-
$this->logger->debug($message, ['pid' => getmypid()]);
137-
}
135+
$this->logger?->debug($message, ['pid' => getmypid()]);
138136
}
139137
}

0 commit comments

Comments
 (0)