Skip to content

Commit 3594dae

Browse files
Merge pull request #577 from eliashaeussler/task/build-dir
2 parents dc142b1 + e30e412 commit 3594dae

15 files changed

Lines changed: 81 additions & 87 deletions

.gitattributes

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
* text=auto
2-
/.github export-ignore
3-
/docs export-ignore
4-
/tests export-ignore
5-
/.editorconfig export-ignore
6-
/.gitattributes export-ignore
7-
/.gitignore export-ignore
8-
/.php-cs-fixer.php export-ignore
9-
/box.json export-ignore
10-
/CODEOWNERS export-ignore
11-
/composer.lock export-ignore
12-
/composer-dependency-analyser.php export-ignore
13-
/CONTRIBUTING.md export-ignore
14-
/dependency-checker.json export-ignore
15-
/knip.json export-ignore
16-
/package.json export-ignore
17-
/package-lock.json export-ignore
18-
/phpstan.php export-ignore
19-
/phpstan-baseline.neon export-ignore
20-
/phpunit.xml export-ignore
21-
/rector.php export-ignore
22-
/renovate.json export-ignore
23-
/version-bumper.yaml export-ignore
1+
* text=auto
2+
/.github export-ignore
3+
/build export-ignore
4+
/docs export-ignore
5+
/tests export-ignore
6+
/.editorconfig export-ignore
7+
/.gitattributes export-ignore
8+
/.gitignore export-ignore
9+
/box.json export-ignore
10+
/CODEOWNERS export-ignore
11+
/composer.lock export-ignore
12+
/CONTRIBUTING.md export-ignore
13+
/package.json export-ignore
14+
/package-lock.json export-ignore
15+
/renovate.json export-ignore

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
/node_modules
55
/tests/e2e/tools
66
/vendor
7-
/.php-cs-fixer.cache
87
/Dockerfile
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use EliasHaeussler\PhpCsFixerConfig;
2525
use Symfony\Component\Finder;
2626

