Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Oct 14, 2022
1 parent f4a490c commit 542543b
Show file tree
Hide file tree
Showing 56 changed files with 62 additions and 37 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"doctrine/orm": "^2.8.1",
"fortawesome/font-awesome": "^6.1",
"intervention/image": "^2.5",
"michelf/php-markdown": "^1.9",
"michelf/php-markdown": "^2",
"miljar/php-exif": "^0.6.5",
"nette/utils": "^3.2",
"pagerfanta/twig": "^3.0",
Expand Down Expand Up @@ -76,7 +76,7 @@
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^9.5",
"psalm/plugin-symfony": "^3.1",
"rector/rector": "^0.13",
"rector/rector": "^0.14",
"squizlabs/php_codesniffer": "^3.5",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/maker-bundle": "^1.35",
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/command.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/component/entity-filter.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/configuration.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/contribute.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/create-extension.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/editor.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/admin-block-editor.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/admin.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/advanced-main-image.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/conversation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/facebook.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/flat.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/page-scanner.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/page-update-notifier.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/static-generator.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/svg.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/template-editor.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extension/version.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/extensions.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/installation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/license.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manage-assets.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/override-theme.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/roadmap.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/search.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/themes.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/upgrade.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/admin/src/AdminInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/**
* @template T of object
*
* @extends AdminAdminInterface<T>
*/
interface AdminInterface extends AdminAdminInterface
Expand Down
1 change: 1 addition & 0 deletions packages/admin/src/FormField/CreatedAtField.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* @template T of object
*
* @extends AbstractField<T>
*/
class CreatedAtField extends AbstractField
Expand Down
1 change: 1 addition & 0 deletions packages/admin/src/FormField/CustomPropertiesField.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* @template T of object
*
* @extends AbstractField<T>
*/
class CustomPropertiesField extends AbstractField
Expand Down
1 change: 1 addition & 0 deletions packages/admin/src/FormField/PriorityField.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* @template T of object
*
* @extends AbstractField<T>
*/
class PriorityField extends AbstractField
Expand Down
1 change: 1 addition & 0 deletions packages/admin/src/PageAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ protected function configureListFields(ListMapper $list): void

/**
* @param PageInterface $object
*
* @psalm-suppress MoreSpecificImplementedParamType
*/
public function getObjectMetadata(object $object): Metadata
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ services:
- [setPageClass, ["%pw.entity_page%"]]
- [setMediaClass, ["%pw.entity_media%"]]
tags:
- { name: sonata.admin, manager_type: orm, label: admin.label.media }
- { name: sonata.admin, manager_type: orm, label: admin.label.media, persist_filters: true }

Pushword\Admin\UserAdminInterface:
alias: pushword.admin.user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private function initResponse(Request $request): Response
$response = new Response();

if (! \in_array($request->headers->get('origin'), $this->getPossibleOrigins($request), true)) {
throw new ErrorException('origin sent is not authorized'.' ('.$request->headers->get('origin').') '.\Safe\json_encode($this->getPossibleOrigins($request)).'.');
throw new ErrorException('origin sent is not authorized ('.$request->headers->get('origin').') '.\Safe\json_encode($this->getPossibleOrigins($request)).'.');
}

$response->headers->set('Access-Control-Allow-Credentials', 'true');
Expand Down
2 changes: 1 addition & 1 deletion packages/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.8.1",
"intervention/image": "^2.5",
"michelf/php-markdown": "^1.9",
"michelf/php-markdown": "^2",
"pagerfanta/twig": "^3.0",
"piedweb/render-html-attributes": "^2.0.1",
"piedweb/url-harvester": "^0.0.31",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/Component/EntityFilter/ManagerPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* @template T of object
*
* @implements ManagerPoolInterface<T>
*/
final class ManagerPool implements ManagerPoolInterface
Expand All @@ -28,6 +29,7 @@ final class ManagerPool implements ManagerPoolInterface

/**
* @return Manager<T>
*
* @psalm-suppress InvalidArgument
*/
public function getManager(IdInterface $id): Manager
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public function setApp(PageInterface|string $host): void
/**
* @psalm-suppress NullableReturnStatement
* @psalm-suppress InvalidNullableReturnType
*
* @noRector
*/
private function getPageElse404(Request $request, ?string &$slug, string $host, bool $extractPager = false): PageInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ private function loadToParameters(array $config, string $prefix = ''): void

