@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core32_ChaCha20_Ctx |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core32_ChaCha20_Ctx { |
|
12 | 11 | /** |
13 | 12 | * ParagonIE_Sodium_Core_ChaCha20_IetfCtx constructor. |
14 | 13 | * |
@@ -22,8 +21,7 @@ discard block |
||
22 | 21 | * @throws SodiumException |
23 | 22 | * @throws TypeError |
24 | 23 | */ |
25 | - public function __construct($key = '', $iv = '', $counter = '') |
|
26 | - { |
|
24 | + public function __construct($key = '', $iv = '', $counter = '') { |
|
27 | 25 | if (self::strlen($iv) !== 12) { |
28 | 26 | throw new InvalidArgumentException('ChaCha20 expects a 96-bit nonce in IETF mode.'); |
29 | 27 | } |
@@ -10,8 +10,7 @@ discard block |
||
10 | 10 | * is a good way to avoid littering your code with `if ($this->logger) { }` |
11 | 11 | * blocks. |
12 | 12 | */ |
13 | -class NullLogger extends AbstractLogger |
|
14 | -{ |
|
13 | +class NullLogger extends AbstractLogger { |
|
15 | 14 | /** |
16 | 15 | * Logs with an arbitrary level. |
17 | 16 | * |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * |
24 | 23 | * @throws \Psr\Log\InvalidArgumentException |
25 | 24 | */ |
26 | - public function log($level, $message, array $context = array()) |
|
27 | - { |
|
25 | + public function log($level, $message, array $context = array()) { |
|
28 | 26 | // noop |
29 | 27 | } |
30 | 28 | } |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | * Implementors can extend the class and implement abstract methods to run this |
13 | 13 | * as part of their test suite. |
14 | 14 | */ |
15 | -abstract class LoggerInterfaceTest extends TestCase |
|
16 | -{ |
|
15 | +abstract class LoggerInterfaceTest extends TestCase { |
|
17 | 16 | /** |
18 | 17 | * @return LoggerInterface |
19 | 18 | */ |
@@ -30,16 +29,14 @@ discard block |
||
30 | 29 | */ |
31 | 30 | abstract public function getLogs(); |
32 | 31 | |
33 | - public function testImplements() |
|
34 | - { |
|
32 | + public function testImplements() { |
|
35 | 33 | $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); |
36 | 34 | } |
37 | 35 | |
38 | 36 | /** |
39 | 37 | * @dataProvider provideLevelsAndMessages |
40 | 38 | */ |
41 | - public function testLogsAtAllLevels($level, $message) |
|
42 | - { |
|
39 | + public function testLogsAtAllLevels($level, $message) { |
|
43 | 40 | $logger = $this->getLogger(); |
44 | 41 | $logger->{$level}($message, array('user' => 'Bob')); |
45 | 42 | $logger->log($level, $message, array('user' => 'Bob')); |
@@ -51,8 +48,7 @@ discard block |
||
51 | 48 | $this->assertEquals($expected, $this->getLogs()); |
52 | 49 | } |
53 | 50 | |
54 | - public function provideLevelsAndMessages() |
|
55 | - { |
|
51 | + public function provideLevelsAndMessages() { |
|
56 | 52 | return array( |
57 | 53 | LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), |
58 | 54 | LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), |
@@ -68,14 +64,12 @@ discard block |
||
68 | 64 | /** |
69 | 65 | * @expectedException \Psr\Log\InvalidArgumentException |
70 | 66 | */ |
71 | - public function testThrowsOnInvalidLevel() |
|
72 | - { |
|
67 | + public function testThrowsOnInvalidLevel() { |
|
73 | 68 | $logger = $this->getLogger(); |
74 | 69 | $logger->log('invalid level', 'Foo'); |
75 | 70 | } |
76 | 71 | |
77 | - public function testContextReplacement() |
|
78 | - { |
|
72 | + public function testContextReplacement() { |
|
79 | 73 | $logger = $this->getLogger(); |
80 | 74 | $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); |
81 | 75 | |
@@ -83,8 +77,7 @@ discard block |
||
83 | 77 | $this->assertEquals($expected, $this->getLogs()); |
84 | 78 | } |
85 | 79 | |
86 | - public function testObjectCastToString() |
|
87 | - { |
|
80 | + public function testObjectCastToString() { |
|
88 | 81 | if (method_exists($this, 'createPartialMock')) { |
89 | 82 | $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); |
90 | 83 | } else { |
@@ -100,8 +93,7 @@ discard block |
||
100 | 93 | $this->assertEquals($expected, $this->getLogs()); |
101 | 94 | } |
102 | 95 | |
103 | - public function testContextCanContainAnything() |
|
104 | - { |
|
96 | + public function testContextCanContainAnything() { |
|
105 | 97 | $closed = fopen('php://memory', 'r'); |
106 | 98 | fclose($closed); |
107 | 99 | |
@@ -123,8 +115,7 @@ discard block |
||
123 | 115 | $this->assertEquals($expected, $this->getLogs()); |
124 | 116 | } |
125 | 117 | |
126 | - public function testContextExceptionKeyCanBeExceptionOrOtherValues() |
|
127 | - { |
|
118 | + public function testContextExceptionKeyCanBeExceptionOrOtherValues() { |
|
128 | 119 | $logger = $this->getLogger(); |
129 | 120 | $logger->warning('Random message', array('exception' => 'oops')); |
130 | 121 | $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - function random_bytes($bytes) |
|
44 | - { |
|
43 | + function random_bytes($bytes) { |
|
45 | 44 | try { |
46 | 45 | /** @var int $bytes */ |
47 | 46 | $bytes = RandomCompat_intval($bytes); |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - function random_bytes($bytes) |
|
44 | - { |
|
43 | + function random_bytes($bytes) { |
|
45 | 44 | try { |
46 | 45 | /** @var int $bytes */ |
47 | 46 | $bytes = RandomCompat_intval($bytes); |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - function random_bytes($bytes) |
|
44 | - { |
|
43 | + function random_bytes($bytes) { |
|
45 | 44 | try { |
46 | 45 | /** @var int $bytes */ |
47 | 46 | $bytes = RandomCompat_intval($bytes); |
@@ -23,8 +23,7 @@ |
||
23 | 23 | * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md |
24 | 24 | * for the full interface specification. |
25 | 25 | */ |
26 | -interface LoggerInterface |
|
27 | -{ |
|
26 | +interface LoggerInterface { |
|
28 | 27 | /** |
29 | 28 | * System is unusable. |
30 | 29 | * |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | /** |
12 | 12 | * Basic Implementation of LoggerAwareInterface. |
13 | 13 | */ |
14 | -trait LoggerAwareTrait |
|
15 | -{ |
|
14 | +trait LoggerAwareTrait { |
|
16 | 15 | /** |
17 | 16 | * The logger instance. |
18 | 17 | * |
@@ -25,8 +24,7 @@ discard block |
||
25 | 24 | * |
26 | 25 | * @param LoggerInterface $logger |
27 | 26 | */ |
28 | - public function setLogger(LoggerInterface $logger) |
|
29 | - { |
|
27 | + public function setLogger(LoggerInterface $logger) { |
|
30 | 28 | $this->logger = $logger; |
31 | 29 | } |
32 | 30 | } |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | * reduce boilerplate code that a simple Logger that does the same thing with |
16 | 16 | * messages regardless of the error level has to implement. |
17 | 17 | */ |
18 | -abstract class AbstractLogger implements LoggerInterface |
|
19 | -{ |
|
18 | +abstract class AbstractLogger implements LoggerInterface { |
|
20 | 19 | /** |
21 | 20 | * System is unusable. |
22 | 21 | * |
@@ -25,8 +24,7 @@ discard block |
||
25 | 24 | * |
26 | 25 | * @return void |
27 | 26 | */ |
28 | - public function emergency($message, array $context = array()) |
|
29 | - { |
|
27 | + public function emergency($message, array $context = array()) { |
|
30 | 28 | $this->log(LogLevel::EMERGENCY, $message, $context); |
31 | 29 | } |
32 | 30 | |
@@ -41,8 +39,7 @@ discard block |
||
41 | 39 | * |
42 | 40 | * @return void |
43 | 41 | */ |
44 | - public function alert($message, array $context = array()) |
|
45 | - { |
|
42 | + public function alert($message, array $context = array()) { |
|
46 | 43 | $this->log(LogLevel::ALERT, $message, $context); |
47 | 44 | } |
48 | 45 | |
@@ -56,8 +53,7 @@ discard block |
||
56 | 53 | * |
57 | 54 | * @return void |
58 | 55 | */ |
59 | - public function critical($message, array $context = array()) |
|
60 | - { |
|
56 | + public function critical($message, array $context = array()) { |
|
61 | 57 | $this->log(LogLevel::CRITICAL, $message, $context); |
62 | 58 | } |
63 | 59 | |
@@ -70,8 +66,7 @@ discard block |
||
70 | 66 | * |
71 | 67 | * @return void |
72 | 68 | */ |
73 | - public function error($message, array $context = array()) |
|
74 | - { |
|
69 | + public function error($message, array $context = array()) { |
|
75 | 70 | $this->log(LogLevel::ERROR, $message, $context); |
76 | 71 | } |
77 | 72 | |
@@ -86,8 +81,7 @@ discard block |
||
86 | 81 | * |
87 | 82 | * @return void |
88 | 83 | */ |
89 | - public function warning($message, array $context = array()) |
|
90 | - { |
|
84 | + public function warning($message, array $context = array()) { |
|
91 | 85 | $this->log(LogLevel::WARNING, $message, $context); |
92 | 86 | } |
93 | 87 | |
@@ -99,8 +93,7 @@ discard block |
||
99 | 93 | * |
100 | 94 | * @return void |
101 | 95 | */ |
102 | - public function notice($message, array $context = array()) |
|
103 | - { |
|
96 | + public function notice($message, array $context = array()) { |
|
104 | 97 | $this->log(LogLevel::NOTICE, $message, $context); |
105 | 98 | } |
106 | 99 | |
@@ -114,8 +107,7 @@ discard block |
||
114 | 107 | * |
115 | 108 | * @return void |
116 | 109 | */ |
117 | - public function info($message, array $context = array()) |
|
118 | - { |
|
110 | + public function info($message, array $context = array()) { |
|
119 | 111 | $this->log(LogLevel::INFO, $message, $context); |
120 | 112 | } |
121 | 113 | |
@@ -127,8 +119,7 @@ discard block |
||
127 | 119 | * |
128 | 120 | * @return void |
129 | 121 | */ |
130 | - public function debug($message, array $context = array()) |
|
131 | - { |
|
122 | + public function debug($message, array $context = array()) { |
|
132 | 123 | $this->log(LogLevel::DEBUG, $message, $context); |
133 | 124 | } |
134 | 125 | } |