Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changelog
- Replaced `tightenco/collect` with `illuminate/collections`. The namespace has changed from `Tightenco\Collect\Support\*` to `Illuminate\Support\*`. (macintoshplus, [#3555](https://github.com/bolt/core/issues/3555))
- Replaced `bobdenotter/weatherwidget` with `bolt/weatherwidget`. The namespace has changed from `BobdenOtter\WeatherWidget` to `Bolt\WeatherWidget`. Your configuration should be migrated automatically, but if you weren't using the weather widget you might need to remove the newly added configuration manually. (macintoshplus and bobvandevijver, [#3587](https://github.com/bolt/core/issues/3587))
- Replaced `bobdenotter/configuration-notices` with `bolt/configuration-notices-widget`. The namespace has changed from `BobdenOtter\ConfigurationNotices` to `Bolt\ConfigurationNoticesWidget`. Your configuration should be migrated automatically, but if you weren't using the configuration notices widget you might need to remove the newly added configuration manually. (macintoshplus and bobvandevijver, [#3588](https://github.com/bolt/core/issues/3588))
- We have migrated away from annotations and fully adopted attributes. If you are relying on annotations you will need to either re-enable annotation support, or migrate them as well (the latter is the recommended approach). (bobvandevijver, [#3608](https://github.com/bolt/core/issues/3608))

## 5.2.2

Expand Down
2 changes: 1 addition & 1 deletion config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ doctrine:
mappings:
Bolt:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Entity'
prefix: 'Bolt\Entity'
alias: App
Expand Down
256 changes: 8 additions & 248 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2311,36 +2311,12 @@
'count' => 1,
'path' => __DIR__ . '/src/Entity/Field.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Field\\:\\:\\$content has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Field.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Field\\:\\:\\$name has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Field.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Field\\:\\:\\$parent has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Field.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Field\\:\\:\\$sortorder has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Field.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Field\\:\\:\\$version has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Field.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\Field\\\\CheckboxField\\:\\:setValue\\(\\) has parameter \\$value with no type specified\\.$#',
'identifier' => 'missingType.parameter',
Expand Down Expand Up @@ -2846,179 +2822,29 @@
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$content has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$context has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$createdAt has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$extra has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$level has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$levelName has no type specified\\.$#',
'identifier' => 'missingType.property',
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$context type has no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$location has no type specified\\.$#',
'identifier' => 'missingType.property',
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$extra type has no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$message has no type specified\\.$#',
'identifier' => 'missingType.property',
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$location type has no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$user has no type specified\\.$#',
'identifier' => 'missingType.property',
'message' => '#^Property Bolt\\\\Entity\\\\Log\\:\\:\\$user type has no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Log.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\Media\\:\\:getCropX\\(\\) has no return type specified\\.$#',
'identifier' => 'missingType.return',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\Media\\:\\:getCropY\\(\\) has no return type specified\\.$#',
'identifier' => 'missingType.return',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\Media\\:\\:getCropZoom\\(\\) has no return type specified\\.$#',
'identifier' => 'missingType.return',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$author \\(Bolt\\\\Entity\\\\User\\) does not accept Bolt\\\\Entity\\\\User\\|null\\.$#',
'identifier' => 'assign.propertyType',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$copyright has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$createdAt has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$cropX has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$cropY has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$cropZoom has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$description has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$filename has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$filesize has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$height has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$location has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$modifiedAt has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$originalFilename has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$path has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$title has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$type has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Media\\:\\:\\$width has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Media.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot call method getContentTypeSlug\\(\\) on Bolt\\\\Entity\\\\Content\\|null\\.$#',
'identifier' => 'method.nonObject',
Expand Down Expand Up @@ -3055,60 +2881,12 @@
'count' => 1,
'path' => __DIR__ . '/src/Entity/Relation.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\Taxonomy\\:\\:getContent\\(\\) return type with generic interface Doctrine\\\\Common\\\\Collections\\\\Collection does not specify its types\\: TKey, T$#',
'identifier' => 'missingType.generics',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\Taxonomy\\:\\:getTaxonomyTypeSingularSlug\\(\\) should return string but returns string\\|null\\.$#',
'identifier' => 'return.type',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\Taxonomy\\:\\:getTaxonomyTypeSlug\\(\\) should return string but returns string\\|null\\.$#',
'identifier' => 'return.type',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\Taxonomy\\:\\:setDefinitionFromTaxonomyTypesConfig\\(\\) has parameter \\$taxonomyTypesConfig with generic class Illuminate\\\\Support\\\\Collection but does not specify its types\\: TKey, TValue$#',
'identifier' => 'missingType.generics',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Taxonomy\\:\\:\\$content has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Taxonomy\\:\\:\\$name has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Taxonomy\\:\\:\\$slug has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Taxonomy\\:\\:\\$sortorder has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\Taxonomy\\:\\:\\$type has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/Taxonomy.php',
];
$ignoreErrors[] = [
'message' => '#^Method Bolt\\\\Entity\\\\User\\:\\:__unserialize\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
Expand Down Expand Up @@ -3157,24 +2935,6 @@
'count' => 1,
'path' => __DIR__ . '/src/Entity/User.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\UserAuthToken\\:\\:\\$user has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/UserAuthToken.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\UserAuthToken\\:\\:\\$useragent has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/UserAuthToken.php',
];
$ignoreErrors[] = [
'message' => '#^Property Bolt\\\\Entity\\\\UserAuthToken\\:\\:\\$validity has no type specified\\.$#',
'identifier' => 'missingType.property',
'count' => 1,
'path' => __DIR__ . '/src/Entity/UserAuthToken.php',
];
$ignoreErrors[] = [
'message' => '#^Argument of an invalid type array\\|null supplied for foreach, only iterables are supported\\.$#',
'identifier' => 'foreach.nonIterable',
Expand Down
9 changes: 3 additions & 6 deletions src/Cache/CachingTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Contracts\Cache\ItemInterface;
use Symfony\Contracts\Cache\TagAwareCacheInterface;
use Symfony\Contracts\Service\Attribute\Required;

trait CachingTrait
{
Expand All @@ -25,18 +26,14 @@ trait CachingTrait
/** @var Config */
private $config;

/**
* @required
*/
#[Required]
public function setCache(TagAwareCacheInterface $cache, Stopwatch $stopwatch): void
{
$this->cache = $cache;
$this->stopwatch = $stopwatch;
}

/**
* @required
*/
#[Required]
public function setConfig(Config $config): void
{
$this->config = $config;
Expand Down
8 changes: 2 additions & 6 deletions src/Controller/Backend/Async/EmbedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Exception\InvalidCsrfTokenException;

/**
* @Security("is_granted('fetch_embed_data')")
*/
#[Security("is_granted('fetch_embed_data')")]
class EmbedController implements AsyncZoneInterface
{
use CsrfTrait;
Expand All @@ -30,9 +28,7 @@ public function __construct(RequestStack $requestStack)
$this->request = $requestStack->getCurrentRequest();
}

/**
* @Route("/embed", name="bolt_async_embed", methods={"POST"})
*/
#[Route(path: '/embed', name: 'bolt_async_embed', methods: [Request::METHOD_POST])]
public function fetchEmbed(): JsonResponse
{
try {
Expand Down
4 changes: 1 addition & 3 deletions src/Controller/Backend/Async/FileListingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public function __construct(
$this->publicPath = $projectDir . DIRECTORY_SEPARATOR . $publicFolder;
}

/**
* @Route("/list_files", name="bolt_async_filelisting", methods={"GET"})
*/
#[Route(path: '/list_files', name: 'bolt_async_filelisting', methods: [Request::METHOD_GET])]
public function index(): JsonResponse
{
$locationName = $this->request->query->get('location', 'files');
Expand Down
Loading