Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove placeholders #92

Merged
merged 1 commit into from
Mar 5, 2024
Merged
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
11 changes: 4 additions & 7 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer;
use PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer;
use PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
use Symplify\CodingStandard\Fixer\Spacing\MethodChainingNewlineFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

Expand Down Expand Up @@ -92,13 +92,10 @@

$config->skip([
PhpUnitTestClassRequiresCoversFixer::class,
MethodChainingIndentationFixer::class => [__DIR__.'/src/DependencyInjection/Configuration.php'],
\Symplify\CodingStandard\Fixer\Spacing\MethodChainingNewlineFixer::class => [__DIR__.'/src/DependencyInjection/Configuration.php'],
MethodChainingIndentationFixer::class => [__DIR__ . '/src/DependencyInjection/Configuration.php'],
MethodChainingNewlineFixer::class => [__DIR__ . '/src/DependencyInjection/Configuration.php'],
]);

$config->parallel();
$config->paths([
__DIR__.'/src',
__DIR__.'/tests',
]);
$config->paths([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/ecs.php', __DIR__ . '/rector.php']);
};
12 changes: 11 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ parameters:
count: 1
path: src/Dto/Widget.php

-
message: "#^Attribute class JetBrains\\\\PhpStorm\\\\Deprecated does not exist\\.$#"
count: 4
path: src/Dto/Workbox.php

-
message: "#^Class SpomkyLabs\\\\PwaBundle\\\\Dto\\\\Workbox has an uninitialized property \\$enabled\\. Give it default value or assign it in the constructor\\.$#"
count: 1
Expand Down Expand Up @@ -468,4 +473,9 @@ parameters:
-
message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Normalizer\\\\UrlNormalizer\\:\\:supportsNormalization\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/Normalizer/UrlNormalizer.php
path: src/Normalizer/UrlNormalizer.php

-
message: "#^Property SpomkyLabs\\\\PwaBundle\\\\Service\\\\ServiceWorkerCompiler\\:\\:\\$jsonOptions type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Service/ServiceWorkerCompiler.php
6 changes: 2 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
]);
$config->phpVersion(PhpVersion::PHP_82);
$config->paths([__DIR__ . '/src', __DIR__ . '/tests']);
$config->skip([
__DIR__ . '/tests/Controller/DummyController.php',
]);
$config->paths([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/ecs.php', __DIR__ . '/rector.php']);
$config->skip([__DIR__ . '/tests/Controller/DummyController.php']);
$config->parallel();
$config->importNames();
$config->importShortClasses();
Expand Down
20 changes: 20 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,25 +126,45 @@ private function setupServiceWorker(ArrayNodeDefinition $node): void
->info('The public path to the local workbox. Only used if use_cdn is false.')
->end()
->scalarNode('workbox_import_placeholder')
->setDeprecated(
'spomky-labs/phpwa',
'1.1.0',
'The "%node%" option is deprecated and will be removed in 2.0.0. No replacement.'
)
->defaultValue('//WORKBOX_IMPORT_PLACEHOLDER')
->info(
'The placeholder for the workbox import. Will be replaced by the workbox import.'
)
->example('//WORKBOX_IMPORT_PLACEHOLDER')
->end()
->scalarNode('standard_rules_placeholder')
->setDeprecated(
'spomky-labs/phpwa',
'1.1.0',
'The "%node%" option is deprecated and will be removed in 2.0.0. No replacement.'
)
->defaultValue('//STANDARD_RULES_PLACEHOLDER')
->info(
'The placeholder for the standard rules. Will be replaced by caching strategies.'
)
->example('//STANDARD_RULES_PLACEHOLDER')
->end()
->scalarNode('offline_fallback_placeholder')
->setDeprecated(
'spomky-labs/phpwa',
'1.1.0',
'The "%node%" option is deprecated and will be removed in 2.0.0. No replacement.'
)
->defaultValue('//OFFLINE_FALLBACK_PLACEHOLDER')
->info('The placeholder for the offline fallback. Will be replaced by the URL.')
->example('//OFFLINE_FALLBACK_PLACEHOLDER')
->end()
->scalarNode('widgets_placeholder')
->setDeprecated(
'spomky-labs/phpwa',
'1.1.0',
'The "%node%" option is deprecated and will be removed in 2.0.0. No replacement.'
)
->defaultValue('//WIDGETS_PLACEHOLDER')
->info(
'The placeholder for the widgets. Will be replaced by the widgets management events.'
Expand Down
5 changes: 5 additions & 0 deletions src/Dto/Workbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SpomkyLabs\PwaBundle\Dto;

use JetBrains\PhpStorm\Deprecated;
use Symfony\Component\Serializer\Attribute\SerializedName;

final class Workbox
Expand All @@ -19,15 +20,19 @@ final class Workbox
public string $workboxPublicUrl;

#[SerializedName('workbox_import_placeholder')]
#[Deprecated('No longer used.')]
public string $workboxImportPlaceholder;

#[SerializedName('standard_rules_placeholder')]
#[Deprecated('No longer used.')]
public string $standardRulesPlaceholder;

#[SerializedName('offline_fallback_placeholder')]
#[Deprecated('No longer used.')]
public string $offlineFallbackPlaceholder;

#[SerializedName('widgets_placeholder')]
#[Deprecated('No longer used.')]
public string $widgetsPlaceholder;

#[SerializedName('page_fallback')]
Expand Down
11 changes: 6 additions & 5 deletions src/Resources/sw-skeleton.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// *** Workbox Bundle rules ***
//WORKBOX_IMPORT_PLACEHOLDER
//STANDARD_RULES_PLACEHOLDER
//OFFLINE_FALLBACK_PLACEHOLDER
//WIDGETS_PLACEHOLDER
// *** Service Worker *** //
/*
This is the service worker file. It will be populated with the rules you define in the
configuration file.
You can define here custom rules depending on your application needs.
*/
Loading