Skip to content

Commit

Permalink
Add default value ContainerConfig::withStrictMode() and `ContainerC…
Browse files Browse the repository at this point in the history
…onfig::withValidate()` (#376)
  • Loading branch information
vjik authored Oct 14, 2024
1 parent 1ab3bed commit b24581d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
- Enh #356: Improve usage `NotFoundException` for cases with definitions (@vjik)
- Enh #364: Minor refactoring to improve performance of container (@samdark)
- Enh #375: Raise minimum PHP version to `^8.1` and refactor code (@vjik)
- Enh #376: Add default value `true` for parameter of `ContainerConfig::withStrictMode()` and
`ContainerConfig::withValidate()` methods (@vjik)

## 1.2.1 December 23, 2022

Expand Down
4 changes: 2 additions & 2 deletions src/ContainerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function getTags(): array
/**
* @param bool $validate Whether definitions should be validated immediately.
*/
public function withValidate(bool $validate): self
public function withValidate(bool $validate = true): self

Check warning on line 76 in src/ContainerConfig.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ /** * @param bool $validate Whether definitions should be validated immediately. */ - public function withValidate(bool $validate = true) : self + public function withValidate(bool $validate = false) : self { $new = clone $this; $new->validate = $validate;
{
$new = clone $this;

Check warning on line 78 in src/ContainerConfig.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function withValidate(bool $validate = true) : self { - $new = clone $this; + $new = $this; $new->validate = $validate; return $new; }
$new->validate = $validate;
Expand Down Expand Up @@ -106,7 +106,7 @@ public function getDelegates(): array
* @param bool $useStrictMode If the automatic addition of definition when class exists and can be resolved
* is disabled.
*/
public function withStrictMode(bool $useStrictMode): self
public function withStrictMode(bool $useStrictMode = true): self
{
$new = clone $this;
$new->useStrictMode = $useStrictMode;
Expand Down

0 comments on commit b24581d

Please sign in to comment.