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

feat: update 6 & 7 #13

Merged
merged 5 commits into from
Jan 29, 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
12 changes: 5 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ on:

jobs:
run:
runs-on: 'ubuntu-latest'
runs-on: "ubuntu-latest"
strategy:
matrix:
symfony-version: ['^3.4', '^4', '^5', '^6']
php-version: ['7.4', '8.0', '8.1']
symfony-version: ["^6", "^7"]
php-version: ["8.1", "8.2"]
prefer: [lowest, stable]
exclude:
- symfony-version: '^6'
php-version: '7.4'
- symfony-version: '^3.4'
php-version: '8.1'
- symfony-version: "^7"
php-version: "8.1"

steps:
- name: Setup PHP
Expand Down
3 changes: 1 addition & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

class Configuration implements ConfigurationInterface
{
/** @return TreeBuilder */
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$name = 'simonetti_ping';
$treeBuilder = new TreeBuilder($name);
Expand Down
17 changes: 7 additions & 10 deletions Lock/AbstractFileStorage.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php
namespace Simonetti\PingBundle\Lock;

use Symfony\Component\Lock\BlockingStoreInterface;
use Symfony\Component\Lock\Key;
use Symfony\Component\Lock\PersistingStoreInterface;

/**
* Class FileStorage
Expand All @@ -22,36 +20,35 @@ class AbstractFileStorage
*/
public function __construct(string $path = null)
{
if (!$path) {
if (! $path) {
$path = sys_get_temp_dir() . '/simonett-ping-bundle-lock-';
}

$this->path = $path;
}


public function save(Key $key)
public function save(Key $key): void
{
file_put_contents($this->path . $key, 'lock');
}

public function waitAndSave(Key $key)
public function waitAndSave(Key $key): void
{
$this->save($key);
}

public function putOffExpiration(Key $key, $ttl)
public function putOffExpiration(Key $key, $ttl): void
{
throw new \Exception('');
}

public function delete(Key $key)
public function delete(Key $key): void
{
if (!$this->exists($key)){
if (! $this->exists($key)) {
return;
}

return unlink($this->path . $key);
unlink($this->path . $key);
}

public function exists(Key $key): bool
Expand Down
21 changes: 12 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "simonetti/ping-bundle",
"type": "symfony-bundle",
"description": "Ping Bundle",
"keywords": ["ping", "bundle"],
"keywords": [
"ping",
"bundle"
],
"homepage": "https://github.com/moveis-simonetti/ping-bundle",
"license": "MIT",
"minimum-stability": "stable",
Expand All @@ -13,20 +16,20 @@
}
],
"require": {
"php": "^7.4|^8",
"symfony/config": "^3.4|^4|^5|^6",
"symfony/console": "^3.4|^4|^5|^6",
"symfony/framework-bundle": "^3.4|^4|^5|^6",
"symfony/http-foundation": "^3.4|^4|^5|^6",
"symfony/http-kernel": "^3.4|^4|^5|^6",
"symfony/lock": "^3.4|^4|^5|^6"
"php": "^8.1",
"symfony/config": "^6|^7",
"symfony/console": "^6|^7",
"symfony/framework-bundle": "^6|^7",
"symfony/http-foundation": "^6|^7",
"symfony/http-kernel": "^6|^7",
"symfony/lock": "^6|^7"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/error-handler": "*",
"symfony/phpunit-bridge": "*",
"symfony/var-dumper": "*",
"symfony/yaml": "*"
"symfony/yaml": "^6.4|^7"
},
"config": {
"sort-packages": true
Expand Down
Loading