Skip to content

Commit

Permalink
Merge pull request #5 from bearsunday/php84
Browse files Browse the repository at this point in the history
Enable PHP 8.4 compat
  • Loading branch information
koriym authored Nov 23, 2024
2 parents a2c52e4 + 40021c9 commit add082c
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
cs:
uses: ray-di/.github/.github/workflows/coding-standards.yml@v1
with:
php_version: 8.1
php_version: 8.3
5 changes: 4 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ on:

jobs:
ci:
uses: ray-di/.github/.github/workflows/continuous-integration.yml@v2
uses: ray-di/.github/.github/workflows/continuous-integration.yml@v1
with:
old_stable: '["8.1", "8.2", "8.3"]
current_stable: 8.4
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
sa:
uses: ray-di/.github/.github/workflows/static-analysis.yml@v1
with:
php_version: 8.1
php_version: 8.3
has_crc_config: true
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# BEAR.FastlyModule
Fastly integration for BEAR.Sunday

## Installation
> There are only two hard things in Computer Science: cache invalidation and naming things.
>
> – Phil Karlton
composer install
Fastly CDN integration module for BEAR.Sunday

## Available Commands
## Example

composer test // Run unit test
composer tests // Test and quality checks
composer cs-fix // Fix the coding style
composer sa // Run static analysis tools
composer run-script --list // List all commands
```php
use BEAR\FastlyModule\FastlyEnableSoftPurgeModule;
use BEAR\FastlyModule\FastlyPurgeModule;

// Set API key and service ID
$this->install(new FastlyPurgeModule(
$fastlyApiKey,
$fastlyServiceId
));

// Enable soft purge
$this->install(new FastlyEnableSoftPurgeModule());
```
See more at https://bearsunday.github.io/manuals/1.0/ja/cache.html
4 changes: 2 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<arg name="parallel" value="80"/>
<arg name="cache" value=".phpcs-cache"/>

<!-- Compatibility with PHP 8.0 -->
<config name="php_version" value="80000"/>
<!-- Compatibility with PHP 8.3 -->
<config name="php_version" value="80300"/>

<!-- Ignore warnings, show progress of the run and show sniff names -->
<arg value="nps"/>
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="tests/bootstrap.php">
bootstrap="vendor/autoload.php">
<coverage processUncoveredFiles="true" cacheDirectory="./.phpunit-cache">
<include>
<directory suffix=".php">src</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/FastlyEnableSoftPurgeModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
final class FastlyEnableSoftPurgeModule extends AbstractModule
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
protected function configure(): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/FastlyPurgeModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(
parent::__construct($module);
}

/** {@inheritdoc} */
/** {@inheritDoc} */
protected function configure(): void
{
$this->bind(Configuration::class)->annotatedWith(Configuration::class)->toInstance(
Expand Down
5 changes: 2 additions & 3 deletions tests/FastlyPurgeModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FastlyPurgeModuleTest extends TestCase
public function testModule(): void
{
$module = new FastlyPurgeModule('apiKey', 'serviceId');
$injector = new Injector($module, $_ENV['TMP_DIR']);
$injector = new Injector($module);

$this->assertInstanceOf(PurgeApi::class, $injector->getInstance(PurgeApi::class));
$this->assertInstanceOf(FastlyCachePurgerInterface::class, $injector->getInstance(FastlyCachePurgerInterface::class));
Expand All @@ -26,9 +26,8 @@ public function testPurge(): void
$module = new FastlyPurgeModule('apiKey', 'serviceId');
$module->override(new FakeFastlyPurgeModule());

$injector = new Injector($module, $_ENV['TMP_DIR']);
$injector = new Injector($module);
$cachePurger = $injector->getInstance(FastlyCachePurgerInterface::class);
assert($cachePurger instanceof FastlyCachePurgerInterface);
($cachePurger)('fakeTag');

$purgeApi = $injector->getInstance(PurgeApi::class);
Expand Down
3 changes: 1 addition & 2 deletions tests/FastlySoftPurgeModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ public function testSoftPurge(): void
$module = new FastlyPurgeModule('apiKey', 'serviceId');
$module->override(new FastlyEnableSoftPurgeModule(new FakeFastlyPurgeModule()));

$injector = new Injector($module, $_ENV['TMP_DIR']);
$injector = new Injector($module);
$cachePurger = $injector->getInstance(FastlyCachePurgerInterface::class);
assert($cachePurger instanceof FastlyCachePurgerInterface);
($cachePurger)('fakeTag');

$purgeApi = $injector->getInstance(PurgeApi::class);
Expand Down
13 changes: 0 additions & 13 deletions tests/bootstrap.php

This file was deleted.

7 changes: 3 additions & 4 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"require-dev": {
"doctrine/coding-standard": "^11.0",
"doctrine/coding-standard": "^12.0",
"phpmd/phpmd": "^2.9",
"phpmetrics/phpmetrics": "^2.7",
"phpstan/phpstan": "^1.1",
"psalm/plugin-phpunit": "^0.13",
"phpstan/phpstan": "^2.0",
"squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^4.2"
"vimeo/psalm": "^5.26"
},
"config": {
"allow-plugins": {
Expand Down

0 comments on commit add082c

Please sign in to comment.