Skip to content

Lots of automated migrations to Symfony Flex structure #8569

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

Merged
merged 3 commits into from
Nov 2, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion bundles/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Other available loaders are the ``YamlFileLoader``, ``PhpFileLoader`` and
.. caution::

If you removed the default file with service definitions (i.e.
``app/config/services.yaml``), make sure to also remove it from the
``config/services.yaml``), make sure to also remove it from the
``imports`` key in ``app/config/config.yml``.

Using Configuration to Change the Services
Expand Down
2 changes: 1 addition & 1 deletion bundles/override.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Routing

Routing is never automatically imported in Symfony. If you want to include
the routes from any bundle, then they must be manually imported from somewhere
in your application (e.g. ``app/config/routes.yaml``).
in your application (e.g. ``config/routes.yml``).

The easiest way to "override" a bundle's routing is to never import it at
all. Instead of importing a third-party bundle's routing, simply copy
Expand Down
4 changes: 2 additions & 2 deletions console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ useful one is the :class:`Symfony\\Component\\Console\\Tester\\CommandTester`
class. It uses special input and output classes to ease testing without a real
console::

// tests/AppBundle/Command/CreateUserCommandTest.php
namespace Tests\App\Command;
// tests/Command/CreateUserCommandTest.php
namespace App\Tests\Command;

use App\Command\CreateUserCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
Expand Down
6 changes: 3 additions & 3 deletions controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ controller's service config:

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
# ...

Expand All @@ -299,7 +299,7 @@ controller's service config:

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -323,7 +323,7 @@ controller's service config:

.. code-block:: php

// app/config/services.php
// config/services.php
use App\Controller\LuckyController;

$container->register(LuckyController::class)
Expand Down
6 changes: 3 additions & 3 deletions controller/argument_value_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ and adding a priority.

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
_defaults:
# ... be sure autowiring is enabled
Expand All @@ -161,7 +161,7 @@ and adding a priority.

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance"
Expand All @@ -181,7 +181,7 @@ and adding a priority.

.. code-block:: php

// app/config/services.php
// config/services.php
use App\ArgumentResolver\UserValueResolver;

$container->autowire(UserValueResolver::class)
Expand Down
6 changes: 3 additions & 3 deletions controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ In that case, you might want to override one or both of the ``showAction()`` and

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
_defaults:
# ... be sure autowiring is enabled
Expand All @@ -282,7 +282,7 @@ In that case, you might want to override one or both of the ``showAction()`` and

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -303,7 +303,7 @@ In that case, you might want to override one or both of the ``showAction()`` and

.. code-block:: php

// app/config/services.php
// config/services.php
use App\Controller\CustomExceptionController;

$container->autowire(CustomExceptionController::class)
Expand Down
4 changes: 2 additions & 2 deletions controller/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ syntax:

.. code-block:: xml

<!-- app/config/routing.xml -->
<!-- config/routes.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -66,7 +66,7 @@ syntax:

.. code-block:: php

// app/config/routing.php
// config/routes.php
$collection->add('hello', new Route('/hello', array(
'_controller' => 'app.hello_controller:indexAction',
)));
Expand Down
10 changes: 5 additions & 5 deletions controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Then, define a service for this class:

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
# ...

Expand All @@ -266,7 +266,7 @@ Then, define a service for this class:

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -281,7 +281,7 @@ Then, define a service for this class:

.. code-block:: php

// app/config/services.php
// config/services.php
use App\Service\FileUploader;

$container->autowire(FileUploader::class)
Expand Down Expand Up @@ -372,7 +372,7 @@ Now, register this class as a Doctrine listener:

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
_defaults:
# ... be sure autowiring is enabled
Expand Down Expand Up @@ -405,7 +405,7 @@ Now, register this class as a Doctrine listener:

.. code-block:: php

// app/config/services.php
// config/services.php
use App\EventListener\BrochureUploaderListener;

$container->autowire(BrochureUploaderListener::class)
Expand Down
2 changes: 1 addition & 1 deletion deployment/azure-website.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ below:

The code of the Symfony application has now been deployed to the Azure Website
which you can browse from the file explorer of the Kudu application. You should
see the ``app/``, ``src/`` and ``public/`` directories under your ``site/wwwroot``
see the ``config/``, ``src/`` and ``public/`` directories under your ``site/wwwroot``
directory on the Azure Website filesystem.

Configure the Symfony Application
Expand Down
4 changes: 2 additions & 2 deletions doctrine/registration_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ the :ref:`user password encoding <security-encoding-user-password>` article.

.. code-block:: xml

<!-- app/config/routing.xml -->
<!-- config/routes.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -333,7 +333,7 @@ the :ref:`user password encoding <security-encoding-user-password>` article.

.. code-block:: php

// app/config/routing.php
// config/routes.php
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;

Expand Down
4 changes: 2 additions & 2 deletions email/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Start with an easy controller action that sends an email::
In your functional test, use the ``swiftmailer`` collector on the profiler
to get information about the messages sent on the previous request::

