Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #187

Merged
merged 4 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
php-version: '8.3'
coverage: none

- name: Cache composer dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.0, 8.1, 8.2]
php: [8.1, 8.2, 8.3]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Psalm level](https://shepherd.dev/github/spatie/calendar-links/level.svg)](https://shepherd.dev/github/spatie/calendar-links)


Using this package you can generate links to add events to calendar systems. Here's a quick example:
Using this package, you can generate links to add events to calendar systems. Here's a quick example:

```php
use Spatie\CalendarLinks\Link;
Expand All @@ -22,7 +22,7 @@ Link::create(

This will output: `https://calendar.google.com/calendar/render?action=TEMPLATE&text=Birthday&dates=20180201T090000/20180201T180000&sprop=&sprop=name:`

If you follow that link (and are authenticated with Google) you'll see a screen to add the event to your calendar.
If you follow that link (and are authenticated with Google), youll see a screen to add the event to your calendar.

The package can also generate ics files that you can open in several email and calendar programs, including Microsoft Outlook, Google Calendar, and Apple Calendar.

Expand Down Expand Up @@ -76,17 +76,15 @@ echo $link->ics([], ['format' => 'file']); // e.g. to attach ics as a file to an
echo $link->formatWith(new \Your\Generator());
```

> ⚠️ ICS download links don't work in IE and EdgeHTML-based Edge browsers, see [details](https://github.com/spatie/calendar-links/issues/71).

## Package principles

1. it should produce a small output (to keep pagesize small)
1. it should produce a small output (to keep page-size small)
2. it should be fast (no any external heavy dependencies)
3. all features should be supported by at least 2 generators (different services have different features)

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
Please see [CHANGELOG](CHANGELOG.md) for more information.

## Testing

Expand All @@ -100,11 +98,11 @@ Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTI

## Security

If you've found a bug regarding security please mail [[email protected]](mailto:[email protected]) instead of using the issue tracker.
If you've found a bug regarding security, please mail [[email protected]](mailto:[email protected]) instead of using the issue tracker.

## Postcardware

You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment, we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "spatie/calendar-links",
"description": "Generate add to calendar links for Google, iCal and other calendar systems",
"license": "MIT",
"keywords": [
"spatie",
"calendar-links"
],
"homepage": "https://github.com/spatie/calendar-links",
"license": "MIT",
"authors": [
{
"name": "Sebastian De Deyne",
Expand All @@ -15,14 +14,15 @@
"role": "Developer"
}
],
"homepage": "https://github.com/spatie/calendar-links",
"require": {
"php": "^8.0"
"php": "^8.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.14",
"phpunit/phpunit": "^9.6 || ^10.0",
"spatie/phpunit-snapshot-assertions": "^4.2 || ^5.0",
"vimeo/psalm": "^5.6"
"friendsofphp/php-cs-fixer": "^3.48",
"phpunit/phpunit": "^10.1",
"spatie/phpunit-snapshot-assertions": "^5.1",
"vimeo/psalm": "^5.20"
},
"autoload": {
"psr-4": {
Expand All @@ -34,14 +34,14 @@
"Spatie\\CalendarLinks\\Tests\\": "tests"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"psalm": "vendor/bin/psalm --find-unused-psalm-suppress --output-format=phpstorm",
"psalm:ci": "vendor/bin/psalm --find-unused-psalm-suppress --output-format=github --shepherd",
"test": "vendor/bin/phpunit",
"test:update-snapshots": "vendor/bin/phpunit -d --update-snapshots"
},
"config": {
"sort-packages": true
}
}
25 changes: 13 additions & 12 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
bootstrap="vendor/autoload.php" backupGlobals="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
colors="true"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="unit">
<directory>tests</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="unit">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
56 changes: 46 additions & 10 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.6.0@e784128902dfe01d489c4123d69918a9f3c1eac5">
<files psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4">
<file src="src/Generators/BaseOutlook.php">
<PossiblyUndefinedMethod>
<MissingDocblockType>
<code><![CDATA[protected $dateFormat = 'Y-m-d';]]></code>
<code><![CDATA[protected $dateTimeFormat = 'Y-m-d\TH:i:s\Z';]]></code>
</MissingDocblockType>
<MissingPropertyType>
<code>$dateFormat</code>
<code>$dateTimeFormat</code>
</MissingPropertyType>
<UndefinedInterfaceMethod>
<code>setTimezone</code>
<code>setTimezone</code>
</PossiblyUndefinedMethod>
</UndefinedInterfaceMethod>
</file>
<file src="src/Generators/Google.php">
<PossiblyUndefinedMethod>
<MissingDocblockType>
<code><![CDATA[protected $dateFormat = 'Ymd';]]></code>
</MissingDocblockType>
<MissingPropertyType>
<code>$dateFormat</code>
</MissingPropertyType>
<UndefinedInterfaceMethod>
<code>setTimezone</code>
<code>setTimezone</code>
</PossiblyUndefinedMethod>
</UndefinedInterfaceMethod>
</file>
<file src="src/Generators/Ics.php">
<MissingDocblockType>
<code><![CDATA[protected $dateFormat = 'Ymd';]]></code>
</MissingDocblockType>
<MissingPropertyType>
<code>$dateFormat</code>
</MissingPropertyType>
</file>
<file src="src/Generators/Yahoo.php">
<PossiblyUndefinedMethod>
<MissingDocblockType>
<code><![CDATA[protected $dateFormat = 'Ymd';]]></code>
</MissingDocblockType>
<MissingPropertyType>
<code>$dateFormat</code>
</MissingPropertyType>
<UndefinedInterfaceMethod>
<code>setTimezone</code>
<code>setTimezone</code>
</PossiblyUndefinedMethod>
</UndefinedInterfaceMethod>
</file>
<file src="src/Link.php">
<LessSpecificReturnStatement>
<code>self::createAllDay($title, $startDate, $numberOfDays)</code>
</LessSpecificReturnStatement>
<MissingParamType>
<code>$property</code>
</MissingParamType>
<PossiblyUndefinedMethod>
<code>modify</code>
</PossiblyUndefinedMethod>
<PropertyTypeCoercion>
<code>clone $from</code>
<code>clone $to</code>
</PropertyTypeCoercion>
<UndefinedInterfaceMethod>
<code>modify</code>
</UndefinedInterfaceMethod>
<UnsafeInstantiation>
<code>new static($title, $from, $to, $allDay)</code>
</UnsafeInstantiation>
</file>
<file src="tests/Generators/IcsGeneratorTest.php">
<InvalidArgument>
<code>$presentationOptions</code>
</InvalidArgument>
</file>
</files>
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorLevel="2"
findUnusedBaselineEntry="true"
findUnusedCode="false"
findUnusedVariablesAndParams="true"
resolveFromConfigFile="true"
useDocblockPropertyTypes="true"
Expand Down
1 change: 1 addition & 0 deletions src/Generators/BaseOutlook.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ abstract class BaseOutlook implements Generator
{
/** @var string {@see https://www.php.net/manual/en/function.date.php} */
protected $dateFormat = 'Y-m-d';

/** @var string {@see https://www.php.net/manual/en/function.date.php} */
protected $dateTimeFormat = 'Y-m-d\TH:i:s\Z';

Expand Down
2 changes: 1 addition & 1 deletion tests/Generators/IcsGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function it_has_a_product_dtstamp(): void
public function it_generates_base64_encoded_link_for_html(): void
{
$this->assertMatchesSnapshot(
$this->generator([], ['format' => Ics::FORMAT_FILE])->generate($this->createShortEventLink())
$this->generator([], ['format' => Ics::FORMAT_HTML])->generate($this->createShortEventLink())
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BEGIN:VCALENDAR
VERSION:2.0
PRODID:Spatie calendar-links
BEGIN:VEVENT
UID:b4be522f87b9894dadd2b9cd5479136b
UID:a05fc4dac68ae6064aaae69dcdfd60a6
SUMMARY:All day bugs
DTSTAMP:20240125
DTSTART:20240125
Expand Down
Loading