1212namespace Symfony \Cmf \Bundle \RoutingBundle \Model ;
1313
1414use Symfony \Cmf \Component \Routing \RouteObjectInterface ;
15+ use Symfony \Component \Routing \CompiledRoute ;
1516use Symfony \Component \Routing \Route as SymfonyRoute ;
1617use Symfony \Component \Routing \RouteCompiler ;
1718
@@ -147,7 +148,7 @@ public function getContent()
147148 *
148149 * Prevent setting the default 'compiler_class' so that we do not persist it
149150 */
150- public function setOptions (array $ options )
151+ public function setOptions (array $ options ): static
151152 {
152153 return $ this ->addOptions ($ options );
153154 }
@@ -159,7 +160,7 @@ public function setOptions(array $options)
159160 *
160161 * @see setOptions
161162 */
162- public function getOption ($ name )
163+ public function getOption (string $ name ): mixed
163164 {
164165 $ option = parent ::getOption ($ name );
165166 if (null === $ option && 'compiler_class ' === $ name ) {
@@ -179,7 +180,7 @@ public function getOption($name)
179180 *
180181 * @see setOptions
181182 */
182- public function getOptions ()
183+ public function getOptions (): array
183184 {
184185 $ options = parent ::getOptions ();
185186 if (!\array_key_exists ('compiler_class ' , $ options )) {
@@ -209,7 +210,7 @@ protected function isBooleanOption($name)
209210 /**
210211 * {@inheritdoc}
211212 */
212- public function getPath ()
213+ public function getPath (): string
213214 {
214215 $ pattern = '' ;
215216 if ($ this ->getOption ('add_locale_pattern ' )) {
@@ -234,7 +235,7 @@ public function getPath()
234235 * When using PHPCR-ODM, make sure to persist the route before calling this
235236 * to have the id field initialized.
236237 */
237- public function setPath ($ pattern )
238+ public function setPath (string $ pattern ): static
238239 {
239240 if (0 !== strpos ($ pattern , $ this ->getStaticPrefix ())) {
240241 throw new \InvalidArgumentException (sprintf (
@@ -273,7 +274,7 @@ public function setVariablePattern($variablePattern)
273274 *
274275 * Overwritten to make sure the route is recompiled if the pattern was changed
275276 */
276- public function compile ()
277+ public function compile (): CompiledRoute
277278 {
278279 if ($ this ->needRecompile ) {
279280 // calling parent::setPath just to let it set compiled=null. the parent $path field is never used
0 commit comments