Skip to content

Commit 0a72827

Browse files
Merge pull request #6 from narendravaghela/master
Updates for GitHub CI
2 parents fe134d2 + fc886ba commit 0a72827

File tree

9 files changed

+41
-14
lines changed

9 files changed

+41
-14
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ jobs:
9191
- name: Run phpcs
9292
run: composer cs-check
9393

94-
- name: Run psalm
95-
run: psalm --output-format=github
94+
# - name: Run psalm
95+
# run: psalm --output-format=github

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SendGrid Plugin for CakePHP
22

3+
[![CI](https://github.com/sprintcube/cakephp-sendgrid/workflows/CI/badge.svg?branch=master)](https://github.com/sprintcube/cakephp-sendgrid/actions)
34
[![codecov](https://codecov.io/gh/sprintcube/cakephp-sendgrid/branch/master/graph/badge.svg)](https://codecov.io/gh/sprintcube/cakephp-sendgrid)
45
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
56
[![Latest Stable Version](https://poser.pugx.org/sprintcube/cakephp-sendgrid/v/stable)](https://packagist.org/packages/sprintcube/cakephp-sendgrid)

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@
5454
"@test",
5555
"@cs-check"
5656
],
57-
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
58-
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
57+
"cs-check": "phpcs --colors -p src/ tests/TestCase/",
58+
"cs-fix": "phpcbf --colors src/ tests/TestCase/",
5959
"psalm": "psalm",
6060
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 vimeo/psalm:~4.1.0 && mv composer.backup composer.json",
6161
"phpstan": "phpstan analyze --level 1 src/",
6262
"test": "phpunit --colors=always"
6363
},
6464
"prefer-stable": true,
65-
"minimum-stability": "dev"
65+
"config": {
66+
"allow-plugins": {
67+
"dealerdirect/phpcodesniffer-composer-installer": true
68+
}
69+
}
6670
}

phpcs.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="CakePHP Core">
3+
<rule ref="./vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml"/>
4+
5+
<exclude-pattern>tests/test_files/js/*</exclude-pattern>
6+
<exclude-pattern>tests/test_files/css/*</exclude-pattern>
7+
</ruleset>

psalm-baseline.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="3.13.1@afd8874a9e4562eac42a02de90e42e430c3a1db1"/>

psalm.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="6"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
errorBaseline="psalm-baseline.xml"
9+
autoloader="tests/bootstrap.php"
10+
>
11+
<projectFiles>
12+
<directory name="src" />
13+
<ignoreFiles>
14+
<directory name="vendor" />
15+
</ignoreFiles>
16+
</projectFiles>
17+
</psalm>

src/Mailer/Exception/SendGridApiException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626
*/
2727
class SendGridApiException extends Exception
2828
{
29-
3029
/**
31-
* {@inheritDoc}
30+
* @inheritDoc
3231
*/
3332
protected $_messageTemplate = '%s';
3433
}

src/Mailer/Transport/SendGridTransport.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@
2828
*/
2929
class SendGridTransport extends AbstractTransport
3030
{
31-
3231
/**
3332
* Default config for this class
3433
*
3534
* @var array
3635
*/
3736
protected $_defaultConfig = [
3837
'apiEndpoint' => 'https://api.sendgrid.com/v3',
39-
'apiKey' => ''
38+
'apiKey' => '',
4039
];
4140

4241
/**
@@ -183,21 +182,21 @@ protected function _prepareEmailAddresses(Message $message)
183182
foreach ($message->getTo() as $toEmail => $toName) {
184183
$emails['to'][] = [
185184
'email' => $toEmail,
186-
'name' => $toName
185+
'name' => $toName,
187186
];
188187
}
189188

190189
foreach ($message->getCc() as $ccEmail => $ccName) {
191190
$emails['cc'][] = [
192191
'email' => $ccEmail,
193-
'name' => $ccName
192+
'name' => $ccName,
194193
];
195194
}
196195

197196
foreach ($message->getBcc() as $bccEmail => $bccName) {
198197
$emails['bcc'][] = [
199198
'email' => $bccEmail,
200-
'name' => $bccName
199+
'name' => $bccName,
201200
];
202201
}
203202

tests/TestCase/Mailer/Transport/SendGridTransportTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717

1818
namespace SendGrid\Test\TestCase\Mailer\Transport;
1919

20-
use Cake\Mailer\Email;
2120
use Cake\TestSuite\TestCase;
2221

2322
class SendGridTransportTest extends TestCase
2423
{
25-
2624
public function setUp(): void
2725
{
2826
parent::setUp();

0 commit comments

Comments
 (0)