Skip to content

Commit e545b23

Browse files
committed
Get phpstand running
1 parent de680c8 commit e545b23

File tree

5 files changed

+18
-20
lines changed

5 files changed

+18
-20
lines changed

Classes/Cache/RemoteFileBackend.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function set($entryIdentifier, $data, array $tags = [], $lifetime = null)
105105
*
106106
* @api
107107
*/
108-
public function get($entryIdentifier)
108+
public function get(string $entryIdentifier): mixed
109109
{
110110
if (!$this->has($entryIdentifier)) {
111111
return false;
@@ -117,13 +117,9 @@ public function get($entryIdentifier)
117117
/**
118118
* Checks if a cache entry with the specified identifier exists.
119119
*
120-
* @param string $entryIdentifier An identifier specifying the cache entry
121-
*
122-
* @return bool TRUE if such an entry exists, FALSE if not
123-
*
124120
* @api
125121
*/
126-
public function has($entryIdentifier)
122+
public function has(string $entryIdentifier): bool
127123
{
128124
$folder = GeneralUtility::getFileAbsFileName(self::RELATIVE_STORAGE_FOLDER);
129125
$fileName = $this->getFileName($entryIdentifier);
@@ -148,7 +144,7 @@ public function has($entryIdentifier)
148144
*
149145
* @api
150146
*/
151-
public function remove($entryIdentifier)
147+
public function remove(string $entryIdentifier): bool
152148
{
153149
$folder = GeneralUtility::getFileAbsFileName(self::RELATIVE_STORAGE_FOLDER);
154150
$fileName = $this->getFileName($entryIdentifier);
@@ -228,7 +224,7 @@ public function flushByTag($tag): void
228224
*
229225
* @api
230226
*/
231-
public function findIdentifiersByTag($tag)
227+
public function findIdentifiersByTag(string $tag): array
232228
{
233229
$tagsFiles = glob(GeneralUtility::getFileAbsFileName(self::RELATIVE_STORAGE_FOLDER) . '*/*/*' . self::FILE_EXTENSION_TAG);
234230
$identifiers = [];
@@ -276,4 +272,9 @@ protected function getFileName(string $entryIdentifier): string
276272

277273
return $remoteStructure . '/' . $baseName;
278274
}
275+
276+
public function flushByTags(array $tags): void
277+
{
278+
// @todo check
279+
}
279280
}

Classes/Cache/StaticDatabaseBackend.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ public function setCache(FrontendInterface $cache): void
4848
}
4949

5050
/**
51-
* Change the template to allow longer idenitifiers.
52-
*
53-
* @return string
51+
* Change the template to allow longer identifiers.
5452
*/
55-
public function getTableDefinitions()
53+
public function getTableDefinitions(): string
5654
{
5755
$large = $this->configuration->isBool('largeIdentifierInCacheTable') ? 'Large' : '';
5856

Classes/Cache/StaticFileBackend.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function set($entryIdentifier, $data, array $tags = [], $lifetime = null)
111111
*
112112
* @return mixed The cache entry's content as a string or FALSE if the cache entry could not be loaded
113113
*/
114-
public function get($entryIdentifier)
114+
public function get(string $entryIdentifier): mixed
115115
{
116116
if (!$this->has($entryIdentifier)) {
117117
return false;
@@ -131,7 +131,7 @@ public function get($entryIdentifier)
131131
*
132132
* @return bool TRUE if such an entry exists, FALSE if not
133133
*/
134-
public function has($entryIdentifier)
134+
public function has(string $entryIdentifier): bool
135135
{
136136
return is_file($this->getFilepath($entryIdentifier)) || parent::has($entryIdentifier);
137137
}
@@ -145,7 +145,7 @@ public function has($entryIdentifier)
145145
*
146146
* @return bool TRUE if (at least) an entry could be removed or FALSE if no entry was found
147147
*/
148-
public function remove($entryIdentifier)
148+
public function remove(string $entryIdentifier): bool
149149
{
150150
if (!$this->has($entryIdentifier)) {
151151
return false;

Classes/Cache/UriFrontend.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@ class UriFrontend extends VariableFrontend
1616
{
1717
/**
1818
* Check if the identifier is a valid URI incl. host and path.
19-
*
20-
* @param string $identifier
21-
*
22-
* @return bool
2319
*/
24-
public function isValidEntryIdentifier($identifier)
20+
public function isValidEntryIdentifier(string $identifier): bool
2521
{
2622
try {
2723
$identifierBuilder = GeneralUtility::makeInstance(IdentifierBuilder::class);

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ includes:
44
parameters:
55
level: 5
66
reportUnmatchedIgnoredErrors: false
7+
paths:
8+
- Classes
9+
- Tests

0 commit comments

Comments
 (0)