Skip to content

Commit

Permalink
allow installation with symfony 6
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Feb 17, 2024
1 parent 83ca1b0 commit f7e1fd6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@
],
"require": {
"php": "^7.4 || ^8.0",
"symfony/framework-bundle": "^4.4 || ^5.0",
"symfony/security-core": "^4.4 || ^5.0"
"symfony/framework-bundle": "^5.4 || ^6.4",
"symfony/security-core": "^5.4 || ^6.4"
},
"require-dev": {
"jackalope/jackalope-doctrine-dbal": "^1.3",
"symfony/security-bundle": "^4.4 || ^5.0",
"symfony/phpunit-bridge": "^4.4.34 || ^5.0",
"jackalope/jackalope-doctrine-dbal": "^1.3 || ^2.0",
"symfony/security-bundle": "^5.4 || ^6.4",
"symfony/phpunit-bridge": "^7.0",
"mockery/mockery": "^1.4.1",
"symfony-cmf/routing-bundle": "^2.1.0",
"symfony-cmf/testing": "^4.0.0",
"doctrine/dbal": "^2.5",
"doctrine/dbal": "^3.8.1 || ^4.0",
"doctrine/doctrine-bundle": "^2.0",
"doctrine/phpcr-odm": "^1.4|^2.0 ",
"doctrine/phpcr-bundle": "^2.3.0",
"symfony/browser-kit": "^4.4 || ^5.0",
"symfony/form": "^4.4 || ^5.0",
"symfony/monolog-bridge": "^4.4 || ^5.0",
"symfony/browser-kit": "^5.4 || ^6.4",
"symfony/form": "^5.4 || ^6.4",
"symfony/monolog-bridge": "^5.4 || ^6.4",
"symfony/monolog-bundle": "^3.0",
"symfony/templating": "^4.4 || ^5.0",
"symfony/translation": "^4.4 || ^5.0",
"symfony/twig-bundle": "^4.4 || ^5.0",
"symfony/validator": "^4.4 || ^5.0",
"symfony/yaml": "^4.4 || ^5.0",
"symfony/asset": "^4.4 || ^5.0"
"symfony/templating": "^5.4 || ^6.4",
"symfony/translation": "^5.4 || ^6.4",
"symfony/twig-bundle": "^5.4 || ^6.4",
"symfony/validator": "^5.4 || ^6.4",
"symfony/yaml": "^5.4 || ^6.4",
"symfony/asset": "^5.4 || ^6.4"
},
"suggest": {
"symfony/twig-bundle": "To get access to the CMF twig extension (^4.4 || ^5.0)",
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Phpcr/NonTranslatableMetadataListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function getSubscribedEvents()
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
{
/** @var $meta ClassMetadata */
/** @var ClassMetadata $meta */
$meta = $eventArgs->getClassMetadata();

if (!$meta->translator) {
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Phpcr/TranslatableMetadataListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getSubscribedEvents()
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
{
/** @var $meta ClassMetadata */
/** @var ClassMetadata $meta */
$meta = $eventArgs->getClassMetadata();

if ($meta->getReflectionClass()->implementsInterface(TranslatableInterface::class)) {
Expand Down
28 changes: 16 additions & 12 deletions src/Templating/Helper/Cmf.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private function getDocument($document, ?bool $ignoreRole = false, ?string $clas
try {
$document = $this->getDm()->find(null, $document);
} catch (MissingTranslationException $e) {
return;
return null;
}
}

Expand All @@ -193,7 +193,7 @@ private function getDocument($document, ?bool $ignoreRole = false, ?string $clas
|| (true === $ignoreRole && !$this->publishWorkflowChecker->isGranted(PublishWorkflowChecker::VIEW_ANONYMOUS_ATTRIBUTE, $document))
|| (null !== $class && !($document instanceof $class))
) {
return;
return null;
}

return $document;
Expand Down Expand Up @@ -239,7 +239,7 @@ public function findMany(array $paths = [], $limit = false, $offset = false, ?bo
* If you need the bypass role, you will have a firewall configured and can
* simply use {{ is_granted('VIEW', document) }}
*
* @param object $document
* @param ?object $document
*/
public function isPublished($document): bool
{
Expand Down Expand Up @@ -492,7 +492,7 @@ private function checkChildren(array $childNames, string $path, ?bool $ignoreRol
}
}

return;
return null;
}

/**
Expand Down Expand Up @@ -522,7 +522,7 @@ private function traversePrevDepth(?int $depth, int $anchorDepth, array $childNa
}
}

return;
return null;
}

/**
Expand All @@ -543,7 +543,7 @@ private function searchDepthPrev($path, $anchor, ?int $depth = null, ?bool $igno
}

if (null === $path || '/' === $path) {
return;
return null;
}

$node = $this->getDm()->getPhpcrSession()->getNode($path);
Expand All @@ -557,7 +557,7 @@ private function searchDepthPrev($path, $anchor, ?int $depth = null, ?bool $igno
}

if ($path === $anchor) {
return;
return null;
}

$parent = $node->getParent();
Expand Down Expand Up @@ -599,7 +599,7 @@ private function searchDepthPrev($path, $anchor, ?int $depth = null, ?bool $igno
}
}

return;
return null;
}

/**
Expand All @@ -620,7 +620,7 @@ private function searchDepthNext($path, $anchor, ?int $depth = null, ?bool $igno
}

if (null === $path || '/' === $path) {
return;
return null;
}

$node = $this->getDm()->getPhpcrSession()->getNode($path);
Expand Down Expand Up @@ -660,7 +660,7 @@ private function searchDepthNext($path, $anchor, ?int $depth = null, ?bool $igno
while ('/' !== $parentPath) {
$parent = $parent->getParent();
if (false === strpos($parent->getPath(), $anchor)) {
return;
return null;
}

$childNames = $parent->getNodeNames()->getArrayCopy();
Expand All @@ -673,7 +673,7 @@ private function searchDepthNext($path, $anchor, ?int $depth = null, ?bool $igno
}
}

return;
return null;
}

/**
Expand All @@ -693,7 +693,7 @@ private function search($path, ?bool $reverse = false, ?bool $ignoreRole = false
}

if (null === $path || '/' === $path) {
return;
return null;
}

$node = $this->getDm()->getPhpcrSession()->getNode($path);
Expand Down Expand Up @@ -777,6 +777,8 @@ public function getPrevLinkable($current, $anchor = null, ?int $depth = null, ?b

$current = $candidate;
}

return null;
}

/**
Expand Down Expand Up @@ -807,5 +809,7 @@ public function getNextLinkable($current, $anchor = null, ?int $depth = null, ?b

$current = $candidate;
}

return null;
}
}

0 comments on commit f7e1fd6

Please sign in to comment.