8000 [Config] Add type-hints to public interfaces · symfony/symfony@00875f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 00875f5

Browse files
committed
[Config] Add type-hints to public interfaces
1 parent c10ad18 commit 00875f5

7 files changed

+8
-8
lines changed

src/Symfony/Component/Config/ConfigCacheFactoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ interface ConfigCacheFactoryInterface
2828
*
2929
* @return ConfigCacheInterface The cache instance
3030
*/
31-
public function cache($file, $callable);
31+
public function cache(string $file, $callable);
3232
}

src/Symfony/Component/Config/ConfigCacheInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ public function isFresh();
4545
*
4646
* @throws \RuntimeException When the cache file cannot be written
4747
*/
48-
public function write($content, array $metadata = null);
48+
public function write(string $content, array $metadata = null);
4949
}

src/Symfony/Component/Config/Definition/PrototypeNodeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ interface PrototypeNodeInterface extends NodeInterface
2323
*
2424
* @param string $name The name of the node
2525
*/
26-
public function setName($name);
26+
public function setName(string $name);
2727
}

src/Symfony/Component/Config/FileLocatorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ interface FileLocatorInterface
3030
* @throws \InvalidArgumentException If $name is empty
3131
* @throws FileLocatorFileNotFoundException If a file is not found
3232
*/
33-
public function locate($name, $currentPath = null, $first = true);
33+
public function locate(string $name, ?string $currentPath = null, bool $first = true);
3434
}

src/Symfony/Component/Config/Loader/LoaderInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface LoaderInterface
2626
*
2727
* @throws \Exception If something went wrong
2828
*/
29-
public function load($resource, $type = null);
29+
public function load($resource, ?string $type = null);
3030

3131
/**
3232
* Returns whether this class supports the given resource.
@@ -36,7 +36,7 @@ public function load($resource, $type = null);
3636
*
3737
* @return bool True if this class supports the given resource, false otherwise
3838
*/
39-
public function supports($resource, $type = null);
39+
public function supports($resource, ?string $type = null);
4040

4141
/**
4242
* Gets the loader resolver.

src/Symfony/Component/Config/Loader/LoaderResolverInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ interface LoaderResolverInterface
2626
*
2727
* @return LoaderInterface|false The loader or false if none is able to load the resource
2828
*/
29-
public function resolve($resource, $type = null);
29+
public function resolve($resource, ?string $type = null);
3030
}

src/Symfony/Component/Config/ResourceCheckerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ public function supports(ResourceInterface $metadata);
4444
*
4545
* @return bool True if the resource has not changed since the given timestamp, false otherwise
4646
*/
47-
public function isFresh(ResourceInterface $resource, $timestamp);
47+
public function isFresh(ResourceInterface $resource, int $timestamp);
4848
}

0 commit comments

Comments
 (0)
0