Skip to content

Commit fd10e7d

Browse files
committed
CS fixes
1 parent 97b6b82 commit fd10e7d

File tree

3 files changed

+39
-40
lines changed

3 files changed

+39
-40
lines changed

DependencyInjection/Compiler/DebugHandlerPass.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1717
use Symfony\Component\DependencyInjection\Definition;
18-
use Symfony\Component\HttpKernel\Kernel;
1918
use Monolog\Logger;
2019

2120
/**

DependencyInjection/Configuration.php

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public function getConfigTreeBuilder()
235235
->treatNullLike('null')
236236
->beforeNormalization()
237237
->always()
238-
->then(function($v) { return strtolower($v); })
238+
->then(function ($v) { return strtolower($v); })
239239
->end()
240240
->end()
241241
->scalarNode('id')->end()
@@ -273,7 +273,7 @@ public function getConfigTreeBuilder()
273273
->booleanNode('use_ssl')->defaultTrue()->end() // logentries
274274
->variableNode('user') // pushover
275275
->validate()
276-
->ifTrue(function($v) {
276+
->ifTrue(function ($v) {
277277
return !is_string($v) && !is_array($v);
278278
})
279279
->thenInvalid('User must be a string or an array.')
@@ -286,7 +286,7 @@ public function getConfigTreeBuilder()
286286
->canBeUnset()
287287
->beforeNormalization()
288288
->ifString()
289-
->then(function($v) { return array('id'=> $v); })
289+
->then(function ($v) { return array('id'=> $v); })
290290
->end()
291291
->children()
292292
->scalarNode('id')->end()
@@ -295,7 +295,7 @@ public function getConfigTreeBuilder()
295295
->scalarNode('chunk_size')->defaultValue(1420)->end()
296296
->end()
297297
->validate()
298-
->ifTrue(function($v) {
298+
->ifTrue(function ($v) {
299299
return !isset($v['id']) && !isset($v['hostname']);
300300
})
301301
->thenInvalid('What must be set is either the hostname or the id.')
@@ -305,7 +305,7 @@ public function getConfigTreeBuilder()
305305
->canBeUnset()
306306
->beforeNormalization()
307307
->ifString()
308-
->then(function($v) { return array('id'=> $v); })
308+
->then(function ($v) { return array('id'=> $v); })
309309
->end()
310310
->children()
311311
->scalarNode('id')->end()
@@ -317,13 +317,13 @@ public function getConfigTreeBuilder()
317317
->scalarNode('collection')->defaultValue('logs')->end()
318318
->end()
319319
->validate()
320-
->ifTrue(function($v) {
320+
->ifTrue(function ($v) {
321321
return !isset($v['id']) && !isset($v['host']);
322322
})
323323
->thenInvalid('What must be set is either the host or the id.')
324324
->end()
325325
->validate()
326-
->ifTrue(function($v) {
326+
->ifTrue(function ($v) {
327327
return isset($v['user']) && !isset($v['pass']);
328328
})
329329
->thenInvalid('If you set user, you must provide a password.')
@@ -339,7 +339,7 @@ public function getConfigTreeBuilder()
339339
->prototype('scalar')->end()
340340
->beforeNormalization()
341341
->ifString()
342-
->then(function($v) { return array($v); })
342+
->then(function ($v) { return array($v); })
343343
->end()
344344
->end()
345345
->scalarNode('subject')->end() // swift_mailer and native_mailer
@@ -349,7 +349,7 @@ public function getConfigTreeBuilder()
349349
->canBeUnset()
350350
->beforeNormalization()
351351
->ifString()
352-
->then(function($v) { return array('id' => $v); })
352+
->then(function ($v) { return array('id' => $v); })
353353
->end()
354354
->children()
355355
->scalarNode('id')->isRequired()->end()
@@ -366,11 +366,11 @@ public function getConfigTreeBuilder()
366366
->arrayNode('tags') // loggly
367367
->beforeNormalization()
368368
->ifString()
369-
->then(function($v) { return explode(',', $v); })
369+
->then(function ($v) { return explode(',', $v); })
370370
->end()
371371
->beforeNormalization()
372372
->ifArray()
373-
->then(function($v) { return array_filter(array_map('trim', $v)); })
373+
->then(function ($v) { return array_filter(array_map('trim', $v)); })
374374
->end()
375375
->prototype('scalar')->end()
376376
->end()
@@ -435,14 +435,14 @@ public function getConfigTreeBuilder()
435435
->canBeUnset()
436436
->beforeNormalization()
437437
->ifString()
438-
->then(function($v) { return array('elements' => array($v)); })
438+
->then(function ($v) { return array('elements' => array($v)); })
439439
->end()
440440
->beforeNormalization()
441-
->ifTrue(function($v) { return is_array($v) && is_numeric(key($v)); })
442-
->then(function($v) { return array('elements' => $v); })
441+
->ifTrue(function ($v) { return is_array($v) && is_numeric(key($v)); })
442+
->then(function ($v) { return array('elements' => $v); })
443443
->end()
444444
->validate()
445-
->ifTrue(function($v) { return empty($v); })
445+
->ifTrue(function ($v) { return empty($v); })
446446
->thenUnset()
447447
->end()
448448
->validate()
@@ -487,80 +487,80 @@ public function getConfigTreeBuilder()
487487
->scalarNode('formatter')->end()
488488
->end()
489489
->validate()
490-
->ifTrue(function($v) { return 'service' === $v['type'] && !empty($v['formatter']); })
490+
->ifTrue(function ($v) { return 'service' === $v['type'] && !empty($v['formatter']); })
491491
->thenInvalid('Service handlers can not have a formatter configured in the bundle, you must reconfigure the service itself instead')
492492
->end()
493493
->validate()
494-
->ifTrue(function($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && 1 !== count($v['handler']); })
494+
->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && 1 !== count($v['handler']); })
495495
->thenInvalid('The handler has to be specified to use a FingersCrossedHandler or BufferHandler or FilterHandler')
496496
->end()
497497
->validate()
498-
->ifTrue(function($v) { return 'fingers_crossed' === $v['type'] && !empty($v['excluded_404s']) && !empty($v['activation_strategy']); })
498+
->ifTrue(function ($v) { return 'fingers_crossed' === $v['type'] && !empty($v['excluded_404s']) && !empty($v['activation_strategy']); })
499499
->thenInvalid('You can not use excluded_404s together with a custom activation_strategy in a FingersCrossedHandler')
500500
->end()
501501
->validate()
502-
->ifTrue(function($v) { return 'filter' === $v['type'] && "DEBUG" !== $v['min_level'] && !empty($v['accepted_levels']); })
502+
->ifTrue(function ($v) { return 'filter' === $v['type'] && "DEBUG" !== $v['min_level'] && !empty($v['accepted_levels']); })
503503
->thenInvalid('You can not use min_level together with accepted_levels in a FilterHandler')
504504
->end()
505505
->validate()
506-
->ifTrue(function($v) { return 'filter' === $v['type'] && "EMERGENCY" !== $v['max_level'] && !empty($v['accepted_levels']); })
506+
->ifTrue(function ($v) { return 'filter' === $v['type'] && "EMERGENCY" !== $v['max_level'] && !empty($v['accepted_levels']); })
507507
->thenInvalid('You can not use max_level together with accepted_levels in a FilterHandler')
508508
->end()
509509
->validate()
510-
->ifTrue(function($v) { return 'swift_mailer' === $v['type'] && empty($v['email_prototype']) && (empty($v['from_email']) || empty($v['to_email']) || empty($v['subject'])); })
510+
->ifTrue(function ($v) { return 'swift_mailer' === $v['type'] && empty($v['email_prototype']) && (empty($v['from_email']) || empty($v['to_email']) || empty($v['subject'])); })
511511
->thenInvalid('The sender, recipient and subject or an email prototype have to be specified to use a SwiftMailerHandler')
512512
->end()
513513
->validate()
514-
->ifTrue(function($v) { return 'native_mailer' === $v['type'] && (empty($v['from_email']) || empty($v['to_email']) || empty($v['subject'])); })
514+
->ifTrue(function ($v) { return 'native_mailer' === $v['type'] && (empty($v['from_email']) || empty($v['to_email']) || empty($v['subject'])); })
515515
->thenInvalid('The sender, recipient and subject have to be specified to use a NativeMailerHandler')
516516
->end()
517517
->validate()
518-
->ifTrue(function($v) { return 'service' === $v['type'] && !isset($v['id']); })
518+
->ifTrue(function ($v) { return 'service' === $v['type'] && !isset($v['id']); })
519519
->thenInvalid('The id has to be specified to use a service as handler')
520520
->end()
521521
->validate()
522-
->ifTrue(function($v) { return 'syslogudp' === $v['type'] && !isset($v['host']); })
522+
->ifTrue(function ($v) { return 'syslogudp' === $v['type'] && !isset($v['host']); })
523523
->thenInvalid('The host has to be specified to use a syslogudp as handler')
524524
->end()
525525
->validate()
526-
->ifTrue(function($v) { return 'gelf' === $v['type'] && !isset($v['publisher']); })
526+
->ifTrue(function ($v) { return 'gelf' === $v['type'] && !isset($v['publisher']); })
527527
->thenInvalid('The publisher has to be specified to use a GelfHandler')
528528
->end()
529529
->validate()
530-
->ifTrue(function($v) { return 'socket' === $v['type'] && !isset($v['connection_string']); })
530+
->ifTrue(function ($v) { return 'socket' === $v['type'] && !isset($v['connection_string']); })
531531
->thenInvalid('The connection_string has to be specified to use a SocketHandler')
532532
->end()
533533
->validate()
534-
->ifTrue(function($v) { return 'pushover' === $v['type'] && (empty($v['token']) || empty($v['user'])); })
534+
->ifTrue(function ($v) { return 'pushover' === $v['type'] && (empty($v['token']) || empty($v['user'])); })
535535
->thenInvalid('The token and user have to be specified to use a PushoverHandler')
536536
->end()
537537
->validate()
538-
->ifTrue(function($v) { return 'raven' === $v['type'] && !array_key_exists('dsn', $v); })
538+
->ifTrue(function ($v) { return 'raven' === $v['type'] && !array_key_exists('dsn', $v); })
539539
->thenInvalid('The DSN has to be specified to use a RavenHandler')
540540
->end()
541541
->validate()
542-
->ifTrue(function($v) { return 'hipchat' === $v['type'] && (empty($v['token']) || empty($v['room'])); })
542+
->ifTrue(function ($v) { return 'hipchat' === $v['type'] && (empty($v['token']) || empty($v['room'])); })
543543
->thenInvalid('The token and room have to be specified to use a HipChatHandler')
544544
->end()
545545
->validate()
546-
->ifTrue(function($v) { return 'cube' === $v['type'] && empty($v['url']); })
546+
->ifTrue(function ($v) { return 'cube' === $v['type'] && empty($v['url']); })
547547
->thenInvalid('The url has to be specified to use a CubeHandler')
548548
->end()
549549
->validate()
550-
->ifTrue(function($v) { return 'mongo' === $v['type'] && !isset($v['mongo']); })
550+
->ifTrue(function ($v) { return 'mongo' === $v['type'] && !isset($v['mongo']); })
551551
->thenInvalid('The mongo configuration has to be specified to use a MongoHandler')
552552
->end()
553553
->validate()
554-
->ifTrue(function($v) { return 'amqp' === $v['type'] && empty($v['exchange']); })
554+
->ifTrue(function ($v) { return 'amqp' === $v['type'] && empty($v['exchange']); })
555555
->thenInvalid('The exchange has to be specified to use a AmqpHandler')
556556
->end()
557557
->validate()
558-
->ifTrue(function($v) { return 'loggly' === $v['type'] && empty($v['token']); })
558+
->ifTrue(function ($v) { return 'loggly' === $v['type'] && empty($v['token']); })
559559
->thenInvalid('The token has to be specified to use a LogglyHandler')
560560
->end()
561561
->validate()
562-
->ifTrue(function($v) { return 'loggly' === $v['type'] && !empty($v['tags']); })
563-
->then(function($v) {
562+
->ifTrue(function ($v) { return 'loggly' === $v['type'] && !empty($v['tags']); })
563+
->then(function ($v) {
564564
$invalidTags = preg_grep('/^[a-z0-9][a-z0-9\.\-_]*$/i', $v['tags'], PREG_GREP_INVERT);
565565
if (!empty($invalidTags)) {
566566
throw new InvalidConfigurationException(sprintf('The following Loggly tags are invalid: %s.', implode(', ', $invalidTags)));
@@ -570,12 +570,12 @@ public function getConfigTreeBuilder()
570570
})
571571
->end()
572572
->validate()
573-
->ifTrue(function($v) { return 'logentries' === $v['type'] && empty($v['token']); })
573+
->ifTrue(function ($v) { return 'logentries' === $v['type'] && empty($v['token']); })
574574
->thenInvalid('The token has to be specified to use a LogEntriesHandler')
575575
->end()
576576
->end()
577577
->validate()
578-
->ifTrue(function($v) { return isset($v['debug']); })
578+
->ifTrue(function ($v) { return isset($v['debug']); })
579579
->thenInvalid('The "debug" name cannot be used as it is reserved for the handler of the profiler')
580580
->end()
581581
->example(array(

DependencyInjection/MonologExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
204204
} else {
205205
$server = 'mongodb://';
206206

207-
if(isset($handler['mongo']['user'])) {
207+
if (isset($handler['mongo']['user'])) {
208208
$server .= $handler['mongo']['user'] . ':' . $handler['mongo']['pass'] . '@';
209209
}
210210

@@ -362,7 +362,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
362362
$message->addMethodCall('setTo', array($handler['to_email']));
363363
$message->addMethodCall('setSubject', array($handler['subject']));
364364

365-
if(isset($handler['mailer'])){
365+
if (isset($handler['mailer'])) {
366366
$mailer = $handler['mailer'];
367367
} else {
368368
$mailer = 'mailer';

0 commit comments

Comments
 (0)