Skip to content

Commit

Permalink
Use new autoloading rule
Browse files Browse the repository at this point in the history
Fixes example directory being affected in http-client.
  • Loading branch information
kelunik committed Dec 13, 2020
1 parent e8930dc commit 09a43ad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@

class Config extends PhpCsFixerConfig
{
private $src;

public function __construct()
{
parent::__construct('Amp');

$this->setRiskyAllowed(true);
$this->setLineEnding("\n");

if (\is_dir(dirname(__DIR__, 4) . '/src')) {
$this->src = dirname(__DIR__, 4) . '/src';
} elseif (\is_dir(dirname(__DIR__, 4) . '/lib')) {
$this->src = dirname(__DIR__, 4) . '/lib';
}
}

public function getRules(): array
Expand Down Expand Up @@ -41,7 +49,7 @@ public function getRules(): array
"php_unit_fqcn_annotation" => true,
"phpdoc_summary" => true,
"phpdoc_types" => true,
"psr4" => true,
"psr_autoloading" => $this->src,
"return_type_declaration" => ["space_before" => "none"],
"short_scalar_cast" => true,
"single_blank_line_before_namespace" => true,
Expand Down

0 comments on commit 09a43ad

Please sign in to comment.