Skip to content

Commit

Permalink
update GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Jun 27, 2023
1 parent 27900bd commit 8bb3e86
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 122 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/composer-normalize.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/markdown-normalize.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: run-tests
name: phpunit

on:
push:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pint

on:
push:

jobs:
phpcs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/[email protected]
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- run: composer install --no-interaction --no-scripts
- run: vendor/bin/pint --test
57 changes: 0 additions & 57 deletions .github/workflows/stale-issues.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[![Offset Earth](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-green?style=for-the-badge)](https://plant.treeware.earth/Astrotomic/laravel-vcard)
[![Larabelles](https://img.shields.io/badge/Larabelles-%F0%9F%A6%84-lightpink?style=for-the-badge)](https://www.larabelles.com/)

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-vcard/run-tests?style=flat-square&logoColor=white&logo=github&label=Tests)](https://github.com/Astrotomic/laravel-vcard/actions?query=workflow%3Arun-tests)
[![StyleCI](https://styleci.io/repos/341030229/shield)](https://styleci.io/repos/341030229)
[![phpunit](https://img.shields.io/github/workflow/status/Astrotomic/laravel-vcard/phpunit?style=flat-square&logoColor=white&logo=github&label=Tests)](https://github.com/Astrotomic/laravel-vcard/actions?query=workflow%3Aphpunit)
[![pint](https://img.shields.io/github/workflow/status/Astrotomic/laravel-vcard/pint?style=flat-square&logoColor=white&logo=github&label=CS)](https://github.com/Astrotomic/laravel-vcard/actions?query=workflow%3Apint)
[![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-vcard.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/astrotomic/laravel-vcard)

A fluent builder class for vCard files.
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"illuminate/support": "^8.0 || ^9.0 || ^10.0"
},
"require-dev": {
"laravel/pint": "^1.10",
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0",
"phpunit/phpunit": "^9.3",
"spatie/phpunit-snapshot-assertions": "^4.2"
Expand All @@ -44,5 +45,8 @@
},
"config": {
"sort-packages": true
},
"scripts": {
"fix": "@php vendor/bin/pint"
}
}
2 changes: 2 additions & 0 deletions src/Properties/Adr.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
class Adr extends Property
{
public const HOME = 'HOME';

public const WORK = 'WORK';

public const PREF = 'PREF';

public function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Properties/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class Email extends Property
{
public const INTERNET = 'INTERNET';

public const WORK = 'WORK';

public function __construct(protected string $email, protected array $types)
Expand Down
4 changes: 4 additions & 0 deletions src/Properties/Gender.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
class Gender extends Property
{
public const FEMALE = 'F';

public const MALE = 'M';

public const OTHER = 'O';

public const NONE = 'N';

public const UNKNOWN = 'U';

public function __construct(protected string $gender)
Expand Down
2 changes: 2 additions & 0 deletions src/Properties/Kind.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
class Kind extends Property
{
public const INDIVIDUAL = 'individual';

public const ORGANIZATION = 'organization';

public const GROUP = 'group';

public function __construct(protected string $kind)
Expand Down
2 changes: 1 addition & 1 deletion src/Properties/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public function __construct(protected string $note)

public function __toString(): string
{
return "NOTE:".preg_replace('/[\r\n]+/', '\n', $this->note);
return 'NOTE:'.preg_replace('/[\r\n]+/', '\n', $this->note);
}
}
3 changes: 3 additions & 0 deletions src/Properties/Tel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
class Tel extends Property
{
public const VOICE = 'VOICE';

public const WORK = 'WORK';

public const HOME = 'HOME';

public const CELL = 'CELL';

public function __construct(protected string $number, protected array $types)
Expand Down
5 changes: 5 additions & 0 deletions src/Vcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ class Vcard implements Responsable, Stringable
use HasConditionalCalls;

protected ?string $fullName = null;

protected ?string $namePrefix = null;

protected ?string $firstName = null;

protected ?string $middleName = null;

protected ?string $lastName = null;

protected ?string $nameSuffix = null;

protected array $properties = [];
Expand Down
30 changes: 15 additions & 15 deletions tests/VcardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ public function vcard_with_fn_org(): void
{
$this->assertMatchesVcardSnapshot(
Vcard::make()
->fullName('John Adam Smith')
->org('Google', 'GMail Team', 'Spam Detection Squad')
->fullName('John Adam Smith')
->org('Google', 'GMail Team', 'Spam Detection Squad')
);
}

Expand All @@ -152,8 +152,8 @@ public function vcard_with_fn_org_missing_unit(): void
{
$this->assertMatchesVcardSnapshot(
Vcard::make()
->fullName('John Adam Smith')
->org('Google', null, 'Spam Detection Squad')
->fullName('John Adam Smith')
->org('Google', null, 'Spam Detection Squad')
);
}

Expand All @@ -162,8 +162,8 @@ public function vcard_with_fn_role(): void
{
$this->assertMatchesVcardSnapshot(
Vcard::make()
->fullName('John Adam Smith')
->role('Excecutive')
->fullName('John Adam Smith')
->role('Excecutive')
);
}

Expand All @@ -172,8 +172,8 @@ public function vcard_with_fn_title(): void
{
$this->assertMatchesVcardSnapshot(
Vcard::make()
->fullName('John Adam Smith')
->title('V. P. Research and Development')
->fullName('John Adam Smith')
->title('V. P. Research and Development')
);
}

Expand All @@ -182,8 +182,8 @@ public function vcard_with_fn_member_mail(): void
{
$this->assertMatchesVcardSnapshot(
Vcard::make()
->fullName('John Adam Smith')
->member('mailto:[email protected]')
->fullName('John Adam Smith')
->member('mailto:[email protected]')
);
}

Expand All @@ -192,8 +192,8 @@ public function vcard_with_fn_member_uuid(): void
{
$this->assertMatchesVcardSnapshot(
Vcard::make()
->fullName('John Adam Smith')
->member(null, 'urn:uuid:550e8400-e29b-11d4-a716-446655440000')
->fullName('John Adam Smith')
->member(null, 'urn:uuid:550e8400-e29b-11d4-a716-446655440000')
);
}

Expand All @@ -202,8 +202,8 @@ public function vcard_with_fn_member_uuid_and_mail(): void
{
$this->assertMatchesVcardSnapshot(
Vcard::make()
->fullName('John Adam Smith')
->member('[email protected]', '550e8400-e29b-11d4-a716-446655440000')
->fullName('John Adam Smith')
->member('[email protected]', '550e8400-e29b-11d4-a716-446655440000')
);
}

Expand Down Expand Up @@ -238,7 +238,7 @@ public function vcard_to_response_header(): void
$this->assertEquals($response->headers->get('content-length'), 129);
$this->assertEquals($response->headers->get('Content-Disposition'), 'attachment; filename=john_adam_smith.vcf');
}

/** @test */
public function vcard_with_single_note(): void
{
Expand Down

0 comments on commit 8bb3e86

Please sign in to comment.