Skip to content

Commit

Permalink
Merge pull request #927 from robfrawley/bugfix-php-cs-fixer-rever-and…
Browse files Browse the repository at this point in the history
…-run

Revert to php-cs-fixer 1.x and run fixer
  • Loading branch information
cedricziel committed May 8, 2017
2 parents a109cfd + 80c85c6 commit 610d4f5
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 29 deletions.
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

0 comments on commit 610d4f5

Please sign in to comment.