Skip to content

Commit

Permalink
Support customized local configuration files for PHPStan and PHPUnit …
Browse files Browse the repository at this point in the history
…(#502)

* Support customized local configuration files for PHPStan and PHPUnit

* Optimize

* Fix return type declarations in Kafka and Log facades

* Refactor array and collection mixins

* Update type hint for process method in TaskHandleListener

* Update CacheInterface and Cache class

* Refactor ParameterParser class by removing unused code

* Refactor Etcd and Nacos drivers, and fix EnvWriter return statement

* Fix type hinting in exception handling functions

* Fix column value retrieval in FastPaginate.php

* Refactor validation rules in ValidationAspect.php

* Update helper functions and fix deprecated functions

* Refactor log writer to use null coalescing operator for default values

* Fix code formatting and remove unused code

* Update variable type in ResponseSequence class and fix factory function in Functions.php

* Fix code inconsistencies and improve code readability

* Update phpstan.neon.dist to include phpstan-baseline.neon

This commit updates the phpstan.neon.dist file to include the phpstan-baseline.neon file. The previous include statement for vendor/phpstan/phpstan-deprecation-rules/rules.neon has been commented out. This change ensures that the phpstan-baseline.neon file is included in the analysis performed by vendor/bin/phpstan.

* Update PHPStan configuration file

* Fix isInstanceCall method logic

* Refactor access log message formatting

---------

Co-authored-by: Deeka Wong <[email protected]>
  • Loading branch information
huangdijia and huangdijia authored Dec 20, 2023
1 parent eb397e3 commit 48e3d9d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/Driver/Etcd.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

use Hyperf\Collection\Arr;
use Hyperf\Contract\ConfigInterface;
use Hyperf\Contract\StdoutLoggerInterface;
use Hyperf\Etcd\V3\KV;
use Psr\Container\ContainerInterface;

use function Hyperf\Collection\collect;
use function Hyperf\Support\make;
Expand All @@ -24,7 +22,7 @@ class Etcd implements DriverInterface
{
private KV $client;

public function __construct(private ContainerInterface $container, private ConfigInterface $config, private StdoutLoggerInterface $logger)
public function __construct(private ConfigInterface $config)
{
$this->client = make(EtcdClient::class, [
'uri' => (string) $this->config->get('confd.drivers.etcd.client.uri', ''),
Expand Down
3 changes: 1 addition & 2 deletions src/Driver/Nacos.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Hyperf\Nacos\Application;
use Hyperf\Nacos\Config;
use InvalidArgumentException;
use Psr\Container\ContainerInterface;

use function Hyperf\Collection\collect;
use function Hyperf\Support\make;
Expand All @@ -28,7 +27,7 @@ class Nacos implements DriverInterface
{
private Application $client;

public function __construct(private ContainerInterface $container, private ConfigInterface $config, private StdoutLoggerInterface $logger)
public function __construct(private ConfigInterface $config, private StdoutLoggerInterface $logger)
{
$config = $this->config->get('confd.drivers.nacos.client') ?: $this->config->get('nacos', []);

Expand Down
2 changes: 1 addition & 1 deletion src/Writer/EnvWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function write(bool $force = false): bool
return true;
}

return file_put_contents($this->path, $this->content, LOCK_EX) !== false ?? true;
return file_put_contents($this->path, $this->content, LOCK_EX) !== false;
}

/**
Expand Down

0 comments on commit 48e3d9d

Please sign in to comment.