Skip to content

Commit

Permalink
chore: compatibility with Symfony 5 and 6 (#44)
Browse files Browse the repository at this point in the history
chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6

chore: migration symfony 6



chore: migration symfony 6



chore: migration symfony 6

Co-authored-by: Kévin Dunglas <[email protected]>
  • Loading branch information
pauljosephkrogulec and dunglas authored Nov 21, 2023
1 parent 426a271 commit 790bb02
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 75 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ jobs:
strategy:
matrix:
symfony-version:
- "3.4.*"
- "4.0.*"
- "4.4.*"
- "5.4.*"
- "6.3.*"
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.1.*"
- "8.2.*"
dependencies:
- "lowest"
- "highest"


steps:
- name: "checkout"
uses: "actions/checkout@v2"
Expand Down
5 changes: 3 additions & 2 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
->append([__FILE__])
;

return PhpCsFixer\Config::create()
->setUsingCache(true)
$config = new PhpCsFixer\Config();

return $config->setUsingCache(true)
->setRules([
'@DoctrineAnnotation' => true,
'@PSR2' => true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sonata Media CKEditor Integration

The bundle provides [SonataMediaBundle](https://sonata-project.org/bundles/media/master/doc/index.html) integration into [CKEditor](http://ckeditor.com/) for Symfony projects.
The bundle provides [SonataMediaBundle](https://docs.sonata-project.org/projects/SonataMediaBundle/en/3.x/index.html) integration into [CKEditor](http://ckeditor.com/) for Symfony projects.

[![Build Status](https://travis-ci.org/coopTilleuls/CoopTilleulsCKEditorSonataMediaBundle.png?branch=master)](https://travis-ci.org/coopTilleuls/CoopTilleulsCKEditorSonataMediaBundle)

Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
}
],
"require": {
"php": "^7.2",
"symfony/dependency-injection": "^3.4 || ^4.0",
"symfony/http-foundation": "^3.4 || ^4.0",
"symfony/http-kernel": "^3.4 || ^4.0",
"symfony/security-core": "^3.4 || ^4.0",
"symfony/config": "^3.4 || ^4.0",
"sonata-project/media-bundle": "^3.0",
"sonata-project/admin-bundle": "^3.40"
"php": ">=8.1",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/http-foundation": "^5.4 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0",
"symfony/security-core": "^5.4 || ^6.0",
"symfony/config": "^5.4 || ^6.0",
"sonata-project/media-bundle": "^3.0 || ^4.10",
"sonata-project/admin-bundle": "^3.40 || ^4.28"
},
"require-dev": {
"symfony/phpunit-bridge": "^3.4.19 || ^4.0"
"symfony/phpunit-bridge": "^5.4 || ^6.3 || ^7.0"
},
"suggest": {
"egeloen/ckeditor-bundle": "for easy Symfony integration"
Expand Down
23 changes: 3 additions & 20 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
# Installation

If not already done, install and configure [SonataMediaBundle](http://sonata-project.org/bundles/media/master/doc/index.html).
If not already done, install and configure [SonataMediaBundle](https://docs.sonata-project.org/projects/SonataMediaBundle/en/3.x/index.html).

Then, use [Composer](https://getcomposer.org/) to install CoopTilleulsCKEditorSonataMediaBundle and FOSCKEditorBundle:

composer require tilleuls/ckeditor-sonata-media-bundle friendsofsymfony/ckeditor-bundle

Register the bundle in your `bundles.php`:

```php
// app/AppKernel.php

public function registerBundles()
{
return array(
// ...
new CoopTilleuls\Bundle\CKEditorSonataMediaBundle\CoopTilleulsCKEditorSonataMediaBundle(),
new FOS\CKEditorBundle\FOSCKEditorBundle(),
// ...
);
}
```
or

```php
// config/bundles.php

Expand All @@ -43,8 +28,7 @@ $ composer update
Add form theme to render the editor:

```yaml
# Symfony 3: app/config/config.yml
# Symfony 4: config/packages/twig.yaml
# config/packages/twig.yaml

twig:
form_themes:
Expand All @@ -54,8 +38,7 @@ twig:
Configure FOSCKEditorBundle to use the bundle as file browser:
```yaml
# Symfony 3: app/config/config.yml
# Symfony 4: config/packages/fos_ck_editor.yaml
# config/packages/fos_ck_editor.yaml

fos_ck_editor:
default_config: default
Expand Down
44 changes: 16 additions & 28 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="CKEditorSonataMediaBundle Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./src/</directory>
<exclude>
<directory>./src/Resources/</directory>
<directory>./src/DependencyInjection/</directory>
</exclude>
</whitelist>
</filter>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage/>
<testsuites>
<testsuite name="CKEditorSonataMediaBundle Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src/</directory>
</include>
<exclude>
<directory>./src/Resources/</directory>
<directory>./src/DependencyInjection/</directory>
</exclude>
</source>
</phpunit>
3 changes: 0 additions & 3 deletions src/Admin/MediaAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
*/
class MediaAdminExtension extends AbstractAdminExtension
{
/**
* {@inheritdoc}
*/
public function configureRoutes(AdminInterface $admin, RouteCollection $collection)
{
$collection->add('browser', 'browser');
Expand Down
3 changes: 0 additions & 3 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
*/
final class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('coop_tilleuls_ck_editor_sonata_media');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
*/
final class CoopTilleulsCKEditorSonataMediaExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = new Configuration();
Expand Down

0 comments on commit 790bb02

Please sign in to comment.