Skip to content

Commit

Permalink
Merge pull request #15 from adriansuter/drop-php-7
Browse files Browse the repository at this point in the history
Drop support for php 7.
  • Loading branch information
adriansuter committed Jan 18, 2023
2 parents 8c42f05 + 60fda04 commit 942c710
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.3, 7.4, 8.0, 8.1, 8.2]
php: [8.0, 8.1, 8.2]
experimental: [false]
include:
- php: 8.1
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Adrian Suter
Copyright (c) 2023 Adrian Suter

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
}
],
"require": {
"php": "^7.3 || ^8",
"twig/twig": ">=2.11 || ^3"
"php": "^8",
"twig/twig": "^3.5"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"phpunit/phpunit": "^9.5",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^0.12.80 || ^1.0.0",
"squizlabs/php_codesniffer": "^3.5"
"phpstan/phpstan": "^1.9",
"squizlabs/php_codesniffer": "^3.7"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="true"
Expand Down
2 changes: 1 addition & 1 deletion src/CacheBusters/DictionaryCacheBuster.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DictionaryCacheBuster implements CacheBusterInterface
/**
* @var DictionaryInterface
*/
private $dictionary;
protected DictionaryInterface $dictionary;

/**
* @param DictionaryInterface $dictionary
Expand Down
4 changes: 2 additions & 2 deletions src/CacheBusters/FileNameCacheBuster.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class FileNameCacheBuster implements CacheBusterInterface
/**
* @var string
*/
private $endPointDirectory;
protected string $endPointDirectory;

/**
* @var HashGeneratorInterface
*/
private $hashGenerator;
protected HashGeneratorInterface $hashGenerator;

/**
* @param string $endPointDirectory
Expand Down
8 changes: 4 additions & 4 deletions src/CacheBusters/QueryParamCacheBuster.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class QueryParamCacheBuster implements CacheBusterInterface
/**
* @var string
*/
private $endPointDirectory;
protected string $endPointDirectory;

/**
* @var HashGeneratorInterface
*/
private $hashGenerator;
protected HashGeneratorInterface $hashGenerator;

/**
* @param string $endPointDirectory
Expand All @@ -41,13 +41,13 @@ public function __construct(
*/
public function bust(string $path): string
{
$filePath = $this->endPointDirectory.'/'.$path;
$filePath = $this->endPointDirectory . '/' . $path;

$bustPath = $path;

$hash = $this->hashGenerator->generate($filePath);
if ($hash !== null) {
$bustPath .= '?h='.urlencode($hash);
$bustPath .= '?h=' . urlencode($hash);
}

return $bustPath;
Expand Down
10 changes: 5 additions & 5 deletions src/CacheBustingTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ class CacheBustingTokenParser extends AbstractTokenParser
/**
* @var CacheBusterInterface
*/
private $cacheBuster;
protected CacheBusterInterface $cacheBuster;

/**
* @var string
*/
private $basePath;
protected string $basePath;

/**
* @var string
*/
private $twigTag;
protected string $twigTag;

/**
* @param CacheBusterInterface $cacheBuster
Expand Down Expand Up @@ -64,12 +64,12 @@ private function buildPath(string $path): string
if ($this->basePath === '') {
$basePath = '';
} elseif ($this->basePath[0] !== '/') {
$basePath = '/'.$this->basePath;
$basePath = '/' . $this->basePath;
} else {
$basePath = $this->basePath;
}

return $basePath.'/'.$this->cacheBuster->bust($path);
return $basePath . '/' . $this->cacheBuster->bust($path);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/CacheBustingTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CacheBustingTwigExtension extends AbstractExtension
/**
* @var CacheBustingTokenParser
*/
private $tokenParser;
protected CacheBustingTokenParser $tokenParser;

/**
* Create a Cache Busting Twig Extension.
Expand Down Expand Up @@ -43,9 +43,9 @@ public function __construct(CacheBustingTokenParser $tokenParser)
}

/**
* @return array|TokenParserInterface[]
* @return TokenParserInterface[]
*/
public function getTokenParsers()
public function getTokenParsers(): array
{
return [
$this->tokenParser,
Expand Down
3 changes: 1 addition & 2 deletions src/Dictionaries/ArrayDictionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ArrayDictionary implements DictionaryInterface
/**
* @var array<string>
*/
private $data;
protected array $data;

/**
* @param array<string> $data
Expand All @@ -21,7 +21,6 @@ public function __construct(array $data = [])
$this->data = $data;
}


/**
* @inheritDoc
*/
Expand Down

0 comments on commit 942c710

Please sign in to comment.