Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Merge 01a8dde into 3b71012
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Jun 1, 2019
2 parents 3b71012 + 01a8dde commit b180cd5
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Expand Up @@ -48,5 +48,5 @@ $ php -v
If it's an error message or piece of code, use code block tags,
and make sure you provide the whole stack trace(s),
not just the first error message you can see.
More details here: https://github.com/sonata-project/SonataDatagridBundle/blob/2.x/CONTRIBUTING.md#issues
More details here: https://github.com/sonata-project/SonataDatagridBundle/blob/3.x/CONTRIBUTING.md#issues
-->
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Bug.md
Expand Up @@ -54,5 +54,5 @@ $ php -v
If it's an error message or piece of code, use code block tags,
and make sure you provide the whole stack trace(s),
not just the first error message you can see.
More details here: https://github.com/sonata-project/SonataDatagridBundle/blob/2.x/CONTRIBUTING.md#issues
More details here: https://github.com/sonata-project/SonataDatagridBundle/blob/3.x/CONTRIBUTING.md#issues
-->
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -6,9 +6,9 @@
<!--
Show us you choose the right branch.
Different branches are used for different things :
- 2.x is for everything backwards compatible, like patches, features and deprecation notices
- 3.x is for everything backwards compatible, like patches, features and deprecation notices
- master is for deprecation removals and other changes that cannot be done without a BC-break
More details here: https://github.com/sonata-project/SonataDatagridBundle/blob/2.x/CONTRIBUTING.md#the-base-branch
More details here: https://github.com/sonata-project/SonataDatagridBundle/blob/3.x/CONTRIBUTING.md#the-base-branch
-->
I am targeting this branch, because {reason}.

