diff --git a/.github/workflows/new-php-style.yml b/.github/workflows/new-php-style.yml index 09df476..669902c 100644 --- a/.github/workflows/new-php-style.yml +++ b/.github/workflows/new-php-style.yml @@ -1,7 +1,13 @@ -name: PHP Style +name: "PHP-CS-Fixer" on: - push: + push: + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" + +permissions: + contents: write jobs: php-style: @@ -9,4 +15,4 @@ jobs: with: head_ref: ${{ github.ref_name }} secrets: - PHP_CS_FIXER_GITHUB_TOKEN: ${{ secrets.PHP_CS_FIXER_GITHUB_TOKEN }} \ No newline at end of file + PHP_CS_FIXER_GITHUB_TOKEN: ${{ secrets.PHP_CS_FIXER_GITHUB_TOKEN }} diff --git a/.php_cs.dist b/.php-cs-fixer.dist similarity index 57% rename from .php_cs.dist rename to .php-cs-fixer.dist index fd1e5dd..77a97a1 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist @@ -6,43 +6,38 @@ $finder = PhpCsFixer\Finder::create() // do not fix views ->notName('*.html.php'); -return PhpCsFixer\Config::create() - ->setRules([ +$config = new PhpCsFixer\Config(); +$config->setRules([ '@PSR1' => true, '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], 'header_comment' => [ - 'commentType' => 'PHPDoc', - 'header' => 'Pimcore' . PHP_EOL . PHP_EOL . - 'This source file is available under two different licenses:' . PHP_EOL . - '- GNU General Public License version 3 (GPLv3)' . PHP_EOL . - '- Pimcore Commercial License (PCL)' . PHP_EOL . - 'Full copyright and license information is available in' . PHP_EOL . - 'LICENSE.md which is distributed with this source code.' . PHP_EOL . - PHP_EOL . - ' @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)' . PHP_EOL . - ' @license http://www.pimcore.org/license GPLv3 and PCL' - ], + 'comment_type' => 'PHPDoc', + 'header' => + 'This source file is available under the terms of the' . PHP_EOL . + 'Pimcore Open Core License (POCL)' . PHP_EOL . + 'Full copyright and license information is available in' . PHP_EOL . + 'LICENSE.md which is distributed with this source code.' . PHP_EOL . + PHP_EOL . + ' @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)' . PHP_EOL . + ' @license Pimcore Open Core License (POCL)' + ], - // keep aligned = and => operators as they are: do not force aligning, but do not remove it - 'binary_operator_spaces' => ['align_double_arrow' => null, 'align_equals' => null], - - 'blank_line_before_return' => true, + 'blank_line_before_statement' => true, 'encoding' => true, 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, + 'single_line_comment_style' => true, 'lowercase_cast' => true, 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => false], - 'method_separation' => true, + 'method_argument_space' => ['on_multiline' => 'ignore'], 'native_function_casing' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, 'no_empty_comment' => true, 'no_empty_phpdoc' => true, 'no_empty_statement' => true, - 'no_extra_consecutive_blank_lines' => true, + 'no_extra_blank_lines' => true, 'no_leading_import_slash' => true, 'no_leading_namespace_whitespace' => true, 'no_short_bool_cast' => true, @@ -67,5 +62,7 @@ return PhpCsFixer\Config::create() 'standardize_not_equals' => true, 'ternary_operator_spaces' => true, 'whitespace_after_comma_in_array' => true, - ]) - ->setFinder($finder); +]); + +$config->setFinder($finder); +return $config; diff --git a/composer.json b/composer.json index fea9d5e..c441785 100644 --- a/composer.json +++ b/composer.json @@ -12,9 +12,12 @@ } }, "require": { - "pimcore/pimcore": "^11.0 || ^12.0" + "pimcore/pimcore": "^2026.1" }, "extra": { + "branch-alias": { + "dev-2026.x": "2026.1.x-dev" + }, "pimcore": { "bundles": [ "Pimcore\\Bundle\\BundleGeneratorBundle\\PimcoreBundleGeneratorBundle" diff --git a/src/Generator/BundleGenerator.php b/src/Generator/BundleGenerator.php index 5dfedbd..4b61b13 100644 --- a/src/Generator/BundleGenerator.php +++ b/src/Generator/BundleGenerator.php @@ -53,11 +53,5 @@ public function generateBundle(Bundle $bundle) $dir.'/config/pimcore/'.$routingFilename, $parameters ); } - - $this->renderFile( - 'js/pimcore/startup.js.twig', - $dir . '/public/js/pimcore/startup.js', - $parameters - ); } } diff --git a/src/Resources/skeleton/bundle/Bundle.php.twig b/src/Resources/skeleton/bundle/Bundle.php.twig index 1ace2ac..bef3631 100644 --- a/src/Resources/skeleton/bundle/Bundle.php.twig +++ b/src/Resources/skeleton/bundle/Bundle.php.twig @@ -2,27 +2,12 @@ {% block use_statements %} use Pimcore\Extension\Bundle\AbstractPimcoreBundle; -use Pimcore\Extension\Bundle\PimcoreBundleAdminClassicInterface; -use Pimcore\Extension\Bundle\Traits\BundleAdminClassicTrait; {% endblock use_statements %} {% block class_definition %} -class {{ bundle }} extends AbstractPimcoreBundle implements PimcoreBundleAdminClassicInterface +class {{ bundle }} extends AbstractPimcoreBundle {% endblock class_definition %} {% block class_body %} - use BundleAdminClassicTrait; - - public function getPath(): string - { - return \dirname(__DIR__); - } - - public function getJsPaths(): array - { - return [ - '/bundles/{{ bundle_basename|lower }}/js/pimcore/startup.js' - ]; - } {% endblock class_body %} diff --git a/src/Resources/skeleton/js/pimcore/startup.js.twig b/src/Resources/skeleton/js/pimcore/startup.js.twig deleted file mode 100644 index e52399e..0000000 --- a/src/Resources/skeleton/js/pimcore/startup.js.twig +++ /dev/null @@ -1,14 +0,0 @@ -pimcore.registerNS("pimcore.plugin.{{ bundle }}"); - -pimcore.plugin.{{ bundle }} = Class.create({ - - initialize: function () { - document.addEventListener(pimcore.events.pimcoreReady, this.pimcoreReady.bind(this)); - }, - - pimcoreReady: function (e) { - // alert("{{ bundle }} ready!"); - } -}); - -var {{ bundle }}Plugin = new pimcore.plugin.{{ bundle }}();