From bc05562f4a1de5a3048e0451fabb28a155374027 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 29 Jul 2024 15:39:12 +0900 Subject: [PATCH 1/3] docs: update outdated descriptions --- contributing/internals.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/contributing/internals.md b/contributing/internals.md index b49c9832d390..22829ba3e58d 100644 --- a/contributing/internals.md +++ b/contributing/internals.md @@ -13,13 +13,13 @@ projects outside of CodeIgniter. Basically, this means that any dependencies should be kept to a minimum. Any dependencies must be able to be passed into the constructor. If you do need to use one of the other core packages, you can create that in the constructor using the -`Services` class, as long as you provide a way for dependencies to +`service()` function, as long as you provide a way for dependencies to override that: ```php public function __construct(?Foo $foo = null) { - $this->foo = $foo ?? \Config\Services::foo(); + $this->foo = $foo ?? service('foo'); } ``` @@ -112,10 +112,9 @@ should generally match the package name. ## Autoloader -All files within the package should be added to -**system/Config/AutoloadConfig.php**, in the "classmap" property. This -is only used for core framework files, and helps to minimize file system -scans and keep performance high. +All source files within the **system/ThirdParty** should be added to +**system/Config/AutoloadConfig.php**, in the `$coreClassmap` property. This +is only used for loading the third party packages without Composer. ## Command-Line Support From 78ed34b255d2c6729243ff91583e72a6cef9ca8d Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 29 Jul 2024 15:39:34 +0900 Subject: [PATCH 2/3] docs: capitalize first letter --- contributing/internals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing/internals.md b/contributing/internals.md index 22829ba3e58d..124d19209ac8 100644 --- a/contributing/internals.md +++ b/contributing/internals.md @@ -23,7 +23,7 @@ override that: } ``` -## Type declarations +## Type Declarations PHP7 provides [Type declarations](https://www.php.net/manual/en/language.types.declarations.php) for method parameters and return types. Use it where possible. Return type From f5a265482a1f7c79544422e924fd1c10bcce39c9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 29 Jul 2024 15:39:55 +0900 Subject: [PATCH 3/3] docs: update phpstan command with composer scripts --- contributing/pull_request.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contributing/pull_request.md b/contributing/pull_request.md index 05e060f797ec..8e3b5ed9f419 100644 --- a/contributing/pull_request.md +++ b/contributing/pull_request.md @@ -260,7 +260,7 @@ PHPStan is expected to scan the entire framework by running this command in your terminal: ```console -vendor/bin/phpstan analyse +composer phpstan:check ``` See also: @@ -272,7 +272,7 @@ false positive and should be ignored, the baseline can be updated with the follo command: ```console -vendor/bin/phpstan analyze --generate-baseline phpstan-baseline.php +composer phpstan:baseline ``` #### Rector