Skip to content

Remove horizontal scrollbar and other fixes #4909

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 5 commits into from
Mar 20, 2015
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 3 additions & 2 deletions components/using_components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If you know you need a specific version of the library, add that to the command:

.. code-block:: bash

$ composer require symfony/finder
$ composer require symfony/finder 2.6.2
Copy link
Member

Choose a reason for hiding this comment

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

-1. You should not use an exact match in your composer constraint (it means composer will never give you bug fixes until you ask for them explicitly). And Composer is smart enough to guess the best constraint based on the existing versions of the package. So most of the time, the best solution is to omit the version constraint entirely

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then in my opinion this whole block should be removed, as the text for example is about installing specific version of the library while providing the same code example as the one before. And without the version composer will install the best version not the specific one.

Copy link
Member

Choose a reason for hiding this comment

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

It seems that @ifdattic is right because the example is specifically about using exact dependency versions.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with removing this section. wdyt @xabbuh @weaverryan

Copy link
Member

Choose a reason for hiding this comment

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

I agree about removing it. This page is not about documenting all features of composer require, and specifying an exact match requirement is a mistake most of the time (you would want at least 2.6.* to allow getting bug fixes and security patches when running a composer update), so we should not show such example IMO

Copy link
Member

Choose a reason for hiding this comment

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

👍 for removing

Copy link
Member

Choose a reason for hiding this comment

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

ping @ifdattic can you please remvoe this section?


**3.** Write your code!

Expand All @@ -51,7 +51,8 @@ immediately::

// File example: src/script.php

// update this to the path to the "vendor/" directory, relative to this file
// update this to the path to the "vendor/"
// directory, relative to this file
require_once __DIR__.'/../vendor/autoload.php';

use Symfony\Component\Finder\Finder;
Expand Down
9 changes: 6 additions & 3 deletions cookbook/testing/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ Suppose the class you want to test looks like this::

public function calculateTotalSalary($id)
{
$employeeRepository = $this->entityManager->getRepository('AppBundle::Employee');
$employeeRepository = $this->entityManager
->getRepository('AppBundle::Employee');
$employee = $employeeRepository->find($id);

return $employee->getSalary() + $employee->getBonus();
Expand All @@ -74,15 +75,17 @@ it's easy to pass a mock object within a test::
->will($this->returnValue(1100));

// Now, mock the repository so it returns the mock of the employee
$employeeRepository = $this->getMockBuilder('\Doctrine\ORM\EntityRepository')
$employeeRepository = $this
->getMockBuilder('\Doctrine\ORM\EntityRepository')
->disableOriginalConstructor()
->getMock();
$employeeRepository->expects($this->once())
->method('find')
->will($this->returnValue($employee));

// Last, mock the EntityManager to return the mock of the repository
$entityManager = $this->getMockBuilder('\Doctrine\Common\Persistence\ObjectManager')
$entityManager = $this
->getMockBuilder('\Doctrine\Common\Persistence\ObjectManager')
->disableOriginalConstructor()
->getMock();
$entityManager->expects($this->once())
Expand Down
3 changes: 2 additions & 1 deletion cookbook/testing/profiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ the ``test`` environment)::
{
$client = static::createClient();

// Enable the profiler for the next request (it does nothing if the profiler is not available)
// Enable the profiler for the next request
// (it does nothing if the profiler is not available)
$client->enableProfiler();

$crawler = $client->request('GET', '/hello/Fabien');
Expand Down