-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #475 from symfony-cmf/return-type
add type declarations to our classes
- Loading branch information
Showing
41 changed files
with
487 additions
and
871 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Upgrade from 2.x to 3.0 | ||
|
||
## Parameter and return type declarations | ||
|
||
If you extend any of the classes in this repository, you will need to adjust | ||
overwritten methods to specify the parameter and return types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,12 @@ | |
* @author David Buchmann | ||
* @author Wouter de Jong <[email protected]> | ||
*/ | ||
class CmfRoutingExtension extends Extension | ||
final class CmfRoutingExtension extends Extension | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
public function load(array $configs, ContainerBuilder $container): void | ||
{ | ||
$config = $this->processConfiguration(new Configuration(), $configs); | ||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
|
@@ -45,7 +45,7 @@ public function load(array $configs, ContainerBuilder $container) | |
$loader->load('validators.xml'); | ||
} | ||
|
||
private function setupChainRouter(array $config, ContainerBuilder $container, LoaderInterface $loader) | ||
private function setupChainRouter(array $config, ContainerBuilder $container, LoaderInterface $loader): void | ||
{ | ||
$loader->load('routing-chain.xml'); | ||
|
||
|
@@ -58,7 +58,7 @@ private function setupChainRouter(array $config, ContainerBuilder $container, Lo | |
} | ||
} | ||
|
||
private function setupFormTypes(array $config, ContainerBuilder $container, LoaderInterface $loader) | ||
private function setupFormTypes(array $config, ContainerBuilder $container, LoaderInterface $loader): void | ||
{ | ||
$loader->load('form-type.xml'); | ||
|
||
|
@@ -73,12 +73,8 @@ private function setupFormTypes(array $config, ContainerBuilder $container, Load | |
|
||
/** | ||
* Set up the DynamicRouter - only to be called if enabled is set to true. | ||
* | ||
* @param array $config the compiled configuration for the dynamic router | ||
* @param ContainerBuilder $container the container builder | ||
* @param LoaderInterface $loader the configuration loader | ||
*/ | ||
private function setupDynamicRouter(array $config, ContainerBuilder $container, LoaderInterface $loader) | ||
private function setupDynamicRouter(array $config, ContainerBuilder $container, LoaderInterface $loader): void | ||
{ | ||
$loader->load('routing-dynamic.xml'); | ||
|
||
|
@@ -210,7 +206,7 @@ private function setupDynamicRouter(array $config, ContainerBuilder $container, | |
$dynamic->replaceArgument(2, new Reference($config['url_generator'])); | ||
} | ||
|
||
private function loadPhpcrProvider(array $config, LoaderInterface $loader, ContainerBuilder $container, array $locales, $matchImplicitLocale) | ||
private function loadPhpcrProvider(array $config, LoaderInterface $loader, ContainerBuilder $container, array $locales, $matchImplicitLocale): void | ||
{ | ||
$loader->load('provider-phpcr.xml'); | ||
|
||
|
@@ -232,7 +228,7 @@ private function loadPhpcrProvider(array $config, LoaderInterface $loader, Conta | |
} | ||
} | ||
|
||
private function loadInitializer(LoaderInterface $loader, ContainerBuilder $container) | ||
private function loadInitializer(LoaderInterface $loader, ContainerBuilder $container): void | ||
{ | ||
$initializedBasepaths = $container->getParameter($this->getAlias().'.dynamic.persistence.phpcr.route_basepaths'); | ||
|
||
|
@@ -244,7 +240,7 @@ private function loadInitializer(LoaderInterface $loader, ContainerBuilder $cont | |
$loader->load('initializer-phpcr.xml'); | ||
} | ||
|
||
private function loadOrmProvider(array $config, LoaderInterface $loader, ContainerBuilder $container, $matchImplicitLocale) | ||
private function loadOrmProvider(array $config, LoaderInterface $loader, ContainerBuilder $container, $matchImplicitLocale): void | ||
{ | ||
$loader->load('provider-orm.xml'); | ||
|
||
|
@@ -264,28 +260,21 @@ private function loadOrmProvider(array $config, LoaderInterface $loader, Contain | |
} | ||
|
||
/** | ||
* @param ContainerBuilder $container The container builder | ||
* @param array $config The config array | ||
* @param array $settingToParameter An array with setting to parameter mappings (key = setting, value = parameter name without alias prefix) | ||
* @param array<string, string> $settingToParameter An array with setting to parameter mappings (key = setting, value = parameter name without alias prefix) | ||
*/ | ||
private function configureParameters(ContainerBuilder $container, array $config, array $settingToParameter) | ||
private function configureParameters(ContainerBuilder $container, array $config, array $settingToParameter): void | ||
{ | ||
foreach ($settingToParameter as $setting => $parameter) { | ||
$container->setParameter('cmf_routing.'.$parameter, $config[$setting]); | ||
} | ||
} | ||
|
||
/** | ||
* Returns the base path for the XSD files. | ||
* | ||
* @return string The XSD base path | ||
*/ | ||
public function getXsdValidationBasePath() | ||
public function getXsdValidationBasePath(): string | ||
{ | ||
return __DIR__.'/../Resources/config/schema'; | ||
} | ||
|
||
public function getNamespace() | ||
public function getNamespace(): string | ||
{ | ||
return 'http://cmf.symfony.com/schema/dic/routing'; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.