Skip to content

Commit f845f96

Browse files
committed
Fix #11
1 parent ea2dde4 commit f845f96

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed

.php_cs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,25 @@ This source file is subject to the MIT license that is bundled.
88
EOF;
99

1010
return PhpCsFixer\Config::create()
11-
->setRiskyAllowed(true)
12-
->setRules(array(
13-
'@Symfony' => true,
14-
'header_comment' => array('header' => $header),
15-
'array_syntax' => array('syntax' => 'short'),
16-
'ordered_imports' => true,
17-
'no_useless_else' => true,
18-
'no_useless_return' => true,
19-
'php_unit_construct' => true,
20-
'php_unit_strict' => true,
21-
))
11+
->setRules([
12+
'@PSR2' => true,
13+
'blank_line_after_opening_tag' => true,
14+
'braces' => ['allow_single_line_closure' => true],
15+
'compact_nullable_typehint' => true,
16+
'concat_space' => ['spacing' => 'one'],
17+
'declare_equal_normalize' => ['space' => 'none'],
18+
'function_typehint_space' => true,
19+
'new_with_braces' => true,
20+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
21+
'no_empty_statement' => true,
22+
'no_leading_import_slash' => true,
23+
'no_leading_namespace_whitespace' => true,
24+
'no_whitespace_in_blank_line' => true,
25+
'return_type_declaration' => ['space_before' => 'none'],
26+
'single_trait_insert_per_statement' => true,
27+
])
2228
->setFinder(
2329
PhpCsFixer\Finder::create()
24-
->exclude('vendor')
25-
->in(__DIR__)
30+
->in([__DIR__.'/src/'])
2631
)
27-
;
32+
;

src/DirectMailServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DirectMailServiceProvider extends ServiceProvider
2525
*/
2626
public function register()
2727
{
28-
$this->app['swift.transport']->extend('directmail', function () {
28+
$this->app['mail.manager']->extend('directmail', function () {
2929
$config = $this->app['config']->get('services.directmail', []);
3030

3131
return new DirectMailTransport(new Client($config), $config['key'], $config);

src/DirectMailTransport.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected function makeSignature(array $parameters)
128128
{
129129
\ksort($parameters);
130130

131-
$signString = rawurlencode('POST&/&'.http_build_query($parameters, null, '&', PHP_QUERY_RFC3986));
131+
$signString = rawurlencode('POST&/&' . http_build_query($parameters, null, '&', PHP_QUERY_RFC3986));
132132

133133
return base64_encode(hash_hmac('sha1', $signString, $this->getKey(), true));
134134
}
@@ -143,7 +143,7 @@ protected function makeSignature(array $parameters)
143143
protected function getTo(Swift_Mime_SimpleMessage $message)
144144
{
145145
return collect($this->allContacts($message))->map(function ($display, $address) {
146-
return $display ? $display." <{$address}>" : $address;
146+
return $display ? $display . " <{$address}>" : $address;
147147
})->values()->implode(',');
148148
}
149149

@@ -157,7 +157,8 @@ protected function getTo(Swift_Mime_SimpleMessage $message)
157157
protected function getTransmissionId($response)
158158
{
159159
return object_get(
160-
json_decode($response->getBody()->getContents()), 'RequestId'
160+
json_decode($response->getBody()->getContents()),
161+
'RequestId'
161162
);
162163
}
163164

@@ -171,7 +172,9 @@ protected function getTransmissionId($response)
171172
protected function allContacts(Swift_Mime_SimpleMessage $message)
172173
{
173174
return array_merge(
174-
(array) $message->getTo(), (array) $message->getCc(), (array) $message->getBcc()
175+
(array) $message->getTo(),
176+
(array) $message->getCc(),
177+
(array) $message->getBcc()
175178
);
176179
}
177180

0 commit comments

Comments
 (0)