Skip to content

Commit

Permalink
refactor: support in Pimcore 10 and 11 in bundle class
Browse files Browse the repository at this point in the history
  • Loading branch information
lukadschaak committed Oct 13, 2023
1 parent fe33520 commit 452a3b1
Showing 1 changed file with 76 additions and 32 deletions.
108 changes: 76 additions & 32 deletions src/NeustaPimcorePresentationBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,91 @@

use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
use Pimcore\Extension\Bundle\Installer\InstallerInterface;
use Pimcore\Extension\Bundle\PimcoreBundleAdminClassicInterface;
use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
use Pimcore\Version;

class NeustaPimcorePresentationBundle extends AbstractPimcoreBundle implements PimcoreBundleAdminClassicInterface
{
use PackageVersionTrait;

public function getPath(): string
if (!method_exists(Version::class, 'getMajorVersion') || 10 === Version::getMajorVersion()) {
class NeustaPimcorePresentationBundle extends AbstractPimcoreBundle
{
return \dirname(__DIR__);
}
use PackageVersionTrait;

public function getInstaller(): ?InstallerInterface
{
return new Installer();
}
public function getPath(): string
{
return \dirname(__DIR__);
}

protected function getComposerPackageName(): string
{
return 'teamneusta/pimcore-presentation-bundle';
}
public function getInstaller(): ?InstallerInterface
{
return new Installer();
}

public function getJsPaths(): array
{
return [];
}
protected function getComposerPackageName(): string
{
return 'teamneusta/pimcore-presentation-bundle';
}

public function getCssPaths(): array
{
return [
'/bundles/presentation/js/pimcore/startup.js',
];
}
public function getJsPaths(): array

Check failure on line 30 in src/NeustaPimcorePresentationBundle.php

View workflow job for this annotation

GitHub Actions / Quality Checks

Method Neusta\Pimcore\PresentationBundle\NeustaPimcorePresentationBundle::getJsPaths() return type has no value type specified in iterable type array.
{
return [];
}

public function getEditmodeJsPaths(): array
{
return [];
}
public function getCssPaths(): array

Check failure on line 35 in src/NeustaPimcorePresentationBundle.php

View workflow job for this annotation

GitHub Actions / Quality Checks

Method Neusta\Pimcore\PresentationBundle\NeustaPimcorePresentationBundle::getCssPaths() return type has no value type specified in iterable type array.
{
return [
'/bundles/presentation/js/pimcore/startup.js',
];
}

public function getEditmodeJsPaths(): array

Check failure on line 42 in src/NeustaPimcorePresentationBundle.php

View workflow job for this annotation

GitHub Actions / Quality Checks

Method Neusta\Pimcore\PresentationBundle\NeustaPimcorePresentationBundle::getEditmodeJsPaths() return type has no value type specified in iterable type array.
{
return [];
}

public function getEditmodeCssPaths(): array
public function getEditmodeCssPaths(): array

Check failure on line 47 in src/NeustaPimcorePresentationBundle.php

View workflow job for this annotation

GitHub Actions / Quality Checks

Method Neusta\Pimcore\PresentationBundle\NeustaPimcorePresentationBundle::getEditmodeCssPaths() return type has no value type specified in iterable type array.
{
return [];
}
}
} else {
class NeustaPimcorePresentationBundle extends AbstractPimcoreBundle implements \Pimcore\Extension\Bundle\PimcoreBundleAdminClassicInterface
{
return [];
use PackageVersionTrait;

public function getPath(): string
{
return \dirname(__DIR__);
}

public function getInstaller(): ?InstallerInterface
{
return new Installer();
}

protected function getComposerPackageName(): string
{
return 'teamneusta/pimcore-presentation-bundle';
}

public function getJsPaths(): array
{
return [];
}

public function getCssPaths(): array
{
return [
'/bundles/presentation/js/pimcore/startup.js',
];
}

public function getEditmodeJsPaths(): array
{
return [];
}

public function getEditmodeCssPaths(): array
{
return [];
}
}
}

0 comments on commit 452a3b1

Please sign in to comment.