@@ -62,8 +62,7 @@ |
||
| 62 | 62 | private function getFileContents( string $filePath ): string { |
| 63 | 63 | try { |
| 64 | 64 | return $this->fileFetcher->fetchFile( $filePath ); |
| 65 | - } |
|
| 66 | - catch ( FileFetchingException $ex ) { |
|
| 65 | + } catch ( FileFetchingException $ex ) { |
|
| 67 | 66 | throw new RuntimeException( 'Cannot read config file at path "' . $filePath . '"', 0, $ex ); |
| 68 | 67 | } |
| 69 | 68 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\Infrastructure; |
| 6 | 6 | |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | try { |
| 31 | 31 | $this->cachePurger->purgeCache(); |
| 32 | - } |
|
| 33 | - catch ( CachePurgingException $ex ) { |
|
| 32 | + } catch ( CachePurgingException $ex ) { |
|
| 34 | 33 | return self::RESULT_ERROR; |
| 35 | 34 | } |
| 36 | 35 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\Infrastructure\Cache; |
| 6 | 6 | |
@@ -22,8 +22,7 @@ |
||
| 22 | 22 | public function validate( $value ): ValidationResult { // @codingStandardsIgnoreLine |
| 23 | 23 | try { |
| 24 | 24 | $this->twig->loadTemplate( $value ); |
| 25 | - } |
|
| 26 | - catch ( \Twig_Error_Loader $e ) { |
|
| 25 | + } catch ( \Twig_Error_Loader $e ) { |
|
| 27 | 26 | return new ValidationResult( new ConstraintViolation( $value, 'Could not find template' ) ); |
| 28 | 27 | } |
| 29 | 28 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\Validation; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\Cli\ApplicationConfigValidation; |
| 6 | 6 | |
@@ -31,15 +31,13 @@ |
||
| 31 | 31 | |
| 32 | 32 | try { |
| 33 | 33 | $pageId = $pageSelector->getPageId( $pageName ); |
| 34 | - } |
|
| 35 | - catch ( PageNotFoundException $exception ) { |
|
| 34 | + } catch ( PageNotFoundException $exception ) { |
|
| 36 | 35 | throw new NotFoundHttpException( "Page page name '$pageName' not found." ); |
| 37 | 36 | } |
| 38 | 37 | |
| 39 | 38 | try { |
| 40 | 39 | return $this->getPageTemplate( $pageId )->render( [ 'page_id' => $pageId ] ); |
| 41 | - } |
|
| 42 | - catch ( \Twig_Error_Runtime $exception ) { |
|
| 40 | + } catch ( \Twig_Error_Runtime $exception ) { |
|
| 43 | 41 | if ( $exception->getPrevious() instanceof ContentNotFoundException ) { |
| 44 | 42 | throw new NotFoundHttpException( "Content for page id '$pageId' not found." ); |
| 45 | 43 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\App\RouteHandlers; |
| 6 | 6 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | try { |
| 40 | - return $this->getPageTemplate( $pageId )->render( [ 'page_id' => $pageId ] ); |
|
| 40 | + return $this->getPageTemplate( $pageId )->render( ['page_id' => $pageId] ); |
|
| 41 | 41 | } |
| 42 | 42 | catch ( \Twig_Error_Runtime $exception ) { |
| 43 | 43 | if ( $exception->getPrevious() instanceof ContentNotFoundException ) { |
@@ -44,8 +44,7 @@ |
||
| 44 | 44 | $appRoot = realpath( __DIR__ . '/../..' ) . '/'; |
| 45 | 45 | if ( is_string( $config['template-dir'] ) ) { |
| 46 | 46 | return $this->convertToAbsolute( $appRoot, $templateDir = [ $config['template-dir'] ] ); |
| 47 | - } |
|
| 48 | - elseif ( is_array( $config['template-dir'] ) ) { |
|
| 47 | + } elseif ( is_array( $config['template-dir'] ) ) { |
|
| 49 | 48 | return $this->convertToAbsolute( $appRoot, $templateDir = $config['template-dir'] ); |
| 50 | 49 | } |
| 51 | 50 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\Factories; |
| 6 | 6 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | private function getTemplateDir( array $config ): array { |
| 44 | 44 | $appRoot = realpath( __DIR__ . '/../..' ) . '/'; |
| 45 | 45 | if ( is_string( $config['template-dir'] ) ) { |
| 46 | - return $this->convertToAbsolute( $appRoot, $templateDir = [ $config['template-dir'] ] ); |
|
| 46 | + return $this->convertToAbsolute( $appRoot, $templateDir = [$config['template-dir']] ); |
|
| 47 | 47 | } |
| 48 | 48 | elseif ( is_array( $config['template-dir'] ) ) { |
| 49 | 49 | return $this->convertToAbsolute( $appRoot, $templateDir = $config['template-dir'] ); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function newFilePrefixFilter( FilePrefixer $filePrefixer ): Twig_SimpleFilter { |
| 81 | - return new Twig_SimpleFilter( 'prefix_file', [ $filePrefixer, 'prefixFile' ] ); |
|
| 81 | + return new Twig_SimpleFilter( 'prefix_file', [$filePrefixer, 'prefixFile'] ); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function newTwigEnvironmentConfigurator(): TwigEnvironmentConfigurator { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\Factories; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\Presentation\ContentPage; |
| 6 | 6 | |
@@ -22,20 +22,15 @@ |
||
| 22 | 22 | public function loadCampaignConfiguration( string ...$configFiles ): array { |
| 23 | 23 | try { |
| 24 | 24 | return $this->actualCampaignConfigurationLoader->loadCampaignConfiguration( ...$configFiles ); |
| 25 | - } |
|
| 26 | - catch ( ParseException $e ) { |
|
| 25 | + } catch ( ParseException $e ) { |
|
| 27 | 26 | $this->errorLogger->addError( 'Failed to parse campaign YAML: ' . $e->getMessage() ); |
| 28 | - } |
|
| 29 | - catch ( FileFetchingException $e ) { |
|
| 27 | + } catch ( FileFetchingException $e ) { |
|
| 30 | 28 | $this->errorLogger->addError( 'YAML configuration file read error: ' . $e->getMessage() ); |
| 31 | - } |
|
| 32 | - catch ( InvalidConfigurationException $e ) { |
|
| 29 | + } catch ( InvalidConfigurationException $e ) { |
|
| 33 | 30 | $this->errorLogger->addError( 'Invalid campaign YAML configuration: ' . $e->getMessage() ); |
| 34 | - } |
|
| 35 | - catch ( \RuntimeException $e ) { |
|
| 31 | + } catch ( \RuntimeException $e ) { |
|
| 36 | 32 | $this->errorLogger->addError( 'Runtime error while parsing campaign YAML: ' . $e->getMessage() ); |
| 37 | - } |
|
| 38 | - catch ( \Throwable $e ) { |
|
| 33 | + } catch ( \Throwable $e ) { |
|
| 39 | 34 | $this->errorLogger->addError( get_class( $e ) . ': ' . $e->getMessage() ); |
| 40 | 35 | } |
| 41 | 36 | return []; |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Fundraising\Frontend\BucketTesting\Validation; |
| 6 | 6 | |