Expand Down
1 change: 1 addition & 0 deletions .php_cs.dist
Expand Up @@ -43,6 +43,7 @@ $rules = [
'@PHP71Migration:risky' => true,
'compact_nullable_typehint' => true,
'void_return' => null,
'static_lambda' => true,
'strict_comparison' => true,
'strict_param' => true,
'php_unit_strict' => true,
Expand Down
7 changes: 4 additions & 3 deletions .travis.yml
Expand Up @@ -5,11 +5,12 @@
branches:
only:
- master
- 2.x
- 3.x

language: php

php:
- '7.1'
- '7.2'
- '7.3'
- nightly
Expand All @@ -29,7 +30,7 @@ cache:
env:
global:
- PATH="$HOME/.local/bin:$PATH"
- SYMFONY_DEPRECATIONS_HELPER=weak_vendors
- SYMFONY_DEPRECATIONS_HELPER=max[self]=0
- TARGET=test
- UPSTREAM_URL=https://github.com/sonata-project/SonataDatagridBundle.git
- PHPUNIT_VERSION=7
Expand All @@ -41,7 +42,7 @@ matrix:
env: TARGET=docs
- php: '7.3'
env: TARGET=lint
- php: '7.2'
- php: '7.1'
env: COMPOSER_FLAGS="--prefer-lowest"
- php: '7.3'
env: SYMFONY=3.4.*
Expand Down
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Expand Up @@ -173,7 +173,7 @@ your work, please do another PR for that. In some rare cases, you might be
forced to do it on the same PR. In this kind of situation, please add a comment
on your PR explaining why you feel it is the case.

#### The Change log
#### The Changelog

For each PR, a change log must be provided.

Expand Down Expand Up @@ -208,15 +208,15 @@ Here is a short table resuming on which you have to start:

Kind of modification | Backward Compatible (BC) | Type of release | Branch to target | Label |
-------------------- | ------------------------ | --------------- | ----------------------- | ----- |
Bug fixes | Yes | Patch | `2.x` | |
Bug fixes | Yes | Patch | `3.x` | |
Bug fixes | No (Only if no choice) | Major | `master` | |
Feature | Yes | Minor | `2.x` | |
Feature | Yes | Minor | `3.x` | |
Feature | No (Only if no choice) | Major | `master` | |
Deprecation | Yes (Have to) | Minor | `2.x` | |
Deprecation | Yes (Have to) | Minor | `3.x` | |
Deprecation removal | No (Can't be) | Major | `master` | |

Notes:
* Branch `2.x` is the branch of the **latest stable** minor release and
* Branch `3.x` is the branch of the **latest stable** minor release and
has to be used for Backward compatible PRs.
* If you PR is not **Backward Compatible** but can be, it **must** be:
* Changing a function/method signature? Prefer create a new one and deprecate the old one.
Expand Down Expand Up @@ -271,7 +271,7 @@ For class definitions, methods (or first level functions) and properties, use th

```php
/**
* @deprecated since 42.x, to be removed in 43.0. Use Shiny\New\ClassOfTheMonth instead.
* @deprecated since sonata-project/foo-lib 42.x, to be removed in 43.0. Use Shiny\New\ClassOfTheMonth instead.
*/
final class IAmOldAndUseless
{
Expand All @@ -280,12 +280,12 @@ final class IAmOldAndUseless
final class StillUsedClass
{
/**
* @deprecated since 42.x, to be removed in 43.0.
* @deprecated since sonata-project/foo-lib 42.x, to be removed in 43.0.
*/
public $butNotThisProperty;

/**
* @deprecated since 42.x, to be removed in 43.0.
* @deprecated since sonata-project/foo-lib 42.x, to be removed in 43.0.
*/
public function iAmBatman()
{
Expand All @@ -299,7 +299,7 @@ If the deprecated thing is a service, you **MUST** specify it on the service def
```xml
<service id="sonata.block.old" class="Sonata\Block\Old">
<argument type="service" id="security.token_storage" />
<deprecated>The "%service_id%" service is deprecated since 42.x and will be removed in 43.0.</deprecated>
<deprecated>The "%service_id%" service is deprecated since sonata-project/bar-bundle 42.x and will be removed in 43.0.</deprecated>
</service>
```

Expand All @@ -311,7 +311,7 @@ For everything else, not managed by the `@deprecated` tag, you **MUST** trigger
<?php
if (/* some condition showing the user is using the legacy way */) {
@trigger_error(
'The '.__METHOD__.' method is deprecated since 42.x, to be removed in 43.0. '.
'The '.__METHOD__.' method is deprecated since sonata-project/bar-bundle 42.x, to be removed in 43.0. '.
'Use FooClass::barMethod() instead.',
E_USER_DEPRECATED
);
Expand Down Expand Up @@ -551,7 +551,7 @@ but are encouraged to report release requests on the dedicated private Slack cha
Releasing software is the last step to getting your bugfixes or new features to your user base,
and should be done regularly, so that users are not tempted to use development branches.
To know what you are going to release on branch 42.x, given that the last release on this branch is 42.3.1,
go to `https://github.com/sonata-project/SonataCoreBundle/compare/42.3.1...42.x`.
go to `https://github.com/sonata-project/SonataAdminBundle/compare/42.3.1...42.x`.
You should see a list of commits, some of which should contain links to pull requests.

#### Determining the next release number
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -28,7 +28,7 @@
},
"require-dev": {
"doctrine/orm": "^2.4",
"symfony/phpunit-bridge": "^4.2"
"symfony/phpunit-bridge": "^4.3"
},
"config": {
"sort-packages": true
Expand Down
60 changes: 30 additions & 30 deletions tests/Datagrid/DatagridTest.php
Expand Up @@ -68,28 +68,28 @@ public function setUp(): void
$this->formBuilder
->expects($this->any())
->method('get')
->will($this->returnCallback(function ($name) {
->willReturnCallback(function ($name) {
if (isset($this->formTypes[$name])) {
return $this->formTypes[$name];
}
}));
});

$eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$formFactory = $this->createMock(FormFactoryInterface::class);

$this->formBuilder->expects($this->any())
->method('add')
->will($this->returnCallback(function ($name, $type, $options) use ($eventDispatcher, $formFactory): void {
->willReturnCallback(function ($name, $type, $options) use ($eventDispatcher, $formFactory): void {
$this->formTypes[$name] = new FormBuilder($name, TestEntity::class, $eventDispatcher, $formFactory, $options);
}));
});

$form = $this->createMock(Form::class);

$this->formBuilder->expects($this->any())
->method('getForm')
->will($this->returnCallback(function () use ($form) {
->willReturnCallback(static function () use ($form) {
return $form;
}));
});

$values = [];

Expand All @@ -109,7 +109,7 @@ public function testFilter(): void
$filter = $this->createMock(FilterInterface::class);
$filter->expects($this->once())
->method('getName')
->will($this->returnValue('foo'));
->willReturn('foo');

$this->datagrid->addFilter($filter);

Expand All @@ -129,17 +129,17 @@ public function testGetFilters(): void
$filter1 = $this->createMock(FilterInterface::class);
$filter1->expects($this->once())
->method('getName')
->will($this->returnValue('foo'));
->willReturn('foo');

$filter2 = $this->createMock(FilterInterface::class);
$filter2->expects($this->once())
->method('getName')
->will($this->returnValue('bar'));
->willReturn('bar');

$filter3 = $this->createMock(FilterInterface::class);
$filter3->expects($this->once())
->method('getName')
->will($this->returnValue('baz'));
->willReturn('baz');

$this->datagrid->addFilter($filter1);
$this->datagrid->addFilter($filter2);
Expand All @@ -159,17 +159,17 @@ public function testReorderFilters(): void
$filter1 = $this->createMock(FilterInterface::class);
$filter1->expects($this->once())
->method('getName')
->will($this->returnValue('foo'));
->willReturn('foo');

$filter2 = $this->createMock(FilterInterface::class);
$filter2->expects($this->once())
->method('getName')
->will($this->returnValue('bar'));
->willReturn('bar');

$filter3 = $this->createMock(FilterInterface::class);
$filter3->expects($this->once())
->method('getName')
->will($this->returnValue('baz'));
->willReturn('baz');

$this->datagrid->addFilter($filter1);
$this->datagrid->addFilter($filter2);
Expand Down Expand Up @@ -205,10 +205,10 @@ public function testHasActiveFilters(): void
$filter1 = $this->createMock(FilterInterface::class);
$filter1->expects($this->once())
->method('getName')
->will($this->returnValue('foo'));
->willReturn('foo');
$filter1->expects($this->any())
->method('isActive')
->will($this->returnValue(false));
->willReturn(false);

$this->datagrid->addFilter($filter1);

Expand All @@ -217,10 +217,10 @@ public function testHasActiveFilters(): void
$filter2 = $this->createMock(FilterInterface::class);
$filter2->expects($this->once())
->method('getName')
->will($this->returnValue('bar'));
->willReturn('bar');
$filter2->expects($this->any())
->method('isActive')
->will($this->returnValue(true));
->willReturn(true);

$this->datagrid->addFilter($filter2);

Expand All @@ -238,7 +238,7 @@ public function testGetResults(): void

$this->pager->expects($this->once())
->method('getResults')
->will($this->returnValue(['foo', 'bar']));
->willReturn(['foo', 'bar']);

$this->assertSame(['foo', 'bar'], $this->datagrid->getResults());
}
Expand All @@ -248,32 +248,32 @@ public function testBuildPager(): void
$filter1 = $this->createMock(FilterInterface::class);
$filter1->expects($this->once())
->method('getName')
->will($this->returnValue('foo'));
->willReturn('foo');
$filter1->expects($this->any())
->method('getFormName')
->will($this->returnValue('fooFormName'));
->willReturn('fooFormName');
$filter1->expects($this->any())
->method('isActive')
->will($this->returnValue(false));
->willReturn(false);
$filter1->expects($this->any())
->method('getRenderSettings')
->will($this->returnValue(['foo1', ['bar1' => 'baz1']]));
->willReturn(['foo1', ['bar1' => 'baz1']]);

$this->datagrid->addFilter($filter1);

$filter2 = $this->createMock(FilterInterface::class);
$filter2->expects($this->once())
->method('getName')
->will($this->returnValue('bar'));
->willReturn('bar');
$filter2->expects($this->any())
->method('getFormName')
->will($this->returnValue('barFormName'));
->willReturn('barFormName');
$filter2->expects($this->any())
->method('isActive')
->will($this->returnValue(true));
->willReturn(true);
$filter2->expects($this->any())
->method('getRenderSettings')
->will($this->returnValue(['foo2', ['bar2' => 'baz2']]));
->willReturn(['foo2', ['bar2' => 'baz2']]);

$this->datagrid->addFilter($filter2);

Expand All @@ -299,16 +299,16 @@ public function testBuildPagerWithSortBy(): void
$filter = $this->createMock(FilterInterface::class);
$filter->expects($this->once())
->method('getName')
->will($this->returnValue('foo'));
->willReturn('foo');
$filter->expects($this->any())
->method('getFormName')
->will($this->returnValue('fooFormName'));
->willReturn('fooFormName');
$filter->expects($this->any())
->method('isActive')
->will($this->returnValue(false));
->willReturn(false);
$filter->expects($this->any())
->method('getRenderSettings')
->will($this->returnValue(['foo', ['bar' => 'baz']]));
->willReturn(['foo', ['bar' => 'baz']]);

$this->datagrid->addFilter($filter);

Expand Down

0 comments on commit b180cd5

Please sign in to comment.