Skip to content

Commit

Permalink
All Sf 6
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Dec 1, 2021
1 parent 54fe28d commit 10b14ca
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 66 deletions.
44 changes: 22 additions & 22 deletions composer.json
Expand Up @@ -15,7 +15,7 @@
"license": "MIT",
"require": {
"php": ">=7.4",
"babdev/pagerfanta-bundle": "^3.0",
"babdev/pagerfanta-bundle": "^3.6",
"caseyamcl/toc": "^3.0",
"cocur/slugify": "^3.0|^4.0",
"doctrine/annotations": "^1.11",
Expand All @@ -41,26 +41,26 @@
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
"spatie/image-optimizer": "^1.3",
"spatie/yaml-front-matter": "^2.0",
"symfony/asset": "^5.3",
"symfony/cache": "^5.3",
"symfony/console": "^5.3",
"symfony/expression-language": "^5.3",
"symfony/finder": "^5.3",
"symfony/form": "^5.3",
"symfony/framework-bundle": "^5.3",
"symfony/lock": "^5.3",
"symfony/mailer": "^5.3",
"symfony/process": "^5.3",
"symfony/security-bundle": "^5.3",
"symfony/security-csrf": "^5.3",
"symfony/security-guard": "^5.3",
"symfony/serializer": "^5.3",
"symfony/translation": "^5.3",
"symfony/twig-bundle": "^5.3",
"symfony/validator": "^5.3",
"symfony/web-link": "^5.3",
"symfony/asset": "^5.4 || ^6.0",
"symfony/cache": "^5.4 || ^6.0",
"symfony/console": "^5.4 || ^6.0",
"symfony/expression-language": "^5.4 || ^6.0",
"symfony/finder": "^5.4 || ^6.0",
"symfony/form": "^5.4 || ^6.0",
"symfony/framework-bundle": "^5.4 || ^6.0",
"symfony/lock": "^5.4 || ^6.0",
"symfony/mailer": "^5.4 || ^6.0",
"symfony/process": "^5.4 || ^6.0",
"symfony/security-bundle": "^5.4 || ^6.0",
"symfony/security-csrf": "^5.4 || ^6.0",
"symfony/security-guard": "^5.4 || ^6.0",
"symfony/serializer": "^5.4 || ^6.0",
"symfony/translation": "^5.4 || ^6.0",
"symfony/twig-bundle": "^5.4 || ^6.0",
"symfony/validator": "^5.4 || ^6.0",
"symfony/web-link": "^5.4 || ^6.0",
"symfony/webpack-encore-bundle": "^1.8",
"symfony/yaml": "^5.3",
"symfony/yaml": "^5.4 || ^6.0",
"thecodingmachine/safe": "^1.3",
"twig/intl-extra": "^3.2",
"vich/uploader-bundle": "^1.16",
Expand All @@ -76,10 +76,10 @@
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^9.5",
"psalm/plugin-symfony": "^3.0",
"rector/rector": "^0.12.1",
"rector/rector": "^0.12",
"squizlabs/php_codesniffer": "^3.5",
"symfony/debug": "^4.4",
"symfony/dotenv": "^5.3",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/maker-bundle": "^1.35",
"symfony/panther": "^1.0",
"symfony/phpunit-bridge": "^5.0",
Expand Down
Expand Up @@ -40,10 +40,10 @@ public function setMainContent(PersistenceEvent $persistenceEvent): void
return;
}

$requestUniqId = \strval($persistenceEvent->getAdmin()->getRequest()->get('uniqid'));
$returnValues = $persistenceEvent->getAdmin()->getRequest()->get($requestUniqId);
$requestUniqId = \strval($persistenceEvent->getAdmin()->getRequest()->query->get('uniqid'));
$returnValues = $persistenceEvent->getAdmin()->getRequest()->request->all($requestUniqId);

