Skip to content

Commit d3f25dd

Browse files
committed
Chore: Changes
- CS fixes; - Removed UndefinedBuildException class as unused;
1 parent 69638ab commit d3f25dd

13 files changed

+135
-33
lines changed

.php-cs-fixer.dist.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
if (!file_exists(__DIR__.'/src')) {
4+
exit(0);
5+
}
6+
7+
$finder = (new PhpCsFixer\Finder())
8+
->in(__DIR__.'/src')
9+
->in(__DIR__.'/tests')
10+
;
11+
12+
return (new PhpCsFixer\Config())
13+
->setRules(array(
14+
'@Symfony' => true,
15+
'@Symfony:risky' => true,
16+
'protected_to_private' => false,
17+
'semicolon_after_instruction' => false,
18+
'header_comment' => [
19+
'header' => <<<EOF
20+
This file is part of the WebpackEncore plugin for Micro Framework.
21+
(c) Oleksii Bulba <[email protected]>
22+
For the full copyright and license information, please view the LICENSE
23+
file that was distributed with this source code.
24+
EOF
25+
]
26+
))
27+
->setRiskyAllowed(true)
28+
->setFinder($finder);

src/Asset/EntrypointLookup.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the WebpackEncore plugin for Micro Framework.
7+
* (c) Oleksii Bulba <[email protected]>
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Boo\WebpackEncorePlugin\Asset;
613

714
use Boo\WebpackEncorePlugin\Exception\EntrypointNotFoundException;
@@ -18,15 +25,15 @@ public function __construct(private readonly WebpackEncorePluginConfigurationInt
1825
}
1926

2027
/**
21-
* @inheritDoc
28+
* {@inheritDoc}
2229
*/
2330
public function getJavaScriptFiles(string $entryName): array
2431
{
2532
return $this->getEntryFiles($entryName, 'js');
2633
}
2734

2835
/**
29-
* @inheritDoc
36+
* {@inheritDoc}
3037
*/
3138
public function getCssFiles(string $entryName): array
3239
{

src/Asset/EntrypointLookupInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the WebpackEncore plugin for Micro Framework.
7+
* (c) Oleksii Bulba <[email protected]>
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Boo\WebpackEncorePlugin\Asset;
613

714
use Boo\WebpackEncorePlugin\Exception\EntrypointNotFoundException;

src/Exception/EntrypointNotFoundException.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the WebpackEncore plugin for Micro Framework.
7+
* (c) Oleksii Bulba <[email protected]>
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Boo\WebpackEncorePlugin\Exception;
613

714
class EntrypointNotFoundException extends \InvalidArgumentException

src/Exception/UndefinedBuildException.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/TagRenderer/TagRenderer.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the WebpackEncore plugin for Micro Framework.
7+
* (c) Oleksii Bulba <[email protected]>
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Boo\WebpackEncorePlugin\TagRenderer;
613

714
use Boo\WebpackEncorePlugin\Asset\EntrypointLookupInterface;
@@ -11,7 +18,7 @@ class TagRenderer implements TagRendererInterface
1118
private array $renderedFiles = [];
1219
private array $defaultAttributes = [];
1320
private array $defaultScriptAttributes = [
14-
'type' => 'application/javascript'
21+
'type' => 'application/javascript',
1522
];
1623
private array $defaultLinkAttributes = [];
1724

@@ -29,7 +36,7 @@ public function renderWebpackScriptTags(string $entryName, array $extraAttribute
2936
$attributes = array_merge($attributes, $this->defaultAttributes, $this->defaultScriptAttributes, $extraAttributes);
3037

3138
$scriptTags[] = sprintf(
32-
'<script %s></script>',
39+
/* @lang text */ '<script %s></script>',
3340
$this->convertArrayToAttributes($attributes)
3441
);
3542

@@ -50,7 +57,7 @@ public function renderWebpackLinkTags(string $entryName, array $extraAttributes
5057
$attributes = array_merge($attributes, $this->defaultAttributes, $this->defaultLinkAttributes, $extraAttributes);
5158

5259
$scriptTags[] = sprintf(
53-
'<link %s>',
60+
/* @lang text */ '<link %s>',
5461
$this->convertArrayToAttributes($attributes)
5562
);
5663

src/TagRenderer/TagRendererInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the WebpackEncore plugin for Micro Framework.
7+
* (c) Oleksii Bulba <[email protected]>
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Boo\WebpackEncorePlugin\TagRenderer;
613

714
interface TagRendererInterface

src/Twig/Extension/EntryFilesTwigExtension.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the WebpackEncore plugin for Micro Framework.
7+
* (c) Oleksii Bulba <[email protected]>
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Boo\WebpackEncorePlugin\Twig\Extension;
613

714
use Boo\WebpackEncorePlugin\Asset\EntrypointLookupInterface;

src/WebpackEncorePlugin.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,28 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the WebpackEncore plugin for Micro Framework.
7+
* (c) Oleksii Bulba <[email protected]>
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Boo\WebpackEncorePlugin;
613

7-
use Micro\Framework\Kernel\Plugin\ConfigurableInterface;
8-
use Micro\Framework\Kernel\Plugin\PluginConfigurationTrait;
9-
use Micro\Plugin\Twig\Plugin\TwigExtensionPluginInterface;
1014
use Boo\WebpackEncorePlugin\Asset\EntrypointLookup;
1115
use Boo\WebpackEncorePlugin\Asset\EntrypointLookupInterface;
1216
use Boo\WebpackEncorePlugin\TagRenderer\TagRenderer;
1317
use Boo\WebpackEncorePlugin\TagRenderer\TagRendererInterface;
1418
use Boo\WebpackEncorePlugin\Twig\Extension\EntryFilesTwigExtension;
19+
use Micro\Framework\Kernel\Plugin\ConfigurableInterface;
20+
use Micro\Framework\Kernel\Plugin\PluginConfigurationTrait;
21+
use Micro\Plugin\Twig\Plugin\TwigExtensionPluginInterface;
1522
use Twig\Extension\ExtensionInterface;
1623

1724
/**
1825
* @method WebpackEncorePluginConfigurationInterface configuration()
26+
*
1927
* @codeCoverageIgnore
2028
*/
2129
class WebpackEncorePlugin implements TwigExtensionPluginInterface, ConfigurableInterface

src/WebpackEncorePluginConfiguration.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the WebpackEncore plugin for Micro Framework.
7+
* (c) Oleksii Bulba <[email protected]>
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Boo\WebpackEncorePlugin;
613

714
use Micro\Framework\Kernel\Configuration\PluginConfiguration;
@@ -11,12 +18,12 @@
1118
*/
1219
class WebpackEncorePluginConfiguration extends PluginConfiguration implements WebpackEncorePluginConfigurationInterface
1320
{
14-
const CFG_OUTPUT_PATH = 'WEBPACK_ENCORE_OUTPUT_PATH';
21+
public const CFG_OUTPUT_PATH = 'WEBPACK_ENCORE_OUTPUT_PATH';
1522

1623
public function getOutputPath(): string
1724
{
1825
return $this->configuration->get(self::CFG_OUTPUT_PATH,
19-
$this->configuration->get('BASE_PATH') . '/public/build'
26+
$this->configuration->get('BASE_PATH').'/public/build'
2027
);
2128
}
2229
}

0 commit comments

Comments
 (0)