mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-17 19:36:33 +02:00
Modified visibility of several functions and properties
This commit is contained in:
@@ -25,7 +25,7 @@ class BootManager
|
||||
}
|
||||
|
||||
/** Determine if container compilation should be enabled. */
|
||||
protected static function containerCompilationEnabled(): bool
|
||||
private static function containerCompilationEnabled(): bool
|
||||
{
|
||||
if (filter_var(getenv('APP_DEBUG'), FILTER_VALIDATE_BOOL)) {
|
||||
return false;
|
||||
|
@@ -47,7 +47,7 @@ class DirectoryController
|
||||
}
|
||||
|
||||
/** Return the README file within a finder object. */
|
||||
protected function readme(Finder $files): ?SplFileInfo
|
||||
private function readme(Finder $files): ?SplFileInfo
|
||||
{
|
||||
if (! $this->config->get('display_readmes')) {
|
||||
return null;
|
||||
|
@@ -49,7 +49,7 @@ class FileInfoController
|
||||
*
|
||||
* @return array{md5: string, sha1: string, sha256: string}
|
||||
*/
|
||||
protected function calculateHashes(SplFileInfo $file): array
|
||||
private function calculateHashes(SplFileInfo $file): array
|
||||
{
|
||||
return [
|
||||
'md5' => (string) hash_file('md5', (string) $file->getRealPath()),
|
||||
|
@@ -68,7 +68,7 @@ class ZipController
|
||||
*
|
||||
* @throws \ZipStream\Exception
|
||||
*/
|
||||
protected function createZip(string $path, Finder $files): ZipStream
|
||||
private function createZip(string $path, Finder $files): ZipStream
|
||||
{
|
||||
$compressionMethod = $this->config->get('zip_compress') ? CompressionMethod::DEFLATE : CompressionMethod::STORE;
|
||||
|
||||
@@ -98,7 +98,7 @@ class ZipController
|
||||
}
|
||||
|
||||
/** Return the path to a file with the preceding root path stripped. */
|
||||
protected function stripPath(SplFileInfo $file, string $path): string
|
||||
private function stripPath(SplFileInfo $file, string $path): string
|
||||
{
|
||||
$pattern = sprintf('/^%s%s?/', preg_quote($path, '/'), preg_quote(DIRECTORY_SEPARATOR, '/'));
|
||||
|
||||
@@ -106,7 +106,7 @@ class ZipController
|
||||
}
|
||||
|
||||
/** Generate the file name for a path. */
|
||||
protected function generateFileName(string $path): string
|
||||
private function generateFileName(string $path): string
|
||||
{
|
||||
$filename = (string) Str::explode($path, DIRECTORY_SEPARATOR)->last();
|
||||
|
||||
|
@@ -55,7 +55,7 @@ class FinderFactory
|
||||
}
|
||||
|
||||
/** Determine if a file should be hidden. */
|
||||
protected function isHidden(SplFileInfo $file): bool
|
||||
private function isHidden(SplFileInfo $file): bool
|
||||
{
|
||||
if (! $this->pattern instanceof Pattern) {
|
||||
$this->pattern = Pattern::make(sprintf('%s{%s}', Pattern::escape(
|
||||
|
@@ -46,7 +46,7 @@ class TranslationFactory
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
protected function translations(): array
|
||||
private function translations(): array
|
||||
{
|
||||
return $this->cache->get('translations', fn (): array => array_values(array_map(
|
||||
static fn (SplFileInfo $file): string => $file->getBasename('.yaml'),
|
||||
|
@@ -15,7 +15,7 @@ use Tests\TestCase;
|
||||
class MiddlewareManagerTest extends TestCase
|
||||
{
|
||||
/** @const Array of application middlewares */
|
||||
protected const MIDDLEWARES = [
|
||||
private const MIDDLEWARES = [
|
||||
Middlewares\WhoopsMiddleware::class,
|
||||
Middlewares\PruneCacheMiddleware::class,
|
||||
Middlewares\CacheControlMiddleware::class,
|
||||
|
@@ -18,14 +18,13 @@ use Tests\TestCase;
|
||||
#[CoversClass(IndexController::class)]
|
||||
class IndexControllerTest extends TestCase
|
||||
{
|
||||
/** @var Request&MockObject */
|
||||
protected $request;
|
||||
|
||||
/** @var Response&MockObject */
|
||||
protected $response;
|
||||
|
||||
/** @var Container&MockObject */
|
||||
protected $container;
|
||||
/** @var Request&MockObject */
|
||||
private $request;
|
||||
|
||||
/** @var Response&MockObject */
|
||||
private $response;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
|
@@ -156,7 +156,7 @@ class FinderFactoryTest extends TestCase
|
||||
))();
|
||||
}
|
||||
|
||||
protected function getFilesArray(Finder $finder): array
|
||||
private function getFilesArray(Finder $finder): array
|
||||
{
|
||||
$files = array_map(
|
||||
static fn (SplFileInfo $file): string => $file->getFilename(),
|
||||
|
@@ -17,13 +17,13 @@ use Tests\TestCase;
|
||||
class RegisterGlobalsMiddlewareTest extends TestCase
|
||||
{
|
||||
/** @var Twig Twig templating component */
|
||||
protected $view;
|
||||
private $view;
|
||||
|
||||
/** @var ServerRequestInterface&MockObject */
|
||||
protected $request;
|
||||
private $request;
|
||||
|
||||
/** @var RequestHandlerInterface&MockObject */
|
||||
protected $handler;
|
||||
private $handler;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@@ -15,7 +15,7 @@ use Tests\TestCase;
|
||||
class TranslateTest extends TestCase
|
||||
{
|
||||
/** @var Translator Translator component */
|
||||
protected $translator;
|
||||
private $translator;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
|
Reference in New Issue
Block a user