Skip to content

Commit

Permalink
Update php-cs-fixer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgarlag committed Nov 27, 2017
1 parent b9f22ce commit f99aaa0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
32 changes: 16 additions & 16 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;

Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);

return Symfony\CS\Config\Config::create()
->setUsingCache(true)
// use default SYMFONY_LEVEL and extra fixers:
->fixers(array(
'-psr0',
'header_comment',
'newline_after_open_tag',
'ordered_use',
'phpdoc_order',
'strict',
'strict_param',
))
->finder(
Symfony\CS\Finder\DefaultFinder::create()
return \PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(
[
'@Symfony' => true,
'array_syntax' => array('syntax' => 'long'),
'header_comment' => array('header' => $header),
'ordered_imports' => true,
'phpdoc_order' => true,
'psr4' => true,
'strict_comparison' => true,
'strict_param' => true,
]
)
->setFinder(
\PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
)
;
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Changed
- Optimized symlink to package matching
- Update php-cs-fixer configuration

## [0.2.0] - 2016-05-27

Expand Down
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
"require": {
"composer/composer": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2"
},
"autoload": {
"psr-4": {
"Ajgl\\Composer\\": "src/"
}
},
"scripts": {
"fix-cs": "vendor/bin/php-cs-fixer fix"
},
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
Expand Down
4 changes: 2 additions & 2 deletions src/ScriptSymlinker.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public static function createSymlinks(Event $event)

foreach ($symlinks as $packageName => $symlinkDefinitions) {
$package = $event->getComposer()->getRepositoryManager()->getLocalRepository()->findPackage($packageName, '*');
if ($package !== null) {
if (null !== $package) {
$packageDir = $event->getComposer()->getInstallationManager()->getInstallPath($package);

foreach ($symlinkDefinitions as $target => $link) {
if ($fs->isAbsolutePath($target)) {
throw new \InvalidArgumentException(
Expand Down

0 comments on commit f99aaa0

Please sign in to comment.