27+
$rootPath = dirname(__DIR__);
2728
$header = PhpCsFixerConfig\Rules\Header::create(
2829
'eliashaeussler/cache-warmup',
2930
PhpCsFixerConfig\Package\Type::ComposerPackage,
@@ -35,6 +36,7 @@
3536
return PhpCsFixerConfig\Config::create()
3637
->withRule($header)
3738
->withFinder(
38-
static fn (Finder\Finder $finder) => $finder->in(__DIR__)->name(['cache-warmup', '*.php']),
39+
static fn (Finder\Finder $finder) => $finder->in($rootPath)->name(['cache-warmup', '*.php']),
3940
)
41+
->setCacheFile($rootPath.'/.build/cache/php-cs-fixer.cache')
4042
;
File renamed without changes.
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,82 +4,82 @@ parameters:
44
rawMessage: Instanceof between EliasHaeussler\CacheWarmup\Sitemap\Sitemap and EliasHaeussler\CacheWarmup\Sitemap\Sitemap will always evaluate to true.
55
identifier: instanceof.alwaysTrue
66
count: 1
7-
path: src/CacheWarmer.php
7+
path: ../src/CacheWarmer.php
88

99
-
1010
rawMessage: 'Variable property access on $this(EliasHaeussler\CacheWarmup\Config\CacheWarmupConfig).'
1111
identifier: property.dynamicName
1212
count: 1
13-
path: src/Config/CacheWarmupConfig.php
13+
path: ../src/Config/CacheWarmupConfig.php
1414

1515
-
1616
rawMessage: 'Property EliasHaeussler\CacheWarmup\Crawler\AbstractConfigurableCrawler<TOptions of array<string, mixed>>::$options (TOptions of array<string, mixed>) does not accept array.'
1717
identifier: assign.propertyType
1818
count: 1
19-
path: src/Crawler/AbstractConfigurableCrawler.php
19+
path: ../src/Crawler/AbstractConfigurableCrawler.php
2020

2121
-
2222
rawMessage: 'Property EliasHaeussler\CacheWarmup\Formatter\JsonFormatter::$json (array{parserResult?: array{success?: array{sitemaps: list<string>, urls: list<string>}, failure?: array{sitemaps: list<string>}, excluded?: array{sitemaps: list<string>, urls: list<string>}}, cacheWarmupResult?: array{success?: list<string>, failure?: list<string>, cancelled?: bool}, messages?: array<''error''|''info''|''success''|''warning'', list<string>>, time?: array{parse?: string, crawl?: string}}) does not accept iterable<string, mixed>.'
2323
identifier: assign.propertyType
2424
count: 2
25-
path: src/Formatter/JsonFormatter.php
25+
path: ../src/Formatter/JsonFormatter.php
2626

2727
-
2828
rawMessage: 'Parameter #1 $level (''alert''|''critical''|''debug''|''emergency''|''error''|''info''|''notice''|''warning'') of method EliasHaeussler\CacheWarmup\Log\FileLogger::log() should be contravariant with parameter $level (mixed) of method Psr\Log\AbstractLogger::log()'
2929
identifier: method.childParameterType
3030
count: 1
31-
path: src/Log/FileLogger.php
31+
path: ../src/Log/FileLogger.php
3232

3333
-
3434
rawMessage: 'Parameter #1 $level (''alert''|''critical''|''debug''|''emergency''|''error''|''info''|''notice''|''warning'') of method EliasHaeussler\CacheWarmup\Log\FileLogger::log() should be contravariant with parameter $level (mixed) of method Psr\Log\LoggerInterface::log()'
3535
identifier: method.childParameterType
3636
count: 1
37-
path: src/Log/FileLogger.php
37+
path: ../src/Log/FileLogger.php
3838

3939
-
4040
rawMessage: 'Parameter #1 $level (''alert''|''critical''|''debug''|''emergency''|''error''|''info''|''notice''|''warning'') of method EliasHaeussler\CacheWarmup\Log\FileLogger::log() should be contravariant with parameter $level (mixed) of method Psr\Log\LoggerTrait::log()'
4141
identifier: method.childParameterType
4242
count: 1
43-
path: src/Log/FileLogger.php
43+
path: ../src/Log/FileLogger.php
4444

4545
-
4646
rawMessage: 'Parameter #3 $context (array<string, mixed>) of method EliasHaeussler\CacheWarmup\Log\FileLogger::log() should be contravariant with parameter $context (array<mixed>) of method Psr\Log\AbstractLogger::log()'
4747
identifier: method.childParameterType
4848
count: 1
49-
path: src/Log/FileLogger.php
49+
path: ../src/Log/FileLogger.php
5050

5151
-
5252
rawMessage: 'Parameter #3 $context (array<string, mixed>) of method EliasHaeussler\CacheWarmup\Log\FileLogger::log() should be contravariant with parameter $context (array<mixed>) of method Psr\Log\LoggerInterface::log()'
5353
identifier: method.childParameterType
5454
count: 1
55-
path: src/Log/FileLogger.php
55+
path: ../src/Log/FileLogger.php
5656

5757
-
5858
rawMessage: 'Parameter #3 $context (array<string, mixed>) of method EliasHaeussler\CacheWarmup\Log\FileLogger::log() should be contravariant with parameter $context (array<mixed>) of method Psr\Log\LoggerTrait::log()'
5959
identifier: method.childParameterType
6060
count: 1
61-
path: src/Log/FileLogger.php
61+
path: ../src/Log/FileLogger.php
6262

6363
-
6464
rawMessage: 'Parameter #1 $sitemaps of method EliasHaeussler\CacheWarmup\CacheWarmer::addSitemaps() expects EliasHaeussler\CacheWarmup\Sitemap\Sitemap|list<EliasHaeussler\CacheWarmup\Sitemap\Sitemap|string>|string, array{false} given.'
6565
identifier: argument.type
6666
count: 1
67-
path: tests/unit/CacheWarmerTest.php
67+
path: ../tests/unit/CacheWarmerTest.php
6868

6969
-
7070
rawMessage: 'Parameter #1 $limit of method EliasHaeussler\CacheWarmup\Config\CacheWarmupConfig::setLimit() expects int<0, max>, -10 given.'
7171
identifier: argument.type
7272
count: 1
73-
path: tests/unit/Config/CacheWarmupConfigTest.php
73+
path: ../tests/unit/Config/CacheWarmupConfigTest.php
7474

7575
-
7676
rawMessage: 'Parameter #1 $crawlerClass of method EliasHaeussler\CacheWarmup\Crawler\CrawlerFactory::get() expects class-string<EliasHaeussler\CacheWarmup\Crawler\Crawler>, string given.'
7777
identifier: argument.type
7878
count: 2
79-
path: tests/unit/Crawler/CrawlerFactoryTest.php
79+
path: ../tests/unit/Crawler/CrawlerFactoryTest.php
8080

8181
-
8282
rawMessage: 'Call to static method PHPUnit\Framework\Assert::assertSame() with ''foo'' and ''foo'' will always evaluate to true.'
8383
identifier: staticMethod.alreadyNarrowedType
8484
count: 1
85-
path: tests/unit/Time/TimeTrackerTest.php
85+
path: ../tests/unit/Time/TimeTrackerTest.php

phpstan.php renamed to build/phpstan.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,24 @@
2323

2424
use EliasHaeussler\PHPStanConfig;
2525

26-
$symfonySet = PHPStanConfig\Set\SymfonySet::create()
26+
$config = PHPStanConfig\Config\Config::create(dirname(__DIR__));
27+
$config->createSet(PHPStanConfig\Set\SymfonySet::class)
2728
->withConsoleApplicationLoader('tests/build/console-application.php')
2829
;
2930

30-
return PHPStanConfig\Config\Config::create(__DIR__)
31+
return $config
3132
->in(
3233
'bin/cache-warmup',
3334
'src',
3435
'tests',
3536
)
36-
->withBaseline()
37+
->withBaseline(__DIR__.'/phpstan-baseline.neon')
3738
->withBleedingEdge()
3839
->with(
3940
'vendor/cuyz/valinor/qa/PHPStan/valinor-phpstan-configuration.php',
4041
'vendor/cuyz/valinor/qa/PHPStan/valinor-phpstan-suppress-pure-errors.php',
4142
)
43+
->useCacheDir('.build/cache/phpstan')
4244
->maxLevel()
43-
->withSets($symfonySet)
4445
->toArray()
4546
;
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
cacheDirectory=".build/cache/phpunit"
3+
xsi:noNamespaceSchemaLocation="../vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="../vendor/autoload.php"
5+
cacheDirectory="../.build/cache/phpunit"
66
colors="true"
77
failOnDeprecation="true"
88
failOnNotice="true"
@@ -17,22 +17,22 @@
1717
</php>
1818
<testsuites>
1919
<testsuite name="tests">
20-
<directory>tests/unit</directory>
20+
<directory>../tests/unit</directory>
2121
</testsuite>
2222
</testsuites>
2323
<coverage>
2424
<report>
25-
<clover outputFile=".build/coverage/clover.xml"/>
26-
<html outputDirectory=".build/coverage/html"/>
25+
<clover outputFile="../.build/coverage/clover.xml"/>
26+
<html outputDirectory="../.build/coverage/html"/>
2727
<text outputFile="php://stdout" showOnlySummary="true"/>
2828
</report>
2929
</coverage>
3030
<logging>
31-
<junit outputFile=".build/coverage/junit.xml"/>
31+
<junit outputFile="../.build/coverage/junit.xml"/>
3232
</logging>
3333
<source>
3434
<include>
35-
<directory>src</directory>
35+
<directory>../src</directory>
3636
</include>
3737
</source>
3838
</phpunit>

rector.php renamed to build/rector.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@
2727
use Rector\ValueObject\PhpVersion;
2828

2929
return static function (RectorConfig $rectorConfig): void {
30+
$rootPath = dirname(__DIR__);
31+
3032
Config::create($rectorConfig, PhpVersion::PHP_82)
3133
->in(
32-
__DIR__.'/src',
33-
__DIR__.'/tests',
34+
$rootPath.'/src',
35+
$rootPath.'/tests',
3436
)
3537
->withPHPUnit()
3638
->skip(
3739
AnnotationToAttributeRector::class,
3840
[
39-
__DIR__.'/src/Formatter/JsonFormatter.php',
41+
$rootPath.'/src/Formatter/JsonFormatter.php',
4042
],
4143
)
4244
->apply()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ filesToModify:
1111
releaseOptions:
1212
commitMessage: '[RELEASE] Release of cache-warmup {%version%}'
1313
signTag: true
14+
15+
rootPath: ../

0 commit comments

Comments
 (0)