Skip to content
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

Revert to php-cs-fixer 1.x and run fixer #927

Merged
merged 1 commit into from
May 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

use SLLH\StyleCIBridge\ConfigBridge;

require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php';

$headerString = <<<EOF
$header = <<<EOF
This file is part of the `liip/LiipImagineBundle` project.

(c) https://github.com/liip/LiipImagineBundle/graphs/contributors
Expand All @@ -22,9 +22,11 @@ For the full copyright and license information, please view the LICENSE.md
file that was distributed with this source code.
EOF;

$headerConfig = array( 'header_comment' => array( 'header' => $headerString ) );

$config = ConfigBridge::create();
$config->setRules(array_merge($config->getRules(), $headerConfig));
$config
->setRules(array_merge($config->getRules(), array(
'header_comment' => array('header' => $header)
)))
->setUsingCache(false);

return $config;
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public function addConfiguration(ArrayNodeDefinition $builder)
->arrayNode('data_root')
->beforeNormalization()
->ifString()
->then(function ($value) { return array($value); })
->then(function ($value) {
return array($value);
})
->end()
->treatNullLike(array())
->treatFalseLike(array())
Expand Down
6 changes: 0 additions & 6 deletions Imagine/Filter/PostProcessor/JpegOptimPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,9 @@ public function setStripAll($stripAll)
/**
* @param BinaryInterface $binary
*
* @uses JpegOptimPostProcessor::processWithConfiguration
*
* @throws ProcessFailedException
*
* @return BinaryInterface
*
* @see Implementation taken from Assetic\Filter\JpegoptimFilter
*/
public function process(BinaryInterface $binary)
{
Expand All @@ -132,8 +128,6 @@ public function process(BinaryInterface $binary)
* @throws ProcessFailedException
*
* @return BinaryInterface
*
* @see Implementation taken from Assetic\Filter\JpegoptimFilter
*/
public function processWithConfiguration(BinaryInterface $binary, array $options)
{
Expand Down
2 changes: 0 additions & 2 deletions Imagine/Filter/PostProcessor/MozJpegPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ public function setQuality($quality)
/**
* @param BinaryInterface $binary
*
* @uses MozJpegPostProcessor::processWithConfiguration
*
* @throws ProcessFailedException
*
* @return BinaryInterface
Expand Down
2 changes: 0 additions & 2 deletions Imagine/Filter/PostProcessor/OptiPngPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ public function process(BinaryInterface $binary)
* @throws ProcessFailedException
*
* @return BinaryInterface|Binary
*
* @see Implementation taken from Assetic\Filter\optipngFilter
*/
public function processWithConfiguration(BinaryInterface $binary, array $options)
{
Expand Down
2 changes: 0 additions & 2 deletions Imagine/Filter/PostProcessor/PngquantPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ public function setQuality($quality)
/**
* @param BinaryInterface $binary
*
* @uses PngquantPostProcessor::processWithConfiguration
*
* @throws ProcessFailedException
*
* @return BinaryInterface
Expand Down
2 changes: 1 addition & 1 deletion Tests/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ protected function createDataManagerMock()
* @param string[] $methods
* @param bool $constructorInvoke
* @param mixed[] $constructorParams
*
*
* @return \PHPUnit_Framework_MockObject_MockObject
*/
protected function createObjectMock($object, array $methods = array(), $constructorInvoke = false, array $constructorParams = array())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public function testCreateLoaderDefinitionOnCreate()

public function testCreateLoaderDefinitionOnCreateWithBundlesEnabledUsingMetadata()
{
$fooBundleRootPath = realpath(__DIR__ . '/../../../Functional/Fixtures/FooBundle');
$barBundleRootPath = realpath(__DIR__ . '/../../../Functional/Fixtures/BarBundle');
$fooBundleRootPath = realpath(__DIR__.'/../../../Functional/Fixtures/FooBundle');
$barBundleRootPath = realpath(__DIR__.'/../../../Functional/Fixtures/BarBundle');

$container = new ContainerBuilder();
$container->setParameter('kernel.bundles_metadata', array(
Expand All @@ -94,8 +94,8 @@ public function testCreateLoaderDefinitionOnCreateWithBundlesEnabledUsingMetadat

$expected = array(
'theDataRoot',
'LiipFooBundle' => $fooBundleRootPath . '/Resources/public',
'LiipBarBundle' => $barBundleRootPath . '/Resources/public',
'LiipFooBundle' => $fooBundleRootPath.'/Resources/public',
'LiipBarBundle' => $barBundleRootPath.'/Resources/public',
);

$this->assertEquals($expected, $container->getDefinition('liip_imagine.binary.loader.the_loader_name')->getArgument(2));
Expand Down Expand Up @@ -160,7 +160,7 @@ public function testCreateLoaderDefinitionOnCreateWithBundlesEnabledUsingMetadat
'enabled' => true,
'access_control_type' => 'whitelist',
'access_control_list' => array(
'LiipFooBundle'
'LiipFooBundle',
),
),
));
Expand Down
1 change: 0 additions & 1 deletion Tests/Imagine/Filter/FilterManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@ public function testApplyPostProcessorsWhenNotDefined()
*/
protected function createFilterLoaderInterfaceMock()
{
// $this->getMock()
return $this->createObjectMock('\Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface');
}
}
1 change: 0 additions & 1 deletion Tests/Imagine/Filter/Loader/ScaleFilterLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,4 @@ public function minNotScaleDataProvider()
array(array(600, 400), new Box(600, 400)),
);
}

}
1 change: 0 additions & 1 deletion Tests/Templating/ImagineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Liip\ImagineBundle\Tests\Templating\Helper;

use Liip\ImagineBundle\Imagine\Cache\CacheManager;
use Liip\ImagineBundle\Templating\ImagineExtension;
use Liip\ImagineBundle\Tests\AbstractTest;

Expand Down
2 changes: 1 addition & 1 deletion Utility/OptionsResolver/OptionsResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ private function setupResolverLegacy(BaseOptionsResolver $resolver)
$resolver->setAllowedTypes($this->allowedTypes);
$resolver->setNormalizers($this->normalizers);
}
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"aws/aws-sdk-php": "~2.4",
"doctrine/cache": "~1.1",
"doctrine/orm": "~2.3",
"friendsofphp/php-cs-fixer": "~2.0",
"friendsofphp/php-cs-fixer": "~1.0",
"phpunit/phpunit": "~4.3|~5.0",
"psr/log": "~1.0",
"satooshi/php-coveralls": "~1.0",
Expand Down