// tests/AppBundle/Controller/MailControllerTest.php
namespace Tests\App\Controller;
// tests/Controller/MailControllerTest.php
namespace App\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

Expand Down
6 changes: 3 additions & 3 deletions event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ using a special "tag":

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
App\EventListener\ExceptionListener:
tags:
- { name: kernel.event_listener, event: kernel.exception }

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -101,7 +101,7 @@ using a special "tag":

.. code-block:: php

// app/config/services.php
// config/services.php
use App\EventListener\ExceptionListener;

$container
Expand Down
6 changes: 3 additions & 3 deletions form/form_dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ manually and tag it with ``form.type``:

.. code-block:: yaml

# src/Resources/config/services.yaml
# config/services.yaml
services:
App\Form\TaskType:
arguments: ['@doctrine.orm.entity_manager']
tags: [form.type]

.. code-block:: xml

<!-- src/Resources/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -130,7 +130,7 @@ manually and tag it with ``form.type``:

.. code-block:: php

// src/Resources/config/services.php
// config/services.php
use App\Form\TaskType;
use Symfony\Component\DependencyInjection\Reference;

Expand Down
6 changes: 3 additions & 3 deletions form/type_guesser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ and tag it with ``form.type_guesser``:

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
# ...

Expand All @@ -193,7 +193,7 @@ and tag it with ``form.type_guesser``:

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -209,7 +209,7 @@ and tag it with ``form.type_guesser``:

.. code-block:: php

// app/config/services.php
// config/services.php
use App\Form\TypeGuesser\PHPDocTypeGuesser;

$container->register(PHPDocTypeGuesser::class)
Expand Down
16 changes: 8 additions & 8 deletions form/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The Basics

The simplest ``TypeTestCase`` implementation looks like the following::

// tests/AppBundle/Form/Type/TestedTypeTest.php
namespace Tests\App\Form\Type;
// tests/Form/Type/TestedTypeTest.php
namespace App\Tests\Form\Type;

use App\Form\Type\TestedType;
use App\Model\TestObject;
Expand Down Expand Up @@ -114,8 +114,8 @@ To solve this, you have to mock the injected dependencies, instantiate your own
form type and use the :class:`Symfony\\Component\\Form\\PreloadedExtension` to
make sure the ``FormRegistry`` uses the created instance::

// tests/AppBundle/Form/Type/TestedTypeTests.php
namespace Tests\App\Form\Type;
// tests/Form/Type/TestedTypeTests.php
namespace App\Tests\Form\Type;

use App\Form\Type\TestedType;
use Doctrine\Common\Persistence\ObjectManager;
Expand Down Expand Up @@ -168,8 +168,8 @@ will be raised if you try to test a class that depends on other extensions.
The :method:`Symfony\\Component\\Form\\Test\\TypeTestCase::getExtensions` method
allows you to return a list of extensions to register::

// tests/AppBundle/Form/Type/TestedTypeTests.php
namespace Tests\App\Form\Type;
// tests/Form/Type/TestedTypeTests.php
namespace App\Tests\Form\Type;

// ...
use App\Form\Type\TestedType;
Expand Down Expand Up @@ -219,8 +219,8 @@ Testing against Different Sets of Data
If you are not familiar yet with PHPUnit's `data providers`_, this might be
a good opportunity to use them::

// tests/AppBundle/Form/Type/TestedTypeTests.php
namespace Tests\App\Form\Type;
// tests/Form/Type/TestedTypeTests.php
namespace App\Tests\Form\Type;

use App\Form\Type\TestedType;
use Symfony\Component\Form\Test\TypeTestCase;
Expand Down
6 changes: 3 additions & 3 deletions frontend/custom_version_strategy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ After creating the strategy PHP class, register it as a Symfony service.

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
App\Asset\VersionStrategy\GulpBusterVersionStrategy:
arguments:
Expand All @@ -128,7 +128,7 @@ After creating the strategy PHP class, register it as a Symfony service.

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -145,7 +145,7 @@ After creating the strategy PHP class, register it as a Symfony service.

.. code-block:: php

// app/config/services.php
// config/services.php
use Symfony\Component\DependencyInjection\Definition;
use App\Asset\VersionStrategy\GulpBusterVersionStrategy;

Expand Down
2 changes: 1 addition & 1 deletion http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ changes to ``index.php`` to add caching to the ``dev`` environment::
use Symfony\Component\HttpFoundation\Request;

// ...
$kernel = new Kernel('prod', false);
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is obsolete?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted, all front controller and kernel changes should be done manually.


// add (or uncomment) this new line!
Expand Down
6 changes: 3 additions & 3 deletions logging/formatter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ configure your handler to use it:

.. code-block:: yaml

# app/config/services.yaml
# config/services.yaml
services:
# ...

Expand All @@ -30,7 +30,7 @@ configure your handler to use it:

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down Expand Up @@ -60,7 +60,7 @@ configure your handler to use it:
// app/config/config.php
use Monolog\Formatter\JsonFormatter;

// app/config/services.php
// config/services.php
$container->register(JsonFormatter::class);

// app/config/config_prod.php (or config_dev.php)
Expand Down
Loading