File tree Expand file tree Collapse file tree 13 files changed +418
-301
lines changed
Expand file tree Collapse file tree 13 files changed +418
-301
lines changed Original file line number Diff line number Diff line change 1414 strategy :
1515 fail-fast : true
1616 matrix :
17- php-versions : ['8.1']
17+ php-versions : ['8.1', '8.2' ]
1818
1919 steps :
2020 - uses : actions/checkout@v2
Original file line number Diff line number Diff line change 1515 ],
1616 'yoda_style ' => false ,
1717 'phpdoc_no_empty_return ' => false ,
18- 'no_superfluous_phpdoc_tags ' => false ,
18+ 'no_superfluous_phpdoc_tags ' => true ,
1919 'single_line_throw ' => false ,
2020 'array_indentation ' => true ,
2121 'declare_strict_types ' => true ,
Original file line number Diff line number Diff line change 88 "php" : " >=8.1"
99 },
1010 "require-dev" : {
11- "phpunit/phpunit" : " ^9 .0" ,
11+ "phpunit/phpunit" : " ^10 .0" ,
1212 "friendsofphp/php-cs-fixer" : " ^3.0" ,
13- "sebastian/phpcpd" : " ^6.0" ,
1413 "vimeo/psalm" : " ^5.0" ,
15- "infection/infection" : " ^0.26.13 "
14+ "infection/infection" : " ^0.27 "
1615 },
1716 "autoload" : {
1817 "psr-4" : {
3635 ],
3736 "linter" : [
3837 " vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -vv --allow-risky=yes --dry-run --stop-on-violation" ,
39- " vendor/bin/phpcpd ./ --exclude vendor --exclude tests" ,
4038 " vendor/bin/psalm --show-info=true --php-version=$(php -r \" echo phpversion();\" )"
4139 ],
4240 "infection" : [
Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ RUN set -xe && apk update && apk add --no-cache \
1212 git \
1313 autoconf \
1414 g++ \
15- make
15+ make \
16+ linux-headers
1617
1718
18- RUN docker-php-ext-install zip soap \
19+ RUN docker-php-ext-install zip opcache \
1920 && docker-php-source extract \
2021 && pecl install xdebug \
2122 && docker-php-ext-enable xdebug \
@@ -24,7 +25,7 @@ RUN docker-php-ext-install zip soap \
2425 && echo 'xdebug.mode=coverage' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
2526
2627
27- RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.4.2 \
28+ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.5.8 \
2829 && mkdir -p /.composer && chmod -Rf 777 /.composer
2930
3031
Original file line number Diff line number Diff line change 1717 " Marvin255\\ FileSystemHelper\\ FileSystemHelperImpl::rename" ,
1818 " Marvin255\\ FileSystemHelper\\ FileSystemHelperImpl::runPhpFunction"
1919 ]
20- },
21- "LogicalOr" : {
22- "ignore" : [
23- " Marvin255\\ FileSystemHelper\\ FileSystemHelperImpl::getTmpDir"
24- ]
25- },
26- "TrueValue" : {
27- "ignore" : [
28- " Marvin255\\ FileSystemHelper\\ FileSystemHelperImpl::mkdir"
29- ]
30- },
31- "ArrayItemRemoval" : {
32- "ignore" : [
33- " Marvin255\\ FileSystemHelper\\ Helper\\ PathHelper::fixDirectorySeparatorAndTrim"
34- ]
3520 }
3621 }
3722}
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" colors =" true" bootstrap =" ./vendor/autoload.php" executionOrder =" random" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd" >
3- <coverage >
4- <include >
5- <directory >./src</directory >
6- </include >
7- </coverage >
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" colors =" true" bootstrap =" ./vendor/autoload.php" executionOrder =" random" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.3/phpunit.xsd" >
3+ <coverage />
84 <testsuites >
95 <testsuite name =" File system helper tests suite" >
106 <directory >./tests</directory >
117 </testsuite >
128 </testsuites >
9+ <source >
10+ <include >
11+ <directory >./src</directory >
12+ </include >
13+ </source >
1314</phpunit >
Original file line number Diff line number Diff line change 66
77/**
88 * Exception class for errors in file helper.
9+ *
10+ * @psalm-api
911 */
1012final class FileSystemException extends \Exception
1113{
@@ -17,10 +19,7 @@ private function __construct(string $message = '')
1719 /**
1820 * Creates FileSystemException.
1921 *
20- * @param string $message
2122 * @param array<int, \SplFileInfo|string> $params
22- *
23- * @return FileSystemException
2423 */
2524 public static function create (string $ message , ...$ params ): FileSystemException
2625 {
Original file line number Diff line number Diff line change 66
77/**
88 * Factory object for file system helper.
9+ *
10+ * @psalm-api
911 */
1012final class FileSystemFactory
1113{
@@ -15,12 +17,8 @@ private function __construct()
1517
1618 /**
1719 * Creates new FileSystemHelperInterface instance with default settings.
18- *
19- * @param string|null $baseFolder
20- *
21- * @return FileSystemHelper
2220 */
23- public static function create (? string $ baseFolder = null ): FileSystemHelper
21+ public static function create (string $ baseFolder = null ): FileSystemHelper
2422 {
2523 return new FileSystemHelperImpl ($ baseFolder );
2624 }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ final class FileSystemHelperImpl implements FileSystemHelper
1616{
1717 private readonly ?string $ baseFolder ;
1818
19- public function __construct (? string $ baseFolder = null )
19+ public function __construct (string $ baseFolder = null )
2020 {
2121 $ validatedBaseFolder = null ;
2222
@@ -342,7 +342,6 @@ private function makeFileInfoAndCheckBasePath(\SplFileInfo|string $data): \SplFi
342342 /**
343343 * Runs set php function in try/catch.
344344 *
345- * @param string $functionName
346345 * @param mixed[] $params
347346 *
348347 * @throws FileSystemException
Original file line number Diff line number Diff line change 66
77/**
88 * Set of functions for working with file paths.
9+ *
10+ * @internal
911 */
1012final class PathHelper
1113{
@@ -64,8 +66,7 @@ public static function unifyPath(string $path): string
6466 }
6567 }
6668
67- return ($ hasLeadingSlash ? \DIRECTORY_SEPARATOR : '' )
68- . implode (\DIRECTORY_SEPARATOR , $ absolutes );
69+ return ($ hasLeadingSlash ? \DIRECTORY_SEPARATOR : '' ) . implode (\DIRECTORY_SEPARATOR , $ absolutes );
6970 }
7071
7172 /**
You can’t perform that action at this time.
0 commit comments