Completed
Pull Request — master (#1630)
by Tonina
63:07
created
src/Infrastructure/ConfigReader.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Infrastructure/Cache/AuthorizedCachePurger.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Validation/TemplateNameValidator.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
cli/ApplicationConfigValidation/ConfigValidationException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/RouteHandlers/PageDisplayHandler.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,15 +31,13 @@
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 ) {
Please login to merge, or discard this patch.
src/Factories/TwigFactory.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
src/Factories/UnknownChoiceDefinition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Presentation/ContentPage/PageNotFoundException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/BucketTesting/Validation/LoggingCampaignConfigurationLoader.php 2 patches
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,20 +22,15 @@
 block discarded – undo
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 [];
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.