if (\is_array($returnValues) && isset($returnValues['mainContent'])) {
if (isset($returnValues['mainContent']) && \is_string($returnValues['mainContent'])) {
// sanitize with https://github.com/editor-js/editorjs-php
$persistenceEvent->getAdmin()->getSubject()->setMainContent($returnValues['mainContent']);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/PageCRUDController.php
Expand Up @@ -39,7 +39,7 @@ public function setParams(ParameterBagInterface $parameterBag): void

public function listAction(Request $request): Response
{
if (($listMode = $request->get('_list_mode')) !== null) {
if (($listMode = $request->request->get('_list_mode')) !== null) {
$this->admin->setListMode(\strval($listMode));
}

Expand Down
Expand Up @@ -65,8 +65,8 @@ public function setAdvancedMainImage(PersistenceEvent $persistenceEvent): void
return;
}

$returnValues = $persistenceEvent->getAdmin()->getRequest()
->get($persistenceEvent->getAdmin()->getRequest()->get('uniqid')); // @phpstan-ignore-line
$returnValues = $persistenceEvent->getAdmin()->getRequest()->request
->all($persistenceEvent->getAdmin()->getRequest()->query->get('uniqid'));

$persistenceEvent->getAdmin()->getSubject()->setCustomProperty(
'mainImageFormat',
Expand Down
4 changes: 2 additions & 2 deletions packages/conversation/src/Form/FormTrait.php
Expand Up @@ -273,12 +273,12 @@ protected function getId(): int

protected function getReferring(): ?string
{
return \strval($this->request->get('referring'));
return \strval($this->request->request->get('referring'));
}

protected function getType(): ?string
{
return \strval($this->request->get('type'));
return \strval($this->request->request->get('type'));
}

/**
Expand Down
40 changes: 20 additions & 20 deletions packages/core/composer.json
Expand Up @@ -9,7 +9,7 @@
"php": ">=7.4",
"caseyamcl/toc": "^3.0",
"cocur/slugify": "^3.0|^4.0",
"babdev/pagerfanta-bundle": "^3.0",
"babdev/pagerfanta-bundle": "^3.6",
"doctrine/annotations": "^1.11",
"doctrine/doctrine-bundle": "^2.2.2",
"doctrine/doctrine-fixtures-bundle": "^3.4",
Expand All @@ -24,25 +24,25 @@
"thecodingmachine/safe": "^1.3",
"sensio/framework-extra-bundle": "^5.6",
"spatie/image-optimizer": "^1.3",
"symfony/asset": "^5.3",
"symfony/cache": "^5.3",
"symfony/console": "^5.3",
"symfony/expression-language": "^5.3",
"symfony/finder": "^5.3",
"symfony/form": "^5.3",
"symfony/framework-bundle": "^5.3",
"symfony/lock": "^5.3",
"symfony/mailer": "^5.3",
"symfony/process": "^5.3",
"symfony/security-bundle": "^5.3",
"symfony/security-csrf": "^5.3",
"symfony/security-guard": "^5.3",
"symfony/translation": "^5.3",
"symfony/twig-bundle": "^5.3",
"symfony/validator": "^5.3",
"symfony/web-link": "^5.3",
"symfony/asset": "^5.3 || ^6.0",
"symfony/cache": "^5.3 || ^6.0",
"symfony/console": "^5.3 || ^6.0",
"symfony/expression-language": "^5.3 || ^6.0",
"symfony/finder": "^5.3 || ^6.0",
"symfony/form": "^5.3 || ^6.0",
"symfony/framework-bundle": "^5.3 || ^6.0",
"symfony/lock": "^5.3 || ^6.0",
"symfony/mailer": "^5.3 || ^6.0",
"symfony/process": "^5.3 || ^6.0",
"symfony/security-bundle": "^5.3 || ^6.0",
"symfony/security-csrf": "^5.3 || ^6.0",
"symfony/security-guard": "^5.3 || ^6.0",
"symfony/translation": "^5.3 || ^6.0",
"symfony/twig-bundle": "^5.3 || ^6.0",
"symfony/validator": "^5.3 || ^6.0",
"symfony/web-link": "^5.3 || ^6.0",
"symfony/webpack-encore-bundle": "^1.8",
"symfony/yaml": "^5.3",
"symfony/yaml": "^5.3 || ^6.0",
"twig/intl-extra": "^3.2",
"vich/uploader-bundle": "^1.16",
"villfa/invert-color": "^0.5",
Expand All @@ -55,7 +55,7 @@
"squizlabs/php_codesniffer": "^3.5",
"symfony/phpunit-bridge": "^5.0",
"vimeo/psalm": "^4.3",
"symfony/dotenv": "^5.3",
"symfony/dotenv": "^5.3 || ^6.0",
"symfony/maker-bundle": "^1.35",
"symfony/profiler-pack": "^1.0",
"symplify/monorepo-builder": "^9.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Entity/MediaTrait.php
Expand Up @@ -255,7 +255,7 @@ public function setMedia(?string $media): self

public function getName(bool $onlyName = false): string
{
if (true === $onlyName) {
if ($onlyName) {
return $this->name;
}

Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/Security/LoginFormAuthenticator.php
Expand Up @@ -13,7 +13,6 @@
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
use Symfony\Component\Security\Http\Util\TargetPathTrait;

class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
Expand All @@ -32,7 +31,7 @@ public function __construct(UrlGeneratorInterface $urlGenerator)
$this->urlGenerator = $urlGenerator;
}

public function authenticate(Request $request): PassportInterface
public function authenticate(Request $request): Passport
{
$email = (string) $request->request->get('email', '');

Expand All @@ -42,7 +41,7 @@ public function authenticate(Request $request): PassportInterface
new UserBadge($email),
new PasswordCredentials((string) $request->request->get('password', '')),
[
new CsrfTokenBadge('authenticate', \strval($request->get('_csrf_token'))),
new CsrfTokenBadge('authenticate', \strval($request->request->get('_csrf_token'))),
]
);
}
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/Twig/PageListTwigTrait.php
Expand Up @@ -48,15 +48,15 @@ private function getCurrentRequest(): ?Request
private function getPagerRouteParams(): array
{
$params = [];
if (null !== $this->getCurrentRequest() && \is_string($this->getCurrentRequest()->get('slug'))) {
$params['slug'] = rtrim($this->getCurrentRequest()->get('slug'), '/');
if (null !== $this->getCurrentRequest() && \is_string($slug = $this->getCurrentRequest()->attributes->get('slug'))) {
$params['slug'] = rtrim($slug, '/');
} elseif (null !== $this->apps->getCurrentPage()) {
// normally, only used in admin
$params['slug'] = $this->apps->getCurrentPage()->getSlug();
$params['host'] = $this->apps->getCurrentPage()->getHost();
}

if (null !== ($request = $this->getCurrentRequest()) && null !== ($host = $request->get('host'))) {
if (null !== ($currentRequest = $this->getCurrentRequest()) && null !== ($host = $currentRequest->request->get('host'))) {
$params['host'] = \strval($host);
}

Expand All @@ -65,8 +65,8 @@ private function getPagerRouteParams(): array

private function getPagerRouteName(): string
{
$pagerRouter = null !== $this->getCurrentRequest() ? $this->getCurrentRequest()->get('_route') : 'pushword_page';
$pagerRouter .= null !== $this->getCurrentRequest() && '' === $this->getCurrentRequest()->get('slug') ? '_homepage' : '';
$pagerRouter = null !== $this->getCurrentRequest() ? $this->getCurrentRequest()->attributes->get('_route') : 'pushword_page';
$pagerRouter .= null !== $this->getCurrentRequest() && '' === $this->getCurrentRequest()->attributes->get('slug') ? '_homepage' : '';
$pagerRouter .= '_pager';

return $pagerRouter;
Expand Down
Expand Up @@ -16,6 +16,9 @@ public function __construct(\Pushword\Core\Controller\PageController $pageContro
$this->pageController = $pageController;
}

/**
* @param mixed $value
*/
public function validate($value, Constraint $constraint): void
{
if (! $constraint instanceof PageRendering) {
Expand Down
1 change: 0 additions & 1 deletion packages/docs/content/roadmap.md
Expand Up @@ -7,7 +7,6 @@ parent: contribute

## BugFix && To finish

- [Core] Bug : setName is erased by media file name
- Move to PHP configuration (rector ?!)
- When simplify 10 will be stable, add phpstan-twig-rules
- // TODO check a new blank installation
Expand Down
8 changes: 4 additions & 4 deletions packages/new/composer.json
Expand Up @@ -12,11 +12,11 @@
"symfony/flex": "^1.3.1"
},
"flex-require": {
"symfony/console": "^5.3",
"symfony/dotenv": "^5.3",
"symfony/framework-bundle": "^5.3",
"symfony/console": "^5.3 || ^6.0",
"symfony/dotenv": "^5.3 || ^6.0",
"symfony/framework-bundle": "^5.3 || ^6.0",
"symfony/runtime": "*",
"symfony/yaml": "^5.3",
"symfony/yaml": "^5.3 || ^6.0",
"pushword/core": "*"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions packages/skeleton/src/Kernel.php
Expand Up @@ -32,12 +32,12 @@ public function getProjectDir(): string
return \dirname(__DIR__);
}

public function getCacheDir()
public function getCacheDir(): string
{
return sys_get_temp_dir().'/com.github.pushword.pushword/tests/var/'.$this->environment.'/cache';
}

public function getLogDir()
public function getLogDir(): string
{
return sys_get_temp_dir().'/com.github.pushword.pushword/tests/var/'.$this->environment.'/log';
}
Expand Down
Binary file modified packages/skeleton/var/app.db
Binary file not shown.

0 comments on commit 10b14ca

Please sign in to comment.