Commit Graph

37663 Commits

Author SHA1 Message Date
Fabien Potencier
cc170ebc33 feature #27891 [Finder] Allow arrays as parameters of some methods for better fluent experience and code readability (jfredon)
This PR was squashed before being merged into the 4.2-dev branch (closes #27891).

Discussion
----------

[Finder] Allow arrays as parameters of some methods for better fluent experience and code readability

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | symfony/symfony-docs#10038

Makes the Finder library a little more convenient to use by allowing the use of arrays as parameters of methods that can be called multiple times.

This way of doing things was already present for the `Finder::in()` and `Finder::exclude()` methods, it has been extended to other methods that can be called several times to cumulate their effects.
This allows a better use of fluent methods by avoiding breaking the chaining to iterate on array variables (a little more complexity in the Finder library for less complexity in applications that uses it).

```php
// we could use
$finder = Finder::create()->in($fileRepository)->name($fileList);

// instead of
$finder = Finder::create()->in($fileRepository);
foreach ($fileList as $file) {
    $finder->name($file);
}
```

In `.php_cs` files, this would make the code more readable by separating the configuration of the execution code:

```php
<?php
const RULES = [
    '@Symfony' => true,
    '@Symfony:risky' => true,
];
const EXCLUDED_DIRS = [
    // directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
    'Symfony/Component/Cache/Tests/Marshaller/Fixtures',
    'Symfony/Component/DependencyInjection/Tests/Fixtures',
    // ...
];
const EXCLUDED_FILES = [
    // file content autogenerated by `var_export`
    'Symfony/Component/Translation/Tests/fixtures/resources.php',
    // test template
    'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php',
    // ...
];

return PhpCsFixer\Config::create()
    ->setRules(RULES)
    ->setRiskyAllowed(true)
    ->setFinder(
        PhpCsFixer\Finder::create()
            ->in(__DIR__.'/src')
            ->append(array(__FILE__))
            ->exclude(EXCLUDED_DIRS)
            ->notPath(EXCLUDED_FILES)
    )
;
```

TODO
- [x] complete the tests to validate the new syntax on all modified methods
- [x] submit changes to the Finder documentation

Commits
-------

ad97cd7121 [Finder] Allow arrays as parameters of some methods for better fluent experience and code readability
2018-07-16 14:56:49 +02:00
Julien Fredon
ad97cd7121 [Finder] Allow arrays as parameters of some methods for better fluent experience and code readability 2018-07-16 14:56:42 +02:00
Fabien Potencier
eb112a5288 feature #27829 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor (dunglas)
This PR was squashed before being merged into the 4.2-dev branch (closes #27829).

Discussion
----------

[DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  |no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

As explained by @stof in https://github.com/symfony/symfony/pull/27735#discussion_r199797412, injecting the `ClassMetadataFactory` directly can lead to issues when resetting the EntityManager.

This PR deprecates this usage and encourages to inject the entity manager directly.

Commits
-------

3aab4a1270 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor
2018-07-13 22:22:21 +02:00
Kévin Dunglas
3aab4a1270 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor 2018-07-13 22:22:15 +02:00
Fabien Potencier
e379146909 minor #27947 Rename Contract to Contracts (fabpot)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Rename Contract to Contracts

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

To avoid confusions between the composer name and the namespace.

Commits
-------

682836da9c renamed Contract to Contracts
2018-07-13 19:14:30 +02:00
Fabien Potencier
682836da9c renamed Contract to Contracts 2018-07-13 19:06:58 +02:00
Fabien Potencier
1e16a8b979 feature #27093 Add symfony/contracts: a set of abstractions extracted out of the Symfony components (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Add symfony/contracts: a set of abstractions extracted out of the Symfony components

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | -
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

A set of abstractions extracted out of the Symfony components.

This is a topic I've been thinking about for a long time. I feel like the time has come for Symfony to publish some abstractions so that people could build on them in a decoupled way.
I've identified interfaces in some components that would greatly benefit from being moved out from the components where they are for now. E.g. #26929 is something that has a broader scope than the Cache component itself.

By putting them in a new `symfony/abstractions` package, we would allow more innovation in the Symfony community, at the abstraction level.

In order to start small, I propose only one interface that gathers a concept that is shared amongst many components already: `ResetInterface`. It would provide a standard `reset()` method, whose purpose is to set an object back to its initial state, allowing it to be reused many times with no side effects/leaks related to its history. By this definition, it could also be autoconfigured (as done here, see update in FrameworkExtension). See wording in the docblock in the attached source code.

Ideally, I'd like this package to provide not only interfaces, by also generic traits, and reference test suites when possible. We could work on adding more abstractions during the 4.2 cycle. WDYT?

## Here is the attached README:

A set of abstractions extracted out of the Symfony components.

Can be used to build on semantics that the Symfony components proved useful - and
that already have battle tested implementations.

Design Principles
-----------------

 * contracts are split by domain, each into their own sub-namespaces;
 * contracts are small and consistent sets of PHP interfaces, traits, normative
   docblocks and reference test suites when applicable, etc.;
 * all contracts must have a proven implementation to enter this repository;
 * they must be backward compatible with existing Symfony components.

FAQ
---

### How to use this package?

The abstractions in this package are useful to achieve loose coupling and
interoperability. By using the provided interfaces as type hints, you are able
to reuse any implementations that match their contracts. It could be a Symfony
component, or another one provided by the PHP community at large.

Depending on their semantics, some interfaces can be combined with autowiring to
seamlessly inject a service in your classes.

Others might be useful as labeling interfaces, to hint about a specific behavior
that could be enabled when using autoconfiguration or manual service tagging (or
any other means provided by your framework.)

### How is this different from PHP-FIG's PSRs?

When applicable, the provided contracts are built on top of PHP-FIG's PSR. We
encourage relying on them and won't duplicate the effort. Still, the FIG has
different goals and different processes. Here, we don't need to seek universal
standards. Instead, we're providing abstractions that are compatible with the
implementations provided by Symfony. This should actually also contribute
positively to the PHP-FIG (from which Symfony is a member), by hinting the group
at some abstractions the PHP world might like to take inspiration from.

### Why isn't this package split into several packages?

Putting all interfaces in one package eases discoverability and dependency
management. Instead of dealing with a myriad of small packages and the
corresponding matrix of versions, you just need to deal with one package and one
version. Also when using IDE autocompletion or just reading the source code, it
makes it easier to figure out which contracts are provided.

There are two downsides to this approach: you may have unused files in your
`vendor/` directory, and in the future, it will be impossible to use two
different sub-namespaces in different major versions of the package. For the
"unused files" downside, it has no practical consequences: their file sizes are
very small, and there is no performance overhead at all since they are never
loaded. For major versions, this package follows the Symfony BC + deprecation
policies, with an additional restriction to never remove deprecated interfaces.

Resources
---------

  * [Documentation](https://symfony.com/doc/current/components/contracts.html)
  * [Contributing](https://symfony.com/doc/current/contributing/index.html)
  * [Report issues](https://github.com/symfony/symfony/issues) and
    [send Pull Requests](https://github.com/symfony/symfony/pulls)
    in the [main Symfony repository](https://github.com/symfony/symfony)

Commits
-------

898203649f Added symfony/contracts: a set of abstractions extracted out of the components
2018-07-13 13:25:15 +02:00
Fabien Potencier
5e28ac3150 minor #27931 [SecurityBundle] fix tests (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[SecurityBundle] fix tests

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27878
| License       | MIT
| Doc PR        |

Commits
-------

e69fac4c89 [SecurityBundle] fix tests
2018-07-12 11:49:17 +02:00
Christian Flothmann
e69fac4c89 [SecurityBundle] fix tests 2018-07-12 10:05:19 +02:00
Fabien Potencier
20070b72ac feature #27807 Added new methods submitForm and clickLink to Client class (nowiko)
This PR was squashed before being merged into the 4.2-dev branch (closes #27807).

Discussion
----------

Added new methods submitForm and clickLink to Client class

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Added new methods to BrowserKit/Client to simplify work with links and forms.
Related to https://github.com/symfony/symfony/issues/27627

Commits
-------

e098eddc96 Added new methods submitForm and clickLink to Client class
2018-07-12 09:05:27 +02:00
Viktor Novikov
e098eddc96 Added new methods submitForm and clickLink to Client class 2018-07-12 09:05:20 +02:00
Fabien Potencier
3f663fdfbb minor #27878 improve deprecation messages (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

improve deprecation messages

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

1657b82c19 improve deprecation messages
2018-07-12 08:18:35 +02:00
Fabien Potencier
c85134c9c1 feature #27879 [Routing] deprecate non string requirement names (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Routing] deprecate non string requirement names

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Basically, this will help catching wrong `@Route` annotation configurations like the following which can lead to hard to debug issues:

```php
@Route("/{foo}", requirements={"foo", "bar"})
```

Commits
-------

8bb5266553 deprecate non string requirement names
2018-07-11 17:44:02 +02:00
Fabien Potencier
df26feaa22 feature #26933 [Console] Add title table (maidmaid)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Console] Add title table

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | /
| License       | MIT
| Doc PR        | /

Why not just add a title to console tables? Inspired by the famous file manager [Midnight Commander](https://en.wikipedia.org/wiki/Midnight_Commander).

![screenshot from 2018-04-15 20-16-26](https://user-images.githubusercontent.com/4578773/38777361-eb6aaa72-40e9-11e8-8ae4-055fe80272c3.png)

Commits
-------

6bf9eeb14e Add title table
2018-07-11 11:58:49 +02:00
Dany Maillard
6bf9eeb14e Add title table 2018-07-11 11:50:52 +02:00
Nicolas Grekas
898203649f Added symfony/contracts: a set of abstractions extracted out of the components 2018-07-11 10:17:42 +02:00
Christian Flothmann
039c4d4f6b fix typo 2018-07-11 09:48:45 +02:00
Nicolas Grekas
3cfdc9e9d7 minor fixes 2018-07-09 17:54:21 +02:00
Fabien Potencier
a5709ee9ba feature #27697 [ProxyManagerBridge][DI] allow proxifying interfaces with "lazy: Some\ProxifiedInterface" (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[ProxyManagerBridge][DI] allow proxifying interfaces with "lazy: Some\ProxifiedInterface"

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20656
| License       | MIT
| Doc PR        | -

By adding `<tag name="proxy" interface="Some\ProxifiedInterface" />` to your service definitions, this PR allows generating interface-based proxies.

This would allow two things:
- generating lazy proxies for final classes
- wrapping a service into such proxy to forbid using the methods that are on a specific implementation but not on some interface - the proxy acting as a safe guard.

The generated proxies are always lazy, so that lazy=true/false makes no difference.

As a shortcut, you can also use `lazy: Some\ProxifiedInterface` to do the same (yaml example this time.)

Commits
-------

1d9f1d1b70 [ProxyManagerBridge][DI] allow proxifying interfaces with "lazy: Some\ProxifiedInterface"
2018-07-09 16:47:21 +02:00
Nicolas Grekas
1d9f1d1b70 [ProxyManagerBridge][DI] allow proxifying interfaces with "lazy: Some\ProxifiedInterface" 2018-07-09 16:45:45 +02:00
Fabien Potencier
f20eaf26c2 feature #27645 [Cache] Add MarshallerInterface allowing to change the serializer, providing a default one that automatically uses igbinary when available (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Add `MarshallerInterface` allowing to change the serializer, providing a default one that automatically uses igbinary when available

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #19895
| License       | MIT
| Doc PR        | -

With this PR, when igbinary is available, it is automatically used to serialize values.
This provides faster and smaller cache payloads.
The unserializing logic is autoadaptative:
- when an igbinary-serialized value is unserialized but the extension is missing, a cache miss is triggered
- when a natively-serialized value is unserialized and the extension is available, the native `unserialize()` is used

Ping @palex-fpt since you provided very useful comments on the topic and might be interested in reviewing here also.

Commits
-------

9c328c4894 [Cache] Add `MarshallerInterface` allowing to change the serializer, providing a default one that automatically uses igbinary when available
2018-07-09 16:39:33 +02:00
Nicolas Grekas
2345d0c2cf [Cache] update docblock of PdoAdapter/PdoCache 2018-07-09 16:30:01 +02:00
Fabien Potencier
cbda6a3c72 feature #27694 [FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

* Allowed configuring PDO-based cache pools via a new `cache.adapter.pdo` abstract service
* added automatic table creation when using Doctrine DBAL with PDO-based backends

Commits
-------

1484117430 [FrameworkBundle][Cache] Allow configuring PDO-based cache pools, with table auto-creation on first use
2018-07-09 16:21:08 +02:00
Fabien Potencier
254f4c8f7f feature #27774 [FrameworkBundle] allow turning routes to utf8 mode by default (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] allow turning routes to utf8 mode by default

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This allows building optimized routers that match in a single regexp instead of an alternate of utf8/non-utf8 set of routes.

Commits
-------

8f359cc047 [FrameworkBundle] allow turning routes to utf8 mode by default
2018-07-09 16:14:24 +02:00
Fabien Potencier
10e15dca66 feature #27821 [Process][Console] deprecated defining commands as strings (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Process][Console] deprecated defining commands as strings

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #27796
| License       | MIT
| Doc PR        | -

 * Added the `Process::fromShellCommandline()` static constructor to define shell command-lines
 * Allowed passing commands as `array($process, 'ENV_VAR' => 'value')` to `ProcessHelper::run()`
 * Deprecated passing commands as strings when creating a `Process` instance.
 * Deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods.
 * Deprecated passing a command as a string to `ProcessHelper::run()`, pass it the command as an array of arguments instead.
 * Made the `ProcessHelper` class final

Commits
-------

8895bc1b5b [Process][Console] deprecated defining commands as strings
2018-07-09 16:07:29 +02:00
Fabien Potencier
8d35af4a51 minor #27845 [DI] Improve exception messages by hiding the hidden ids they contain (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DI] Improve exception messages by hiding the hidden ids they contain

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27822
| License       | MIT
| Doc PR        | -

This PR improves error messages containing hidden ids, especially the ones mentioning service locators.

Right now, when a service subscriber is incomplete, we get:
> The service ".service_locator.G69Xsbl.App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".

With this PR we get this instead:
> The service "routing.loader" in the container provided to "App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".

When no locators are involved, the hidden service is swallowed:
> The service "App\Controller\MyRouter" has a dependency on a non-existent service "Symfony\Component\Config\Loader\LoaderInterface".

This PR also improves runtime exceptions thrown in service locators.

Before:
> Cannot autowire service ".service_locator.Z1jvVrN": it references interface "Symfony\Component\Config\Loader\LoaderInterface" but no such service exists. You should maybe alias this interface to one of these existing services: [...].

After:
> Cannot autowire service "routing.loader" required by "App\Controller\MyRouter": it references interface "Symfony\Component\Config\Loader\LoaderInterface" but no such service exists. You should maybe alias this interface to one of these existing services: [...].

TODO:
- [x] add tests.

Commits
-------

d2b4901a43 [DI] Improve exception messages by hiding the hidden ids they contain
2018-07-09 16:06:18 +02:00
Christian Flothmann
8bb5266553 deprecate non string requirement names 2018-07-09 15:38:45 +02:00
Nicolas Grekas
88f063ddb4 Merge branch '4.1'
* 4.1:
  [Filesystem] fix lock file mode
  [Console] fix typo in phpdoc
  improve deprecation messages
2018-07-09 15:30:59 +02:00
Nicolas Grekas
bbe3ce88d7 minor #27877 improve deprecation messages (xabbuh)
This PR was merged into the 4.1 branch.

Discussion
----------

improve deprecation messages

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

e4ae5a4ca9 improve deprecation messages
2018-07-09 15:27:57 +02:00
Nicolas Grekas
2b860d515f Merge branch '4.0' into 4.1
* 4.0:
  [Filesystem] fix lock file mode
  [Console] fix typo in phpdoc
2018-07-09 15:27:18 +02:00
Nicolas Grekas
dd16e10a7b Merge branch '3.4' into 4.0
* 3.4:
  [Filesystem] fix lock file mode
  [Console] fix typo in phpdoc
2018-07-09 15:26:23 +02:00
Nicolas Grekas
08b7874a08 Merge branch '2.8' into 3.4
* 2.8:
  [Filesystem] fix lock file mode
  [Console] fix typo in phpdoc
2018-07-09 15:25:43 +02:00
Nicolas Grekas
881c46aadd [Filesystem] fix lock file mode 2018-07-09 15:24:25 +02:00
Nicolas Grekas
b67c26c2ef Merge branch '4.1'
* 4.1:
  [Filesystem] fix lock file permissions
  [Lock] fix lock file permissions
  [Form] Removed .form-control-label class.
  Removed .mb-0 in errors.
  Fix the detection of the Process new argument
  add @xabbuh as a code owner of the Yaml component
  improve deprecation messages
  Replace .initialism with .text-uppercase.
2018-07-09 15:05:12 +02:00
Nicolas Grekas
e3bdbed513 minor #27777 [Console] fix typo in phpdoc (Tobion)
This PR was merged into the 2.8 branch.

Discussion
----------

[Console] fix typo in phpdoc

| Q             | A
| ------------- | ---
| Branch?       | 4.1 (#26847)
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

7aa45579d5 [Console] fix typo in phpdoc
2018-07-09 14:59:54 +02:00
Tobias Schultze
7aa45579d5 [Console] fix typo in phpdoc 2018-07-09 14:58:09 +02:00
Nicolas Grekas
cfe319c4e8 Merge branch '4.0' into 4.1
* 4.0:
  [Filesystem] fix lock file permissions
  [Lock] fix lock file permissions
  [Form] Removed .form-control-label class.
  Removed .mb-0 in errors.
  Fix the detection of the Process new argument
  add @xabbuh as a code owner of the Yaml component
  improve deprecation messages
  Replace .initialism with .text-uppercase.
2018-07-09 14:52:53 +02:00
Nicolas Grekas
72141443ad Merge branch '3.4' into 4.0
* 3.4:
  [Filesystem] fix lock file permissions
  [Lock] fix lock file permissions
  [Form] Removed .form-control-label class.
  Removed .mb-0 in errors.
  Fix the detection of the Process new argument
  add @xabbuh as a code owner of the Yaml component
  Replace .initialism with .text-uppercase.
2018-07-09 14:50:05 +02:00
Nicolas Grekas
69509728c4 Merge branch '2.8' into 3.4
* 2.8:
  [Filesystem] fix lock file permissions
  add @xabbuh as a code owner of the Yaml component
2018-07-09 14:47:47 +02:00
Nicolas Grekas
66b9ebcda5 bug #27904 [Filesystem] fix lock file permissions (fritzmg)
This PR was squashed before being merged into the 2.8 branch (closes #27904).

Discussion
----------

[Filesystem] fix lock file permissions

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | see linked discussion
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

See https://github.com/symfony/symfony/pull/27903

Commits
-------

7a68fea2af [Filesystem] fix lock file permissions
2018-07-09 14:47:26 +02:00
fritzmg
7a68fea2af [Filesystem] fix lock file permissions 2018-07-09 14:47:20 +02:00
Nicolas Grekas
608cf7f1b7 bug #27903 [Lock] fix lock file permissions (fritzmg)
This PR was squashed before being merged into the 3.4 branch (closes #27903).

Discussion
----------

[Lock] fix lock file permissions

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | see discussion below
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

See [this comment](https://github.com/symfony/symfony/pull/27668#issuecomment-403392924). Since we are using `r+` now to fix an issue on Solaris, we also need to change the file permissions when the lock file is created for the first time. Otherwise
```php
fopen($fileName, 'r+')
```
will fail due to the file permissions and while
```php
fopen($fileName, 'r')
```
will work, the subsequent locking will again fail on Solaris.

Changing the file permissions to `0666` fixes this issue. __However__ any lock file that was generated _prior_ to this change will still cause issues and would need to be manually deleted. Usually the default `sys_get_temp_dir()` location is used for the lock files and _usually_ these files are purged periodically, so it probably won't matter that much. But it still might cause some confusion since it will not be transparent, why the file lock failed on Solaris systems.

Commits
-------

23481a112e [Lock] fix lock file permissions
2018-07-09 14:45:49 +02:00
fritzmg
23481a112e [Lock] fix lock file permissions 2018-07-09 14:45:36 +02:00
Nicolas Grekas
4849c01690 minor #27882 [MonologBridge] Prefer PSR-3 to interact with Monolog in tests (derrabus)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[MonologBridge] Prefer PSR-3 to interact with Monolog in tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | part of #27857
| License       | MIT
| Doc PR        | N/A

This PR changes tests in the Monolog bridge:
* Calls to `Logger::addInfo()` are changed to `Logger::info()`.
* The return value of `Logger::debug()`, `Logger::info()`, `Logger::notice()`, `Logger::warning()`, `Logger::error()` etc. is no longer asserted to be `true`.

This way, the tests only use PSR-3 compatible code to interact with the logger, which makes them forward-compatible with the changes in Monolog 2.

Commits
-------

78498d3b81 Prefer PSR-3 to interact with Monolog in tests.
2018-07-09 14:44:35 +02:00
Nicolas Grekas
55ddaee7b1 minor #27886 [Form] Removed .form-control-label class. (vudaltsov)
This PR was squashed before being merged into the 3.4 branch (closes #27886).

Discussion
----------

[Form] Removed .form-control-label class.

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

There is no such a class neither in [bootstrap 4.0](https://getbootstrap.com/docs/4.0/components/forms/#form-controls) nor in [bootstrap 4.1](https://getbootstrap.com/docs/4.1/components/forms/#form-controls).

Commits
-------

cb3e712698 [Form] Removed .form-control-label class.
2018-07-09 14:42:10 +02:00
Valentin
cb3e712698 [Form] Removed .form-control-label class. 2018-07-09 14:42:04 +02:00
Nicolas Grekas
5c7495295b minor #27887 [Form] Removed .mb-0 in errors. (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Removed .mb-0 in errors.

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

`<span class="d-block">` will never have a margin on its own, so `.mb-0` is needless.

Commits
-------

925dda130e Removed .mb-0 in errors.
2018-07-09 14:39:50 +02:00
Valentin
925dda130e Removed .mb-0 in errors. 2018-07-09 14:38:55 +02:00
Nicolas Grekas
d5c765ad69 bug #27889 [Form] Replace .initialism with .text-uppercase. (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Replace .initialism with .text-uppercase.

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

I think that the `.initialism` [class](https://getbootstrap.com/docs/4.0/content/typography/#abbreviations) is for different purposes. While the `.text-uppercase` [class](https://getbootstrap.com/docs/4.0/utilities/text/#text-transform) is more neutral and does exactly what we want here.

Commits
-------

3c39dfdaa6 Replace .initialism with .text-uppercase.
2018-07-09 14:34:25 +02:00
Nicolas Grekas
0fcc874e6f bug #27902 Fix the detection of the Process new argument (stof)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix the detection of the Process new argument

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This fixes the detection of the new method signature when triggering the deprecation warning. The new `$env` parameter is the second argument, not the first one.

Commits
-------

57e95f3f9a Fix the detection of the Process new argument
2018-07-09 14:30:57 +02:00