From 09a43ad9d544b9a51a4e8cd3ebc30c0a77b0f8b5 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sun, 13 Dec 2020 17:22:01 +0100 Subject: [PATCH] Use new autoloading rule Fixes example directory being affected in http-client. --- src/Config.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Config.php b/src/Config.php index f1b4f43..eb027e2 100644 --- a/src/Config.php +++ b/src/Config.php @@ -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 @@ -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,