Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Update PHP CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
back-2-95 committed Jun 3, 2021
1 parent 9df5bfd commit 313a4d6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ composer.lock
/tests/public
/tests/vendor
/tests/composer.lock
/.php-cs-fixer.cache
15 changes: 9 additions & 6 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<?php
$finder = \PhpCsFixer\Finder::create();
$finder

$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
])
->files()
->name('*.php');
return \PhpCsFixer\Config::create()

$config = new PhpCsFixer\Config();

return $config
->setUsingCache(true)
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'psr0' => true,
//'psr0' => true,
'align_multiline_comment' => true,
'dir_constant' => true,
'linebreak_after_opening_tag' => true,
'modernize_types_casting' => true,
'no_multiline_whitespace_before_semicolons' => true,
'multiline_whitespace_before_semicolons' => true,
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_superfluous_elseif' => true,
Expand All @@ -33,7 +36,7 @@
'phpdoc_types_order' => true,
'single_quote' => true,
'standardize_not_equals' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'include' => true,
'array_syntax' => [
'syntax' => 'short',
Expand Down
13 changes: 7 additions & 6 deletions src/Mona/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ public function checkForDrupalLibrary(PackageEvent $event)
* Get target package
*
* @param $operation
* @return Package
* @throws Exception
* @return Package
*/
protected function getTargetPackage($operation): Package
{
if ($operation instanceof InstallOperation) {
return $operation->getPackage();
} elseif ($operation instanceof UpdateOperation) {
}
if ($operation instanceof UpdateOperation) {
return $operation->getTargetPackage();
}

Expand Down Expand Up @@ -214,10 +215,10 @@ protected function preConfigureExtra()
if (!isset($this->extra['installer-paths'])) {
$this->extra['installer-paths'] = [
'vendor/drupal' => ['type:drupal-core'],
$webroot .'/sites/all/libraries/{$name}' => ["type:drupal-library"],
$webroot .'/sites/all/modules/contrib/{$name}' => ["type:drupal-module"],
$webroot .'/sites/all/themes/contrib/{$name}' => ["type:drupal-theme"],
$webroot .'/sites/all/drush/{$name}' => ["type:drupal-drush"],
$webroot .'/sites/all/libraries/{$name}' => ['type:drupal-library'],
$webroot .'/sites/all/modules/contrib/{$name}' => ['type:drupal-module'],
$webroot .'/sites/all/themes/contrib/{$name}' => ['type:drupal-theme'],
$webroot .'/sites/all/drush/{$name}' => ['type:drupal-drush'],
];
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/Mona/SymlinksFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

use Composer\Script\Event;
use Composer\Util\Filesystem;
use function dirname;
use Druidfi\Mona\Exception\InvalidArgumentException;
use Druidfi\Mona\Exception\LinkDirectoryException;
use Druidfi\Mona\Exception\SymlinksException;
use Exception;
use function dirname;
use function is_array;
use function is_string;
use RuntimeException;
Expand Down Expand Up @@ -39,8 +38,8 @@ public function __construct(Event $event, Filesystem $filesystem)

/**
* @param string $webroot
* @return Symlink[]
* @throws SymlinksException
* @return Symlink[]
*/
public function process(string $webroot): array
{
Expand Down Expand Up @@ -88,9 +87,9 @@ protected function getConfig(string $name, $link = null, $default = false): bool
* @param string $target
* @param array|string $linkData
*
* @return null|Symlink
* @throws InvalidArgumentException
* @throws LinkDirectoryException
* @return null|Symlink
*/
protected function processSymlink(string $target, $linkData)
{
Expand Down

0 comments on commit 313a4d6

Please sign in to comment.