Skip to content

Commit e9183f6

Browse files
committed
Merge branch '4.0'
* 4.0: (26 commits) Fixed the default value for toolbar configuration Remove leading slash from rm -rf /vendor/* Recommend being lenient only with other vendors Close the tag Using better cache syntax Using PHPUNIT_FLAGS Added back php-versions Moved coverage to PHP 7.2 with latest deps Fixed minor things Fixed typos and created more variables Added comment and install simple-phpunit deps Use tilde or composer validate will never pass ...
2 parents ae038cf + d53bd31 commit e9183f6

File tree

9 files changed

+90
-9
lines changed

9 files changed

+90
-9
lines changed

bundles.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Start by creating a ``src/Acme/TestBundle/`` directory and adding a new file
5353
called ``AcmeTestBundle.php``::
5454

5555
// src/Acme/TestBundle/AcmeTestBundle.php
56-
namespace Acme\TestBundle;
56+
namespace App\Acme\TestBundle;
5757

5858
use Symfony\Component\HttpKernel\Bundle\Bundle;
5959

@@ -75,7 +75,7 @@ of the bundle. Now that you've created the bundle, enable it::
7575
// config/bundles.php
7676
return [
7777
// ...
78-
Acme\TestBundle\AcmeTestBundle::class => ['all' => true],
78+
App\Acme\TestBundle\AcmeTestBundle::class => ['all' => true],
7979
];
8080

8181
And while it doesn't do anything yet, AcmeTestBundle is now ready to be used.

bundles/best_practices.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,80 @@ the ``Tests/`` directory. Tests should follow the following principles:
166166
A test suite must not contain ``AllTests.php`` scripts, but must rely on the
167167
existence of a ``phpunit.xml.dist`` file.
168168

169+
Continuous Integration
170+
----------------------
171+
172+
Testing bundle code continuously, including all its commits and pull requests,
173+
is a good practice called Continuous Integration. There are several services
174+
providing this feature for free for open source projects. The most popular
175+
service for Symfony bundles is called `Travis CI`_.
176+
177+
Here is the recommended configuration file (``.travis.yml``) for Symfony bundles,
178+
which test the two latest :doc:`LTS versions </contributing/community/releases>`
179+
of Symfony and the latest beta release:
180+
181+
.. code-block:: yaml
182+
183+
language: php
184+
sudo: false
185+
cache:
186+
directories:
187+
- $HOME/.composer/cache/files
188+
- $HOME/symfony-bridge/.phpunit
189+
190+
env:
191+
global:
192+
- PHPUNIT_FLAGS="-v"
193+
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
194+
195+
matrix:
196+
fast_finish: true
197+
include:
198+
# Minimum supported dependencies with the latest and oldest PHP version
199+
- php: 7.2
200+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
201+
- php: 7.0
202+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
203+
204+
# Test the latest stable release
205+
- php: 7.0
206+
- php: 7.1
207+
- php: 7.2
208+
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"
209+
210+
# Test LTS versions. This makes sure we do not use Symfony packages with version greater
211+
# than 2 or 3 respectively. Read more at https://github.com/symfony/lts
212+
- php: 7.2
213+
env: DEPENDENCIES="symfony/lts:^2"
214+
- php: 7.2
215+
env: DEPENDENCIES="symfony/lts:^3"
216+
217+
# Latest commit to master
218+
- php: 7.2
219+
env: STABILITY="dev"
220+
221+
allow_failures:
222+
# Dev-master is allowed to fail.
223+
- env: STABILITY="dev"
224+
225+
before_install:
226+
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
227+
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
228+
- if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
229+
230+
install:
231+
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
232+
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
233+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
234+
- ./vendor/bin/simple-phpunit install
235+
236+
script:
237+
- composer validate --strict --no-check-lock
238+
- ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS
239+
240+
Consider using `Travis cron`_ too to make sure your project is built even if
241+
there are no new pull requests or commits.
242+
169243
Installation
170244
------------
171245

@@ -476,3 +550,5 @@ Learn more
476550
.. _`Packagist`: https://packagist.org/
477551
.. _`choose any license`: http://choosealicense.com/
478552
.. _`valid license identifier`: https://spdx.org/licenses/
553+
.. _`Travis CI`: https://travis-ci.org/
554+
.. _`Travis Cron`: https://docs.travis-ci.com/user/cron-jobs/

bundles/override.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ example, the implementing class for the ``original-service-id`` is changed to
5656
// ...
5757
+ use App\Service\YourService;
5858
+ use Symfony\Component\DependencyInjection\ContainerBuilder;
59+
+ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
5960
60-
class Kernel extends BaseKernel
61+
class Kernel extends BaseKernel implements CompilerPassInterface
6162
{
6263
+ public function process(ContainerBuilder $container)
6364
+ {

doctrine.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ But what if you need a more complex query? When you generated your entity with
580580

581581
use App\Entity\Product;
582582
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
583+
use Symfony\Bridge\Doctrine\RegistryInterface;
583584

584585
class ProductRepository extends ServiceEntityRepository
585586
{

page_creation.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,12 @@ project:
281281

282282
``src/``
283283
All your PHP code lives here.
284+
285+
``templates/``
286+
All your Twig templates live here.
284287

285-
Most of the time, you'll be working in ``src/`` (PHP files) or ``config/`` As you
286-
keep reading, you'll learn what can be done inside each of these.
288+
Most of the time, you'll be working in ``src/``, ``templates/`` or ``config/``.
289+
As you keep reading, you'll learn what can be done inside each of these.
287290

288291
So what about the other directories in the project?
289292

reference/configuration/web_profiler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Configuration
2121
toolbar
2222
~~~~~~~
2323

24-
**type**: ``boolean`` **default**: ``true``
24+
**type**: ``boolean`` **default**: ``false``
2525

2626
It enables and disables the toolbar entirely. Usually you set this to ``true``
2727
in the ``dev`` and ``test`` environments and to ``false`` in the ``prod``

reference/forms/types/collection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ And update the template as follows:
212212
213213
<a href="#"
214214
class="add-another-collection-widget"
215-
data-list="#email-field-list>Add another email</a>
215+
data-list="#email-field-list">Add another email</a>
216216

217217
{# ... #}
218218
{{ form_end(form) }}

setup/file_permissions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ was writable. But that is no longer true! In Symfony 4, everything works automat
1515

1616
If you decide to store log files on disk, you *will* need to make sure your
1717
logs directory (e.g. ``var/log/``) is writable by your web server user and
18-
terminal user. One way this can be done is by using ``chmod 777 -R var/log/``.
18+
terminal user. One way this can be done is by using ``chmod -R 777 var/log/``.
1919
Just be aware that your logs are readable by any user on your production system.

setup/flex.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ manual steps:
195195

196196
.. code-block:: terminal
197197
198-
$ rm -fr /vendor/*
198+
$ rm -fr vendor/*
199199
$ composer install
200200
201201
#. No matter which of the previous steps you followed. At this point, you'll have

0 commit comments

Comments
 (0)