/**
* @param array<mixed>|bool|string|int|float|null $value The parameter value
*
* @noRector
*/
private function setParameter(string $key, $value): void
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/Entity/SharedTrait/TimestampableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ trait TimestampableTrait
{
/**
* @ORM\Column(type="datetime")
*
* @noRector
*/
protected ?DateTimeInterface $createdAt = null; // @phpstan-ignore-line

/**
* @ORM\Column(type="datetime")
*
* @noRector
*/
protected ?DateTimeInterface $updatedAt = null; // @phpstan-ignore-line
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Entity/UserTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ trait UserTrait

/**
* @var string The hashed password
*
* @ORM\Column(type="string", nullable=true)
*/
private ?string $password = null;
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Repository/MediaRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* @extends ServiceEntityRepository<MediaInterface>
*
* @implements Selectable<int, MediaInterface>
* @implements ObjectRepository<MediaInterface>
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Repository/PageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private function simpleAndWhere(QueryBuilder $queryBuilder, array $w): QueryBuil
return $queryBuilder->andWhere(
($w['key_prefix'] ?? $w[4] ?? 'p.').($w['key'] ?? $w[0])
.' '.($w['operator'] ?? $w[1])
.(($w['operator'] ?? $w[1]) === 'IN' ? '('.' :m'.$k.')' : ' :m'.$k)
.(($w['operator'] ?? $w[1]) === 'IN' ? '( :m'.$k.')' : ' :m'.$k)
)->setParameter('m'.$k, $w['value'] ?? $w[2]);
}

Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/Repository/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class Repository
{
/**
* @param class-string<PageInterface> $pageEntity
*
* @template T as PageInterface
*
* @psalm-suppress InvalidReturnStatement
* @psalm-suppress InvalidReturnType
*/
Expand All @@ -22,6 +24,7 @@ public static function getPageRepository(EntityManagerInterface|ManagerRegistry

/**
* @param class-string<MediaInterface> $mediaEntity
*
* @psalm-suppress InvalidReturnStatement
* @psalm-suppress InvalidReturnType
*/
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Repository/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @extends ServiceEntityRepository<UserInterface>
*
* @implements ObjectRepository<UserInterface>
* @implements Selectable<int, UserInterface>
*/
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Service/ImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function generateFilteredCache(MediaInterface|string $media, array|string

/**
* @psalm-suppress RedundantCondition
*
* @psam-suppress TypeDoesNotContainNull
*/
$quality = (int) (! isset($filters[$filterName]['quality']) ? 90 : $filters[$filterName]['quality']); // @phpstan-ignore-line
Expand Down
1 change: 1 addition & 0 deletions packages/flat/src/FlatFileImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private function importFile(string $filePath, string $type): void

/**
* @return AbstractImporter<T>
*
* @psalm-suppress InvalidReturnStatement
* @psalm-suppress InvalidReturnType
*/
Expand Down
1 change: 1 addition & 0 deletions packages/page-scanner/src/Scanner/PageScannerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ private function resetErrors(): void

/**
* @return mixed[]|true
*
* @noRector
*/
public function scan(PageInterface $page)
Expand Down
Binary file modified packages/skeleton/var/app.db
Binary file not shown.
1 change: 1 addition & 0 deletions packages/static-generator/src/StaticAppGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function generatePage(string $host, string $page): void
/**
* @throws \RuntimeException
* @throws \LogicException
*
* @psalm-suppress UndefinedPropertyAssignment
*/
private function generateHost(string $host): void
Expand Down
1 change: 1 addition & 0 deletions packages/version/src/VersionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function setTranslator(TranslatorInterface $translator): void

/**
* @required
*
* @psalm-suppress PossiblyInvalidArgument
* @psalm-suppress InvalidPropertyAssignmentValue
*/
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
level: max
paths:
- rector.php
- packages/core/src
- packages/conversation/src
- packages/admin/src
Expand Down
4 changes: 3 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@

$rectorConfig->paths(array_map(
function ($path) { return __DIR__.'/'.$path; },
array_values(json_decode(file_get_contents('composer.json'), true)['autoload']['psr-4'])
array_values(\Safe\json_decode(\Safe\file_get_contents('composer.json'), true)['autoload']['psr-4']) // @phpstan-ignore-line
));

//$parameters->rule(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
//$containerConfigurator->import(SetList::PHP_80);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
// SetList::CODE_QUALITY,
// SetList::DEAD_CODE,
// SetList::CODING_STYLE,
Expand Down

0 comments on commit 542543b

Please sign in to comment.