@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use IncidentBundle\Entity\Incident; |
6 | 6 | use JMS\Serializer\Serializer; |
7 | -use JMS\SerializerBundle\DependencyInjection\JMSSerializerExtension; |
|
8 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
9 | 8 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
10 | 9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
@@ -166,7 +166,7 @@ |
||
166 | 166 | */ |
167 | 167 | protected function getErrorHandlerCallback(&$errors) |
168 | 168 | { |
169 | - return function ($errno, $errstr, $errfile, $errline) use (&$errors) { |
|
169 | + return function($errno, $errstr, $errfile, $errline) use (&$errors) { |
|
170 | 170 | $errors[] = ['code' => $errno, 'text' => $errstr]; |
171 | 171 | }; |
172 | 172 | } |
@@ -3,8 +3,6 @@ |
||
3 | 3 | namespace IncidentBundle\Controller; |
4 | 4 | |
5 | 5 | use IncidentBundle\Entity\Incident; |
6 | -use JMS\Serializer\Serializer; |
|
7 | -use JMS\SerializerBundle\DependencyInjection\JMSSerializerExtension; |
|
8 | 6 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
9 | 7 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
10 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $entityManager->persist($incident); |
37 | 37 | |
38 | 38 | |
39 | - $responseData['status'] = empty($errors)?'ok':'error'; |
|
39 | + $responseData['status'] = empty($errors) ? 'ok' : 'error'; |
|
40 | 40 | |
41 | 41 | return new Response(json_encode($responseData)); |
42 | 42 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * IncidentSiren constructor. |
34 | 34 | * @param NotificationTypeInterface $notificationTypeInstance |
35 | - * @param null|array $subjects |
|
35 | + * @param null|SubjectCollection $subjects |
|
36 | 36 | * @throws IncidentSirenException |
37 | 37 | */ |
38 | 38 | public function __construct(NotificationTypeInterface $notificationTypeInstance, SubjectCollection $subjects = null) |
@@ -65,7 +65,7 @@ |
||
65 | 65 | */ |
66 | 66 | public function notify(IncidentInterface $incident, $subjects = null) |
67 | 67 | { |
68 | - $subjects = null === $subjects? $this->getSubjects(): $subjects; |
|
68 | + $subjects = null === $subjects ? $this->getSubjects() : $subjects; |
|
69 | 69 | /** @var SubjectInterface $subject */ |
70 | 70 | foreach ($subjects as $subject) { |
71 | 71 | try { |
@@ -3,8 +3,6 @@ |
||
3 | 3 | namespace TonicHealthCheck\Incident\Siren\NotificationType; |
4 | 4 | |
5 | 5 | use Http\Client\Common\HttpMethodsClient; |
6 | -use Http\Discovery\StreamFactoryDiscovery; |
|
7 | -use Psr\Http\Message\RequestInterface; |
|
8 | 6 | use TonicHealthCheck\Incident\IncidentInterface; |
9 | 7 | use TonicHealthCheck\Incident\Siren\Subject\SubjectInterface; |
10 | 8 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $serverUrl = $subject; |
46 | 46 | if ($incident->getStatus() != IncidentInterface::STATUS_OK) { |
47 | - $response = $this->getHttpClient()->post( |
|
47 | + $response = $this->getHttpClient()->post( |
|
48 | 48 | $subject.$this->getResourceUrl(), |
49 | 49 | ['Content-type' => 'application/json'], |
50 | 50 | json_encode( |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | class IncidentEventSubscriber implements EventSubscriber |
22 | 22 | { |
23 | - protected static $typeEventPolitic =[ |
|
23 | + protected static $typeEventPolitic = [ |
|
24 | 24 | Incident::TYPE_URGENT => [ |
25 | 25 | EmailNotificationType::class, |
26 | 26 | FileNotificationType::class, |
@@ -12,7 +12,7 @@ |
||
12 | 12 | // Feel free to remove this, extend it, or make something more sophisticated. |
13 | 13 | if (isset($_SERVER['HTTP_CLIENT_IP']) |
14 | 14 | || isset($_SERVER['HTTP_X_FORWARDED_FOR']) |
15 | - || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1','192.168.99.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') |
|
15 | + || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '192.168.99.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') |
|
16 | 16 | ) { |
17 | 17 | header('HTTP/1.0 403 Forbidden'); |
18 | 18 | exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); |
@@ -167,7 +167,10 @@ discard block |
||
167 | 167 | <?php if (count($minorProblems)): ?> |
168 | 168 | <h2>Recommendations</h2> |
169 | 169 | <p> |
170 | - <?php if (count($majorProblems)): ?>Additionally, to<?php else: ?>To<?php endif; ?> enhance your Symfony experience, |
|
170 | + <?php if (count($majorProblems)): ?>Additionally, to<?php else { |
|
171 | + : ?>To<?php endif; |
|
172 | +} |
|
173 | +?> enhance your Symfony experience, |
|
171 | 174 | it’s recommended that you fix the following: |
172 | 175 | </p> |
173 | 176 | <ol> |
@@ -181,9 +184,12 @@ discard block |
||
181 | 184 | <p id="phpini">* |
182 | 185 | <?php if ($symfonyRequirements->getPhpIniConfigPath()): ?> |
183 | 186 | Changes to the <strong>php.ini</strong> file must be done in "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>". |
184 | - <?php else: ?> |
|
187 | + <?php else { |
|
188 | + : ?> |
|
185 | 189 | To change settings, create a "<strong>php.ini</strong>". |
186 | - <?php endif; ?> |
|
190 | + <?php endif; |
|
191 | +} |
|
192 | +?> |
|
187 | 193 | </p> |
188 | 194 | <?php endif; ?> |
189 | 195 |