From 5d619ab9b1044e973653805eec98429ac65a07f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Cybula?= <lukasz@fsi.pl>
Date: Mon, 11 Dec 2017 11:49:28 +0100
Subject: [PATCH 1/6] Explicitly register controllers as public services

---
 Resources/config/services.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Resources/config/services.xml b/Resources/config/services.xml
index 7a5a7879..063e0f46 100644
--- a/Resources/config/services.xml
+++ b/Resources/config/services.xml
@@ -77,7 +77,7 @@
         </service>
 
         <!-- Controllers -->
-        <service id="admin.controller.abstract" class="%admin.controller.abstract.class%" abstract="true">
+        <service id="admin.controller.abstract" class="%admin.controller.abstract.class%" abstract="true" public="true">
             <argument type="service" id="templating"/>
             <argument type="service" id="admin.context.manager"/>
             <argument type="service" id="event_dispatcher"/>
@@ -101,7 +101,7 @@
             <argument>%admin.templates.resource%</argument>
         </service>
 
-        <service id="admin.controller.admin" class="%admin.controller.admin.class%">
+        <service id="admin.controller.admin" class="%admin.controller.admin.class%" public="true">
             <argument type="service" id="templating"/>
             <argument type="service" id="router"/>
             <argument>%admin.templates.index_page%</argument>

From 6a12c59f6cf00360514f521d1bcc991fe1f9976a Mon Sep 17 00:00:00 2001
From: Lukasz Cybula <lukasz@fsi.pl>
Date: Mon, 11 Dec 2017 14:25:48 +0100
Subject: [PATCH 2/6] Do not use deprecated form of invocation of Yaml parser

---
 EventListener/MainMenuListener.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/EventListener/MainMenuListener.php b/EventListener/MainMenuListener.php
