Skip to content

Commit

Permalink
updated php-cs-config
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Jan 13, 2025
1 parent 4304691 commit 1d27a89
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 48 deletions.
6 changes: 4 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
'modernize_types_casting' => true,
'nullable_type_declaration_for_default_null_value' => true,
'single_quote' => true,
'php_unit_test_case_static_method_calls' => true,
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'array_destructuring', 'arrays']],
])
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
);
->ignoreVCS(true),
);
2 changes: 1 addition & 1 deletion tests/unit/Copy/AbstractCopyPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ public function setUp(): void
*/
public function testGetFileSystem(): void
{
$this->assertInstanceOf(Filesystem::class, $this->subject->getFileSystem());
static::assertInstanceOf(Filesystem::class, $this->subject->getFileSystem());
}
}
18 changes: 9 additions & 9 deletions tests/unit/Copy/Plugins/ChartJsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function setUp(): void
*/
public function testGetUnpkgName(): void
{
$this->assertSame('chart.js', $this->subject->getUnpkgName());
static::assertSame('chart.js', $this->subject->getUnpkgName());
}

/**
Expand All @@ -45,9 +45,9 @@ public function testGetUnpkgName(): void
public function testGetUnpkgVersion(): void
{
try {
$this->assertIsString($this->subject->getUnpkgVersion());
static::assertIsString($this->subject->getUnpkgVersion());
} catch (OutOfBoundsException $exception) {
$this->assertSame('Package "nnnick/chartjs" is not installed', $exception->getMessage());
static::assertSame('Package "nnnick/chartjs" is not installed', $exception->getMessage());
}
}

Expand All @@ -56,7 +56,7 @@ public function testGetUnpkgVersion(): void
*/
public function testGetUnpkgSource(): void
{
$this->assertSame('dist', $this->subject->getUnpkgSource());
static::assertSame('dist', $this->subject->getUnpkgSource());
}


