Issues (112)

src/Aimeos/Shop/Composer.php (1 issue)

an empty catch block is always commented.

Coding Style Comprehensibility Informational
1
<?php
2
3
/**
4
 * @license MIT, http://opensource.org/licenses/MIT
5
 * @copyright Aimeos (aimeos.org), 2020
6
 * @package aimeos
7
 */
8
9
10
namespace Aimeos\Shop;
11
12
13
/**
14
 * Performs setup during composer installs
15
 *
16
 * @package aimeos
17
 */
18
class Composer
19
{
20
	/**
21
	 * @param \Composer\Script\Event $event Event instance
22
	 * @throws \RuntimeException If an error occured
23
	 */
24
	public static function join( \Composer\Script\Event $event )
25
	{
26
		try
27
		{
28
			$options = [
29
				'http' => [
30
					'method' => 'POST',
31
					'header' => ['Content-Type: application/json'],
32
					'content' => json_encode( ['query' => 'mutation{
33
						_1: addStar(input:{clientMutationId:"_1",starrableId:"MDEwOlJlcG9zaXRvcnkxMDMwMTUwNzA="}){clientMutationId}
34
						_2: addStar(input:{clientMutationId:"_2",starrableId:"MDEwOlJlcG9zaXRvcnkzMTU0MTIxMA=="}){clientMutationId}
35
						_3: addStar(input:{clientMutationId:"_3",starrableId:"MDEwOlJlcG9zaXRvcnkyNjg4MTc2NQ=="}){clientMutationId}
36
						_4: addStar(input:{clientMutationId:"_4",starrableId:"MDEwOlJlcG9zaXRvcnkyMjIzNTY4OTA="}){clientMutationId}
37
						_5: addStar(input:{clientMutationId:"_5",starrableId:"MDEwOlJlcG9zaXRvcnkyNDYxMDMzNTY="}){clientMutationId}
38
						_6: addStar(input:{clientMutationId:"_6",starrableId:"R_kgDOGcKL7A"}){clientMutationId}
39
						_7: addStar(input:{clientMutationId:"_7",starrableId:"R_kgDOGeAkvw"}){clientMutationId}
40
						_8: addStar(input:{clientMutationId:"_8",starrableId:"R_kgDOG1PAJw"}){clientMutationId}
41
						}'
42
					] )
43
				]
44
			];
45
			$config = $event->getComposer()->getConfig();
46
47
			if( method_exists( '\Composer\Factory', 'createHttpDownloader' ) )
48
			{
49
				\Composer\Factory::createHttpDownloader( $event->getIO(), $config )
50
					->get( 'https://api.github.com/graphql', $options );
51
			}
52
			else
53
			{
54
				\Composer\Factory::createRemoteFilesystem( $event->getIO(), $config )
55
					->getContents( 'github.com', 'https://api.github.com/graphql', false, $options );
56
			}
57
		}
58
		catch( \Exception $e ) {}
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
59
	}
60
}
61