index b14a19be..9301d2fb 100644
--- a/EventListener/MainMenuListener.php
+++ b/EventListener/MainMenuListener.php
@@ -38,7 +38,14 @@ public function __construct(ManagerInterface $manager, string $configFilePath)
 
     public function createMainMenu(MenuEvent $event): Item
     {
-        $config = $this->yaml->parse(file_get_contents($this->configFilePath), true, true);
+        if (defined('Symfony\Component\Yaml\Yaml::PARSE_OBJECT')) {
+            $config = $this->yaml->parse(
+                file_get_contents($this->configFilePath),
+                Yaml::PARSE_OBJECT | Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE
+            );
+        } else {
+            $config = $this->yaml->parse(file_get_contents($this->configFilePath), true, true);
+        }
 
         if (!isset($config['menu'])) {
             throw new InvalidYamlStructureException(

From 3bf7caa517fbfbca0c77b878ddceb87c2b3ca7b1 Mon Sep 17 00:00:00 2001
From: Lukasz Cybula <lukasz@fsi.pl>
Date: Mon, 11 Dec 2017 14:31:53 +0100
Subject: [PATCH 3/6] Allow Symfony ^4.0 components

---
 composer.json                                 | 42 +++++++++----------
 .../CRUD/Context/BatchElementContextSpec.php  |  2 +-
 .../CRUD/Context/FormElementContextSpec.php   |  2 +-
 .../CRUD/Context/ListElementContextSpec.php   |  2 +-
 .../Display/Context/DisplayContextSpec.php    |  2 +-
 .../Context/ResourceRepositoryContextSpec.php |  2 +-
 .../Display/PropertyAccessDisplaySpec.php     |  2 +-
 .../AdminBundle/Display/SimpleDisplaySpec.php |  2 +-
 .../EventListener/MainMenuListenerSpec.php    |  2 +-
 9 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/composer.json b/composer.json
index 27e29943..1efabafb 100644
--- a/composer.json
+++ b/composer.json
@@ -20,22 +20,22 @@
     ],
     "require": {
         "php": ">=7.1",
-        "symfony/framework-bundle" : "^2.4|^3.0",
-        "symfony/form" : "^2.3|^3.0",
-        "symfony/intl" : "^2.6|^3.0",
-        "symfony/asset": "^2.7|^3.0",
-        "symfony/options-resolver": "^2.6|^3.0",
-        "symfony/expression-language": "^2.6|^3.0",
-        "symfony/http-foundation": "^2.6|^3.0",
-        "symfony/dependency-injection": "^2.6.2|^3.0",
-        "symfony/validator": "^2.3|^3.0",
-        "symfony/proxy-manager-bridge": "^2.3|^3.0",
-        "symfony/doctrine-bridge": "^2.3|^3.0",
-        "symfony/twig-bridge": "^2.6|^3.0",
-        "symfony/translation": "^2.4|^3.0",
-        "symfony/templating": "^2.4|^3.0",
-        "sensio/framework-extra-bundle": "^3.0",
-        "symfony/twig-bundle": "^2.3|^3.0",
+        "symfony/framework-bundle" : "^2.4|^3.0|^4.0",
+        "symfony/form" : "^2.3|^3.0|^4.0",
+        "symfony/intl" : "^2.6|^3.0|^4.0",
+        "symfony/asset": "^2.7|^3.0|^4.0",
+        "symfony/options-resolver": "^2.6|^3.0|^4.0",
+        "symfony/expression-language": "^2.6|^3.0|^4.0",
+        "symfony/http-foundation": "^2.6|^3.0|^4.0",
+        "symfony/dependency-injection": "^2.6.2|^3.0|^4.0",
+        "symfony/validator": "^2.3|^3.0|^4.0",
+        "symfony/proxy-manager-bridge": "^2.3|^3.0|^4.0",
+        "symfony/doctrine-bridge": "^2.3|^3.0|^4.0",
+        "symfony/twig-bridge": "^2.6|^3.0|^4.0",
+        "symfony/translation": "^2.4|^3.0|^4.0",
+        "symfony/templating": "^2.4|^3.0|^4.0",
+        "sensio/framework-extra-bundle": "^3.0|^4.0",
+        "symfony/twig-bundle": "^2.3|^3.0|^4.0",
         "fsi/datagrid-bundle" : "^1.2|^2.0@dev",
         "fsi/datasource-bundle": "^2.0@dev",
         "knplabs/knp-menu-bundle": "^2.0",
@@ -45,9 +45,9 @@
     },
     "require-dev": {
         "symfony/class-loader": "^2.3|^3.0",
-        "symfony/monolog-bundle": "^2.3|^3.0",
-        "symfony/yaml": "^2.7.1|^3.0",
-        "symfony/var-dumper": "^2.6|^3.0",
+        "symfony/monolog-bundle": "^2.3|^3.0|^4.0",
+        "symfony/yaml": "^2.7.1|^3.0|^4.0",
+        "symfony/var-dumper": "^2.6|^3.0|^4.0",
         "ext-pdo_sqlite": "*",
         "fsi/resource-repository-bundle": "^1.1.5|^2.0@dev",
         "fsi/datagrid": "^1.3|^2.0@dev",
@@ -55,7 +55,7 @@
         "fsi/doctrine-extensions": "^1.1.4|^2.0@dev",
         "fsi/doctrine-extensions-bundle": "^1.1.4|^2.0@dev",
         "doctrine/doctrine-bundle": "^1.4",
-        "phpspec/phpspec": "^3.0",
+        "phpspec/phpspec": "^4.0",
         "phpspec/prophecy": "^1.7",
         "behat/behat": "^3.3",
         "behat/symfony2-extension": "^2.1",
@@ -63,7 +63,7 @@
         "behat/mink-browserkit-driver": "^1.3@dev",
         "behat/mink-selenium2-driver": "^1.3",
         "sensiolabs/behat-page-object-extension": "^2.0",
-        "bossa/phpspec2-expect": "^2.0",
+        "bossa/phpspec2-expect": "^3.0",
         "fzaninotto/faker": "^1.2",
         "rize/uri-template": "^0.3.1"
     },
diff --git a/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/BatchElementContextSpec.php b/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/BatchElementContextSpec.php
index 5a7e6aa6..99735e8f 100644
--- a/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/BatchElementContextSpec.php
+++ b/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/BatchElementContextSpec.php
@@ -76,7 +76,7 @@ function it_return_response_from_handler(
             ->shouldReturnAnInstanceOf(Response::class);
     }
 
-    public function getMatchers()
+    public function getMatchers(): array
     {
         return [
             'haveKeyInArray' => function($subject, $key) {
diff --git a/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/FormElementContextSpec.php b/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/FormElementContextSpec.php
index c6938546..8a80515b 100644
--- a/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/FormElementContextSpec.php
+++ b/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/FormElementContextSpec.php
@@ -88,7 +88,7 @@ function it_throws_exception_when_adding_is_not_allowed(
         $this->shouldThrow(NotFoundHttpException::class)->during('handleRequest', [$request]);
     }
 
-    public function getMatchers()
+    public function getMatchers(): array
     {
         return [
             'haveKeyInArray' => function($subject, $key) {
diff --git a/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/ListElementContextSpec.php b/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/ListElementContextSpec.php
index 70d14a09..43f9e905 100644
--- a/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/ListElementContextSpec.php
+++ b/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/ListElementContextSpec.php
@@ -82,7 +82,7 @@ function it_return_response_from_handler(
             ->shouldReturnAnInstanceOf(Response::class);
     }
 
-    public function getMatchers()
+    public function getMatchers(): array
     {
         return [
             'haveKeyInArray' => function($subject, $key) {
diff --git a/spec/FSi/Bundle/AdminBundle/Admin/Display/Context/DisplayContextSpec.php b/spec/FSi/Bundle/AdminBundle/Admin/Display/Context/DisplayContextSpec.php
index 0ae7a253..0d114642 100644
--- a/spec/FSi/Bundle/AdminBundle/Admin/Display/Context/DisplayContextSpec.php
+++ b/spec/FSi/Bundle/AdminBundle/Admin/Display/Context/DisplayContextSpec.php
@@ -88,7 +88,7 @@ function it_returns_response_from_handler(HandlerInterface $handler, Request $re
             ->shouldReturnAnInstanceOf(Response::class);
     }
 
-    public function getMatchers()
+    public function getMatchers(): array
     {
         return [
             'haveKeyInArray' => function($subject, $key) {
diff --git a/spec/FSi/Bundle/AdminBundle/Admin/ResourceRepository/Context/ResourceRepositoryContextSpec.php b/spec/FSi/Bundle/AdminBundle/Admin/ResourceRepository/Context/ResourceRepositoryContextSpec.php
index 2b2bf887..df55fb1e 100644
--- a/spec/FSi/Bundle/AdminBundle/Admin/ResourceRepository/Context/ResourceRepositoryContextSpec.php
+++ b/spec/FSi/Bundle/AdminBundle/Admin/ResourceRepository/Context/ResourceRepositoryContextSpec.php
@@ -86,7 +86,7 @@ function it_return_response_from_handler(
             ->shouldReturnAnInstanceOf(Response::class);
     }
 
-    public function getMatchers()
+    public function getMatchers(): array
     {
         return [
             'haveKeyInArray' => function($subject, $key) {
diff --git a/spec/FSi/Bundle/AdminBundle/Display/PropertyAccessDisplaySpec.php b/spec/FSi/Bundle/AdminBundle/Display/PropertyAccessDisplaySpec.php
index 4b2a804f..c5d6eeef 100644
--- a/spec/FSi/Bundle/AdminBundle/Display/PropertyAccessDisplaySpec.php
+++ b/spec/FSi/Bundle/AdminBundle/Display/PropertyAccessDisplaySpec.php
@@ -50,7 +50,7 @@ function it_creates_display_view_with_decorated_values()
         $this->getData()->shouldHaveProperty($now->format('Y-m-d'), 'Date');
     }
 
-    public function getMatchers()
+    public function getMatchers(): array
     {
         return [
             'haveProperty' => function($subject, $value, $label) {
diff --git a/spec/FSi/Bundle/AdminBundle/Display/SimpleDisplaySpec.php b/spec/FSi/Bundle/AdminBundle/Display/SimpleDisplaySpec.php
index efd0513e..e13d08b9 100644
--- a/spec/FSi/Bundle/AdminBundle/Display/SimpleDisplaySpec.php
+++ b/spec/FSi/Bundle/AdminBundle/Display/SimpleDisplaySpec.php
@@ -21,7 +21,7 @@ function it_creates_data_for_object()
         $this->getData()->shouldHaveProperty('Piotr', 'First Name');
     }
 
-    public function getMatchers()
+    public function getMatchers(): array
     {
         return [
             'haveProperty' => function($subject, $value, $label) {
diff --git a/spec/FSi/Bundle/AdminBundle/EventListener/MainMenuListenerSpec.php b/spec/FSi/Bundle/AdminBundle/EventListener/MainMenuListenerSpec.php
index 6b5fbb6d..2a491e78 100644
--- a/spec/FSi/Bundle/AdminBundle/EventListener/MainMenuListenerSpec.php
+++ b/spec/FSi/Bundle/AdminBundle/EventListener/MainMenuListenerSpec.php
@@ -60,7 +60,7 @@ function it_build_menu()
         $offerItem->getOption('elements')[1]->getId()->shouldReturn('product');
     }
 
-    public function getMatchers()
+    public function getMatchers(): array
     {
         return [
             'haveItem' => function(Item $menu, $itemName, $elementId = false) {

From a2cfcbec83f06a824fef54d9c5b4d73b5b79a6c8 Mon Sep 17 00:00:00 2001
From: Lukasz Cybula <lukasz@fsi.pl>
Date: Mon, 8 Jan 2018 16:36:31 +0100
Subject: [PATCH 4/6] Symfony 4 compatibility fixes

---
 Behat/Context/AdminContext.php                 |  2 +-
 Behat/Context/FiltersContext.php               |  2 +-
 Behat/Context/ResourceContext.php              | 18 ++++++++++--------
 .../Compiler/AdminElementPass.php              |  4 ++--
 FSiAdminBundle.php                             |  2 +-
 composer.json                                  |  2 +-
 .../fixtures/project/app/config/config.yml     |  6 +++---
 .../Resources/config/services.xml              |  6 +++++-
 .../CRUD/Context/ListElementContextSpec.php    |  3 +++
 .../Bundle/AdminBundle/FSiAdminBundleSpec.php  |  6 ++----
 10 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/Behat/Context/AdminContext.php b/Behat/Context/AdminContext.php
index dbcef3db..b6e9caf2 100644
--- a/Behat/Context/AdminContext.php
+++ b/Behat/Context/AdminContext.php
@@ -161,6 +161,6 @@ public function castWordToNumber(string $word): int
 
     private function getAdminManager(): ManagerInterface
     {
-        return $this->getContainer()->get('admin.manager');
+        return $this->getContainer()->get('test.admin.manager');
     }
 }
diff --git a/Behat/Context/FiltersContext.php b/Behat/Context/FiltersContext.php
index 7777d97f..a91ffda5 100644
--- a/Behat/Context/FiltersContext.php
+++ b/Behat/Context/FiltersContext.php
@@ -246,7 +246,7 @@ private function getDataSource(AdminListElement $adminElement)
 
     private function clearDataSource(AdminListElement $element): void
     {
-        $this->getContainer()->get('datasource.factory')->clearDataSource($element->getId());
+        $this->getContainer()->get('test.datasource.factory')->clearDataSource($element->getId());
     }
 
     private function getFiltersElement(): Filters
diff --git a/Behat/Context/ResourceContext.php b/Behat/Context/ResourceContext.php
index 097b51f1..7acb99f4 100644
--- a/Behat/Context/ResourceContext.php
+++ b/Behat/Context/ResourceContext.php
@@ -13,6 +13,7 @@
 
 use Behat\Gherkin\Node\TableNode;
 use Behat\Symfony2Extension\Context\KernelAwareContext;
+use FSi\Bundle\ResourceRepositoryBundle\Repository\MapBuilder;
 use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext;
 use Symfony\Component\HttpKernel\KernelInterface;
 
@@ -37,16 +38,12 @@ public function setKernel(KernelInterface $kernel): void
     public function thereAreFollowingResourcesAddedToResourceMap(TableNode $resources)
     {
         foreach ($resources->getHash() as $resource) {
-            expect($this->kernel->getContainer()
-                ->get('fsi_resource_repository.map_builder')
-                ->hasResource($resource['Key']))->toBe(true);
+            expect($this->getResourceMapBuilder()->hasResource($resource['Key']))->toBe(true);
 
             if (isset($resource['Type'])) {
-                expect($this->kernel->getContainer()
-                    ->get('fsi_resource_repository.map_builder')
-                    ->getResource($resource['Key']))->toBeAnInstanceOf(
-                        sprintf('FSi\Bundle\ResourceRepositoryBundle\Repository\Resource\Type\%sType', ucfirst($resource['Type']))
-                    );
+                expect($this->getResourceMapBuilder()->getResource($resource['Key']))->toBeAnInstanceOf(
+                    sprintf('FSi\Bundle\ResourceRepositoryBundle\Repository\Resource\Type\%sType', ucfirst($resource['Type']))
+                );
             }
         }
     }
@@ -66,4 +63,9 @@ public function iShouldSeeFormFieldWithValue($value)
     {
         expect($this->getElement('Form')->findField('Content')->getValue())->toBe($value);
     }
+
+    private function getResourceMapBuilder(): MapBuilder
+    {
+        return $this->kernel->getContainer()->get('test.fsi_resource_repository.map_builder');
+    }
 }
diff --git a/DependencyInjection/Compiler/AdminElementPass.php b/DependencyInjection/Compiler/AdminElementPass.php
index 0274c92e..d0274d3a 100644
--- a/DependencyInjection/Compiler/AdminElementPass.php
+++ b/DependencyInjection/Compiler/AdminElementPass.php
@@ -20,7 +20,7 @@ class AdminElementPass implements CompilerPassInterface
     public function process(ContainerBuilder $container): void
     {
         if (!$container->hasDefinition('admin.manager')
-            || !$container->has('admin.manager.visitor.element_collection')
+            || !$container->hasDefinition('admin.manager.visitor.element_collection')
         ) {
             return;
         }
@@ -28,7 +28,7 @@ public function process(ContainerBuilder $container): void
         $elements = [];
         $elementServices = $container->findTaggedServiceIds('admin.element');
         foreach (array_keys($elementServices) as $id) {
-            $elements[] = new Reference($id);
+            $elements[] = new Reference((string) $id);
         }
 
         $container->findDefinition('admin.manager.visitor.element_collection')
diff --git a/FSiAdminBundle.php b/FSiAdminBundle.php
index a9a04421..9aebe6f2 100644
--- a/FSiAdminBundle.php
+++ b/FSiAdminBundle.php
@@ -35,7 +35,7 @@ public function build(ContainerBuilder $container): void
             new AnnotationReader(),
             new AdminClassFinder()
         ));
-        $container->addCompilerPass(new AdminElementPass(), PassConfig::TYPE_REMOVE);
+        $container->addCompilerPass(new AdminElementPass());
         $container->addCompilerPass(new KnpMenuBuilderPass());
         $container->addCompilerPass(new ResourceRepositoryPass());
         $container->addCompilerPass(new ManagerVisitorPass());
diff --git a/composer.json b/composer.json
index 1efabafb..1934f801 100644
--- a/composer.json
+++ b/composer.json
@@ -44,7 +44,7 @@
         "ocramius/proxy-manager": "^2.1"
     },
     "require-dev": {
-        "symfony/class-loader": "^2.3|^3.0",
+        "symfony/class-loader": "^2.3|^3.0|^4.0",
         "symfony/monolog-bundle": "^2.3|^3.0|^4.0",
         "symfony/yaml": "^2.7.1|^3.0|^4.0",
         "symfony/var-dumper": "^2.6|^3.0|^4.0",
diff --git a/features/fixtures/project/app/config/config.yml b/features/fixtures/project/app/config/config.yml
index 0be8a706..f12c5b49 100644
--- a/features/fixtures/project/app/config/config.yml
+++ b/features/fixtures/project/app/config/config.yml
@@ -19,9 +19,9 @@ doctrine:
         driver:   pdo_sqlite
         user:     admin
         charset:  UTF8
-        path: %kernel.root_dir%/data.sqlite
+        path: "%kernel.root_dir%/data.sqlite"
     orm:
-        auto_generate_proxy_classes: %kernel.debug%
+        auto_generate_proxy_classes: "%kernel.debug%"
         auto_mapping: true
 
 fsi_resource_repository:
@@ -41,4 +41,4 @@ monolog:
             type: stream
             path: "%kernel.logs_dir%/%kernel.environment%.log"
             level: debug
-            channels: [!event]
\ No newline at end of file
+            channels: ["!event"]
diff --git a/features/fixtures/project/src/FSi/FixturesBundle/Resources/config/services.xml b/features/fixtures/project/src/FSi/FixturesBundle/Resources/config/services.xml
index 6896c8e1..ccc7af72 100644
--- a/features/fixtures/project/src/FSi/FixturesBundle/Resources/config/services.xml
+++ b/features/fixtures/project/src/FSi/FixturesBundle/Resources/config/services.xml
@@ -75,11 +75,15 @@
             <tag name="admin.element" />
         </service>
 
-        <service id="datasource.factory" class="FSi\FixturesBundle\DataSource\DataSourceFactory">
+        <service id="test.datasource.factory" class="FSi\FixturesBundle\DataSource\DataSourceFactory" public="true">
             <argument type="service" id="datasource.driver.factory.manager" />
             <argument type="collection">
                 <argument type="service" id="datasource.extension" />
             </argument>
         </service>
+
+        <service id="test.admin.manager" alias="admin.manager" public="true" />
+
+        <service id="test.fsi_resource_repository.map_builder" alias="fsi_resource_repository.map_builder" public="true" />
     </services>
 </container>
diff --git a/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/ListElementContextSpec.php b/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/ListElementContextSpec.php
index 43f9e905..d6c778a0 100644
--- a/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/ListElementContextSpec.php
+++ b/spec/FSi/Bundle/AdminBundle/Admin/CRUD/Context/ListElementContextSpec.php
@@ -12,6 +12,7 @@
 use FSi\Bundle\AdminBundle\Admin\Context\Request\HandlerInterface;
 use FSi\Bundle\AdminBundle\Admin\CRUD\ListElement;
 use FSi\Component\DataGrid\DataGridInterface;
+use FSi\Component\DataGrid\DataGridViewInterface;
 use FSi\Component\DataSource\DataSourceInterface;
 use PhpSpec\ObjectBehavior;
 use Prophecy\Argument;
@@ -26,10 +27,12 @@ function let(
         ListElement $element,
         DataSourceInterface $datasource,
         DataGridInterface $datagrid,
+        DataGridViewInterface $datagridView,
         HandlerInterface $handler
     ) {
         $this->beConstructedWith([$handler], 'default_list');
         $element->createDataGrid()->willReturn($datagrid);
+        $datagrid->createView()->willReturn($datagridView);
         $element->createDataSource()->willReturn($datasource);
         $this->setElement($element);
     }
diff --git a/spec/FSi/Bundle/AdminBundle/FSiAdminBundleSpec.php b/spec/FSi/Bundle/AdminBundle/FSiAdminBundleSpec.php
index 2b60021c..1c133ba7 100644
--- a/spec/FSi/Bundle/AdminBundle/FSiAdminBundleSpec.php
+++ b/spec/FSi/Bundle/AdminBundle/FSiAdminBundleSpec.php
@@ -33,10 +33,8 @@ function it_add_compiler_pass(ContainerBuilder $builder)
     {
         $builder->addCompilerPass(Argument::type(AdminAnnotatedElementPass::class))
             ->shouldBeCalled();
-        $builder->addCompilerPass(
-                Argument::type(AdminElementPass::class),
-                PassConfig::TYPE_REMOVE
-            )->shouldBeCalled();
+        $builder->addCompilerPass(Argument::type(AdminElementPass::class))
+            ->shouldBeCalled();
         $builder->addCompilerPass(Argument::type(KnpMenuBuilderPass::class))
             ->shouldBeCalled();
         $builder->addCompilerPass(Argument::type(ResourceRepositoryPass::class))

From c84066b02e0dd7ca0ce2218c37f8c58064279bbc Mon Sep 17 00:00:00 2001
From: Lukasz Cybula <lukasz@fsi.pl>
Date: Tue, 9 Jan 2018 10:06:28 +0100
Subject: [PATCH 5/6] Test new scrutinizer engine, lower dev dependencies

---
 .scrutinizer.yml | 8 ++++++++
 composer.json    | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/.scrutinizer.yml b/.scrutinizer.yml
index af821242..6f731023 100644
--- a/.scrutinizer.yml
+++ b/.scrutinizer.yml
@@ -1,4 +1,12 @@
 ---
+build:
+    nodes:
+        analysis:
+            project_setup:
+                override: true
+            tests:
+                override: [php-scrutinizer-run]
+
 filter:
     excluded_paths: [vendor/*, app/*, web/*, Behat/*, spec/*, features/*]
 
diff --git a/composer.json b/composer.json
index 1934f801..3349025f 100644
--- a/composer.json
+++ b/composer.json
@@ -55,7 +55,7 @@
         "fsi/doctrine-extensions": "^1.1.4|^2.0@dev",
         "fsi/doctrine-extensions-bundle": "^1.1.4|^2.0@dev",
         "doctrine/doctrine-bundle": "^1.4",
-        "phpspec/phpspec": "^4.0",
+        "phpspec/phpspec": "^3.0",
         "phpspec/prophecy": "^1.7",
         "behat/behat": "^3.3",
         "behat/symfony2-extension": "^2.1",
@@ -63,7 +63,7 @@
         "behat/mink-browserkit-driver": "^1.3@dev",
         "behat/mink-selenium2-driver": "^1.3",
         "sensiolabs/behat-page-object-extension": "^2.0",
-        "bossa/phpspec2-expect": "^3.0",
+        "bossa/phpspec2-expect": "^2.0",
         "fzaninotto/faker": "^1.2",
         "rize/uri-template": "^0.3.1"
     },

From a5234eae902422451a782f626ad1941674a77b73 Mon Sep 17 00:00:00 2001
From: Lukasz Cybula <lukasz@fsi.pl>
Date: Tue, 9 Jan 2018 13:26:52 +0100
Subject: [PATCH 6/6] CS fix

---
 Doctrine/Admin/ElementImpl.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Doctrine/Admin/ElementImpl.php b/Doctrine/Admin/ElementImpl.php
index 04957d78..9a1a53e7 100644
--- a/Doctrine/Admin/ElementImpl.php
+++ b/Doctrine/Admin/ElementImpl.php
@@ -23,6 +23,8 @@ trait ElementImpl
      */
     protected $registry;
 
+    abstract public function getClassName(): string;
+
     public function setManagerRegistry(ManagerRegistry $registry): void
     {
         $this->registry = $registry;