Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Nov 11, 2023
1 parent 578ec02 commit 3cc9e40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ class Config implements \ArrayAccess, \JsonSerializable
{
/**
* Is config changed?
*
* @var bool
*/
protected $changed = false;
protected bool $changed = false;

/**
* Default configuration for project.
*
* @var array
*/
private $container = [
private array $container = [
'stubs' => [
'path' => 'ide/%version%/%namespace%/',
'stubs-run-after-generate' => false,
Expand Down Expand Up @@ -101,8 +97,6 @@ class Config implements \ArrayAccess, \JsonSerializable
];

/**
* Config constructor.
*
* @throws Exception
*/
public function __construct()
Expand All @@ -112,8 +106,6 @@ public function __construct()

/**
* Returns JSON representation of the project config.
*
* @return string
*/
public function __toString()
{
Expand All @@ -122,8 +114,6 @@ public function __toString()

/**
* Factory method to create a Config instance from the $_SERVER['argv'].
*
* @return Config
*/
public static function fromServer(): self
{
Expand Down Expand Up @@ -312,15 +302,13 @@ public function set($key, $value, $namespace = null)
/**
* Writes the configuration if it has been changed.
*/
public function dumpToFile()
public function dumpToFile(): void
{
file_put_contents('config.json', $this);
}

/**
* Specify data which should be serialized to JSON.
*
* @return array
*/
public function jsonSerialize(): array
{
Expand Down
2 changes: 2 additions & 0 deletions src/ConfigException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Zephir;

class ConfigException extends \Exception
Expand Down

0 comments on commit 3cc9e40

Please sign in to comment.