Skip to content

Commit

Permalink
Improve php code style
Browse files Browse the repository at this point in the history
  • Loading branch information
francoispluchino committed Mar 28, 2023
1 parent f3901d6 commit b65a86e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions Asset/AssetManagerFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public function addManager(AssetManagerInterface $manager)
*
* @param null|string $manager The name of the asset manager
*
* @return AssetManagerInterface
*
* @throws RuntimeException When the asset manager does not exist
* @throws RuntimeException When the asset manager is not found
*
* @return AssetManagerInterface
*/
public function findManager($manager = null)
{
Expand All @@ -70,9 +70,9 @@ public function findManager($manager = null)
/**
* Find the available asset manager.
*
* @throws RuntimeException When no asset manager is found
*
* @return AssetManagerInterface
*
* @throws RuntimeException When no asset manager is found
*/
private function findAvailableManager()
{
Expand Down
2 changes: 1 addition & 1 deletion Asset/PnpmManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ protected function getUpdateCommand()
{
return $this->buildCommand('pnpm', 'update', 'update');
}
}
}
2 changes: 1 addition & 1 deletion Converter/SemverUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function createPattern($pattern)
$numVer2 = '('.$numVer.'\.'.$numVer.')';
$numVer3 = '('.$numVer.'\.'.$numVer.'\.'.$numVer.')';

return '/^'.'('.$numVer.'|'.$numVer2.'|'.$numVer3.')'.$pattern.'/';
return '/^('.$numVer.'|'.$numVer2.'|'.$numVer3.')'.$pattern.'/';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Foxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ public function solveAssets(Event $event)
* @param ProcessExecutor $executor The process executor
* @param Filesystem $fs The composer filesystem
*
* @throws RuntimeException When the asset manager is not found
*
* @return AssetManagerInterface
*
* @throws RuntimeException When the asset manager is not found
*/
protected function getAssetManager(IOInterface $io, Config $config, ProcessExecutor $executor, Filesystem $fs)
{
Expand Down
36 changes: 18 additions & 18 deletions Tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ protected function setUp(): void
public function getDataForGetConfig()
{
return array(
array('foo', 42, 42),
array('bar', 'foo', 'empty'),
array('baz', false, true),
array('test', 0, 0),
array('manager-bar', 23, 0),
array('manager-baz', 0, 0),
array('global-composer-foo', 90, 0),
array('global-composer-bar', 70, 0),
array('global-config-foo', 23, 0),
array('env-boolean', false, true, 'FOXY__ENV_BOOLEAN=false'),
array('env-integer', -32, 0, 'FOXY__ENV_INTEGER=-32'),
array('env-json', array('foo' => 'bar'), array(), 'FOXY__ENV_JSON="{"foo": "bar"}"'),
array('env-json-array', array(array('foo' => 'bar')), array(), 'FOXY__ENV_JSON_ARRAY="[{"foo": "bar"}]"'),
array('env-string', 'baz', 'foo', 'FOXY__ENV_STRING=baz'),
array('test-p1', 'def', 'def', null, array()),
array('test-p1', 'def', 'def', null, array('test-p1' => 'ok')),
array('test-p1', 'ok', null, null, array('test-p1' => 'ok')),
array('foo', 42, 42),
array('bar', 'foo', 'empty'),
array('baz', false, true),
array('test', 0, 0),
array('manager-bar', 23, 0),
array('manager-baz', 0, 0),
array('global-composer-foo', 90, 0),
array('global-composer-bar', 70, 0),
array('global-config-foo', 23, 0),
array('env-boolean', false, true, 'FOXY__ENV_BOOLEAN=false'),
array('env-integer', -32, 0, 'FOXY__ENV_INTEGER=-32'),
array('env-json', array('foo' => 'bar'), array(), 'FOXY__ENV_JSON="{"foo": "bar"}"'),
array('env-json-array', array(array('foo' => 'bar')), array(), 'FOXY__ENV_JSON_ARRAY="[{"foo": "bar"}]"'),
array('env-string', 'baz', 'foo', 'FOXY__ENV_STRING=baz'),
array('test-p1', 'def', 'def', null, array()),
array('test-p1', 'def', 'def', null, array('test-p1' => 'ok')),
array('test-p1', 'ok', null, null, array('test-p1' => 'ok')),
);
}

Expand Down Expand Up @@ -182,7 +182,7 @@ public function testGetConfig($key, $expected, $default = null, $env = null, arr
public function getDataForGetArrayConfig()
{
return array(
array('foo', array(), array()),
array('foo', array(), array()),
array('foo', array(42), array(42)),
array('foo', array(42), array(), array('foo' => array(42))),
);
Expand Down
4 changes: 2 additions & 2 deletions Tests/Util/AssetUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ public function getExtraData()
{
return array(
array(false, false),
array(true, false),
array(true, false),
array(false, true),
array(true, true),
array(true, true),
);
}

Expand Down
8 changes: 4 additions & 4 deletions Tests/Util/ConsoleUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public function testGetInputWithoutValidInput()
public function getPreferredInstallOptionsData()
{
return array(
array(false, false, 'auto', false),
array(false, true, 'auto', true),
array(true, false, 'source', false),
array(false, true, 'dist', false),
array(false, false, 'auto', false),
array(false, true, 'auto', true),
array(true, false, 'source', false),
array(false, true, 'dist', false),
);
}

Expand Down

0 comments on commit b65a86e

Please sign in to comment.