Skip to content

Commit

Permalink
refactor: add return type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
jaburjak committed Oct 6, 2024
1 parent 90b00f3 commit 5fe2486
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(string $defaultManifestPath) {
$this->defaultManifestPath = $defaultManifestPath;
}

public function getConfigTreeBuilder() {
public function getConfigTreeBuilder(): TreeBuilder {
$treeBuilder = new TreeBuilder('enginiro_asset');

$treeBuilder->getRootNode()
Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/EnginiroAssetExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Enginiro\AssetBundle\DependencyInjection;

use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
Expand All @@ -19,7 +20,7 @@
class EnginiroAssetExtension extends ConfigurableExtension implements PrependExtensionInterface {
private const MANIFEST_PATH = '%s/var/dat/asset-hashes.json';

public function getConfiguration(array $config, ContainerBuilder $container) {
public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface {
$defaultManifestPath = sprintf(self::MANIFEST_PATH, $container->getParameter('kernel.project_dir'));

return new Configuration($defaultManifestPath);
Expand Down
6 changes: 3 additions & 3 deletions src/VersionStrategy/HashVersionStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class HashVersionStrategy implements VersionStrategyInterface, LoggerAware
/**
* @required
*/
public function setLogger(LoggerInterface $logger) {
public function setLogger(LoggerInterface $logger): void {
$this->logger = $logger;
}

Expand All @@ -67,7 +67,7 @@ public function __construct(string $manifestPath) {
/**
* @inheritdoc
*/
public function getVersion(string $path) {
public function getVersion(string $path): string {
if (strlen($path) >= 2 && $path[0] === '/') {
/** @var string $path */
$path = substr($path, 1);
Expand All @@ -79,7 +79,7 @@ public function getVersion(string $path) {
/**
* @inheritdoc
*/
public function applyVersion(string $path) {
public function applyVersion(string $path): string {
$version = $this->getVersion($path);

if ($version === '') {
Expand Down

0 comments on commit 5fe2486

Please sign in to comment.