Expand All @@ -71,38 +71,38 @@ public function testGetUnpkgFiles(): void
2 => 'helpers.js',
3 => 'helpers.js.map',
];
$this->assertSame($result, $this->subject->getUnpkgFiles());
static::assertSame($result, $this->subject->getUnpkgFiles());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\ChartJs::getComposerName()
*/
public function testGetComposerName(): void
{
$this->assertSame('nnnick/chartjs', $this->subject->getComposerName());
static::assertSame('nnnick/chartjs', $this->subject->getComposerName());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\ChartJs::getComposerSource()
*/
public function testGetComposerSource(): void
{
$this->assertSame('dist', $this->subject->getComposerSource());
static::assertSame('dist', $this->subject->getComposerSource());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\ChartJs::getComposerFiles()
*/
public function testGetComposerFiles(): void
{
$this->assertSame(['*.js', '*.map'], $this->subject->getComposerFiles());
static::assertSame(['*.js', '*.map'], $this->subject->getComposerFiles());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\ChartJs::getCopyTarget()
*/
public function testGetCopyTarget(): void
{
$this->assertSame('js/lib/chartjs', $this->subject->getCopyTarget());
static::assertSame('js/lib/chartjs', $this->subject->getCopyTarget());
}
}
12 changes: 6 additions & 6 deletions tests/unit/Copy/Plugins/FlatpickrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function setUp(): void
*/
public function testGetUnpkgName(): void
{
$this->assertSame('flatpickr', $this->subject->getUnpkgName());
static::assertSame('flatpickr', $this->subject->getUnpkgName());
}

/**
Expand All @@ -44,9 +44,9 @@ public function testGetUnpkgName(): void
public function testGetUnpkgVersion(): void
{
try {
$this->assertIsString($this->subject->getUnpkgVersion());
static::assertIsString($this->subject->getUnpkgVersion());
} catch (OutOfBoundsException $exception) {
$this->assertSame('Package "nnnick/chartjs" is not installed', $exception->getMessage());
static::assertSame('Package "nnnick/chartjs" is not installed', $exception->getMessage());
}
}

Expand All @@ -55,7 +55,7 @@ public function testGetUnpkgVersion(): void
*/
public function testGetUnpkgSource(): void
{
$this->assertSame('dist', $this->subject->getUnpkgSource());
static::assertSame('dist', $this->subject->getUnpkgSource());
}

/**
Expand All @@ -67,14 +67,14 @@ public function testGetUnpkgFiles(): void
0 => 'flatpickr.min.css',
1 => 'flatpickr.min.js',
];
$this->assertSame($result, $this->subject->getUnpkgFiles());
static::assertSame($result, $this->subject->getUnpkgFiles());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\Flatpickr::getCopyTarget()
*/
public function testGetCopyTarget(): void
{
$this->assertSame('js/lib/flatpickr', $this->subject->getCopyTarget());
static::assertSame('js/lib/flatpickr', $this->subject->getCopyTarget());
}
}
8 changes: 4 additions & 4 deletions tests/unit/Copy/Plugins/FlowJsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@ public function setUp(): void
*/
public function testGetComposerName(): void
{
$this->assertSame('flowjs/flowjs', $this->subject->getComposerName());
static::assertSame('flowjs/flowjs', $this->subject->getComposerName());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\FlowJs::getComposerSource()
*/
public function testGetComposerSource(): void
{
$this->assertSame('dist', $this->subject->getComposerSource());
static::assertSame('dist', $this->subject->getComposerSource());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\FlowJs::getComposerFiles()
*/
public function testGetComposerFiles(): void
{
$this->assertSame(['*.js'], $this->subject->getComposerFiles());
static::assertSame(['*.js'], $this->subject->getComposerFiles());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\FlowJs::getCopyTarget()
*/
public function testGetCopyTarget(): void
{
$this->assertSame('js/lib/uploader', $this->subject->getCopyTarget());
static::assertSame('js/lib/uploader', $this->subject->getCopyTarget());
}
}
8 changes: 4 additions & 4 deletions tests/unit/Copy/Plugins/JQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@ public function setUp(): void
*/
public function testGetComposerName(): void
{
$this->assertSame('components/jquery', $this->subject->getComposerName());
static::assertSame('components/jquery', $this->subject->getComposerName());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\JQuery::getComposerSource()
*/
public function testGetComposerSource(): void
{
$this->assertSame('', $this->subject->getComposerSource());
static::assertSame('', $this->subject->getComposerSource());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\JQuery::getComposerFiles()
*/
public function testGetComposerFiles(): void
{
$this->assertSame(['*.js', '*.map'], $this->subject->getComposerFiles());
static::assertSame(['*.js', '*.map'], $this->subject->getComposerFiles());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\JQuery::getCopyTarget()
*/
public function testGetCopyTarget(): void
{
$this->assertSame('js/lib/jquery', $this->subject->getCopyTarget());
static::assertSame('js/lib/jquery', $this->subject->getCopyTarget());
}
}
10 changes: 5 additions & 5 deletions tests/unit/Copy/Plugins/TinyMceLanguagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function setUp(): void
*/
public function testGetComposerName(): void
{
$this->assertSame('mklkj/tinymce-i18n', $this->subject->getComposerName());
static::assertSame('mklkj/tinymce-i18n', $this->subject->getComposerName());
}

/**
Expand All @@ -44,9 +44,9 @@ public function testGetComposerName(): void
public function testGetComposerSource(): void
{
try {
$this->assertSame('langs7', $this->subject->getComposerSource());
static::assertSame('langs7', $this->subject->getComposerSource());
} catch (OutOfBoundsException $exception) {
$this->assertSame('Package "tinymce/tinymce" is not installed', $exception->getMessage());
static::assertSame('Package "tinymce/tinymce" is not installed', $exception->getMessage());
}
}

Expand All @@ -55,14 +55,14 @@ public function testGetComposerSource(): void
*/
public function testGetComposerFiles(): void
{
$this->assertSame(['*.css', '*.js'], $this->subject->getComposerFiles());
static::assertSame(['*.css', '*.js'], $this->subject->getComposerFiles());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\TinyMceLanguages::getCopyTarget()
*/
public function testGetCopyTarget(): void
{
$this->assertSame('js/lib/tinymce/langs', $this->subject->getCopyTarget());
static::assertSame('js/lib/tinymce/langs', $this->subject->getCopyTarget());
}
}
8 changes: 4 additions & 4 deletions tests/unit/Copy/Plugins/TinyMceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@ public function setUp(): void
*/
public function testGetComposerName(): void
{
$this->assertSame('tinymce/tinymce', $this->subject->getComposerName());
static::assertSame('tinymce/tinymce', $this->subject->getComposerName());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\TinyMce::getComposerSource()
*/
public function testGetComposerSource(): void
{
$this->assertSame('', $this->subject->getComposerSource());
static::assertSame('', $this->subject->getComposerSource());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\TinyMce::getComposerFiles()
*/
public function testGetComposerFiles(): void
{
$this->assertSame(['*.css', '*.js'], $this->subject->getComposerFiles());
static::assertSame(['*.css', '*.js'], $this->subject->getComposerFiles());
}

/**
* @covers \OpenMage\ComposerPlugin\Copy\Plugins\TinyMce::getCopyTarget()
*/
public function testGetCopyTarget(): void
{
$this->assertSame('js/lib/tinymce', $this->subject->getCopyTarget());
static::assertSame('js/lib/tinymce', $this->subject->getCopyTarget());
}
}
12 changes: 6 additions & 6 deletions tests/unit/Copy/Unpkg/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function setUp(): void
*/
public function testGetValidatedConfig(?array $expectedResult, $packageConfig): void
{
$this->assertSame($expectedResult, $this->subject->getValidatedConfig($packageConfig));
static::assertSame($expectedResult, $this->subject->getValidatedConfig($packageConfig));
}

public function provideGetValidatedConfig(): Generator
Expand Down Expand Up @@ -152,7 +152,7 @@ public function testUnpkgName(): void
{
$source = '';
$this->subject->setUnpkgName($source);
$this->assertSame($source, $this->subject->getUnpkgName());
static::assertSame($source, $this->subject->getUnpkgName());
}

/**
Expand All @@ -163,7 +163,7 @@ public function testUnpkgVersion(): void
{
$source = '';
$this->subject->setUnpkgVersion($source);
$this->assertSame($source, $this->subject->getUnpkgVersion());
static::assertSame($source, $this->subject->getUnpkgVersion());
}

/**
Expand All @@ -174,7 +174,7 @@ public function testUnpkgSource(): void
{
$source = '';
$this->subject->setUnpkgSource($source);
$this->assertSame($source, $this->subject->getUnpkgSource());
static::assertSame($source, $this->subject->getUnpkgSource());
}

/**
Expand All @@ -185,7 +185,7 @@ public function testCopyTarget(): void
{
$target = '';
$this->subject->setCopyTarget($target);
$this->assertSame($target, $this->subject->getCopyTarget());
static::assertSame($target, $this->subject->getCopyTarget());
}

/**
Expand All @@ -196,6 +196,6 @@ public function testUnpkgFiles(): void
{
$files = [];
$this->subject->setUnpkgFiles($files);
$this->assertSame($files, $this->subject->getUnpkgFiles());
static::assertSame($files, $this->subject->getUnpkgFiles());
}
}
10 changes: 5 additions & 5 deletions tests/unit/Copy/Unpkg/GenericTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function setUp(): void
*/
public function testGetUnpkgName(): void
{
$this->assertSame('name', $this->subject->getUnpkgName());
static::assertSame('name', $this->subject->getUnpkgName());
}

/**
Expand All @@ -66,7 +66,7 @@ public function testGetUnpkgName(): void
*/
public function testGetUnpkgVersion(): void
{
$this->assertSame('version', $this->subject->getUnpkgVersion());
static::assertSame('version', $this->subject->getUnpkgVersion());
}

/**
Expand All @@ -81,7 +81,7 @@ public function testGetUnpkgVersion(): void
*/
public function testGetUnpkgSource(): void
{
$this->assertSame('source', $this->subject->getUnpkgSource());
static::assertSame('source', $this->subject->getUnpkgSource());
}

/**
Expand All @@ -96,7 +96,7 @@ public function testGetUnpkgSource(): void
*/
public function testGetUnpkgFiles(): void
{
$this->assertSame([], $this->subject->getUnpkgFiles());
static::assertSame([], $this->subject->getUnpkgFiles());
}

/**
Expand All @@ -111,6 +111,6 @@ public function testGetUnpkgFiles(): void
*/
public function testGetCopyTarget(): void
{
$this->assertSame('target', $this->subject->getCopyTarget());
static::assertSame('target', $this->subject->getCopyTarget());
}
}
Loading

0 comments on commit 1d27a89

Please sign in to comment.