Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
codefix and stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
devuri committed Jul 31, 2022
1 parent aa82e23 commit 5861c58
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"psalm": "vendor/bin/psalm",
"psalm-secure": "vendor/bin/psalm --taint-analysis",
"psalm-info": "vendor/bin/psalm --show-info=true",
"psalm-fix-return": "vendor/bin/psalm --alter --issues=MissingReturnType",
"psalm-autofix": [
"composer install -q",
"vendor/bin/psalm --alter --issues=InvalidNullableReturnType,MismatchingDocblockReturnType,InvalidReturnType,InvalidFalsableReturnType,LessSpecificReturnType,MissingParamType"
Expand Down
3 changes: 3 additions & 0 deletions src/ConfigTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public function required( string $name ): void
}
}

/**
* @return null|string
*/
public static function get( string $name )
{
try {
Expand Down
8 changes: 4 additions & 4 deletions src/EnvConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function getEnvironment(): string
*
* @param bool $enable
*
* @return self
* @return static
*/
public function symfony_debug( bool $enable = false ): ConfigInterface
{
Expand Down Expand Up @@ -124,9 +124,9 @@ abstract public function debug(): ConfigInterface;
abstract public function site_url(): ConfigInterface;

/**
* DB settings.
* DB settings.
*
* @return self
* @return static
*/
public function database(): ConfigInterface
{
Expand Down Expand Up @@ -171,7 +171,7 @@ abstract public function autosave(): ConfigInterface;
/**
* Authentication Unique Keys and Salts.
*
* @return self
* @return static
*/
public function salts(): ConfigInterface
{
Expand Down
22 changes: 11 additions & 11 deletions src/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ public function __construct( string $path )
* Singleton.
*
* @param $path
*
* @return object
*/
public static function init( $path ): ConfigInterface
public static function init( string $path ): ConfigInterface
{
if ( ! isset( self::$instance ) ) {
self::$instance = new self( $path );
Expand All @@ -36,10 +34,12 @@ public static function init( $path ): ConfigInterface
}

/**
* Runs config setup with default setting.
* Runs config setup with default setting.
*
* @param null|array $environment .
* @param bool $setup .
*
* @return null|static
*/
public function config( $environment = null, $setup = true )
{
Expand Down Expand Up @@ -89,7 +89,7 @@ public function config( $environment = null, $setup = true )
/**
* Setting the environment type.
*
* @return ConfigInterface
* @return static
*/
public function environment(): ConfigInterface
{
Expand All @@ -107,7 +107,7 @@ public function environment(): ConfigInterface
/**
* Debug Settings.
*
* @return Setup
* @return static
*/
public function debug(): ConfigInterface
{
Expand Down Expand Up @@ -143,7 +143,7 @@ public function debug(): ConfigInterface
/**
* Site Url Settings.
*
* @return self
* @return static
*/
public function site_url(): ConfigInterface
{
Expand All @@ -156,7 +156,7 @@ public function site_url(): ConfigInterface
/**
* Optimize.
*
* @return self
* @return static
*/
public function optimize(): ConfigInterface
{
Expand All @@ -168,7 +168,7 @@ public function optimize(): ConfigInterface
/**
* Memory Settings.
*
* @return self
* @return static
*/
public function memory(): ConfigInterface
{
Expand All @@ -181,7 +181,7 @@ public function memory(): ConfigInterface
/**
* SSL.
*
* @return self
* @return static
*/
public function force_ssl(): ConfigInterface
{
Expand All @@ -194,7 +194,7 @@ public function force_ssl(): ConfigInterface
/**
* AUTOSAVE and REVISIONS.
*
* @return self
* @return static
*/
public function autosave(): ConfigInterface
{
Expand Down
5 changes: 5 additions & 0 deletions tests/stubs.php
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
<?php

define( 'APP_PATH', '/srv/users/dev/apps/example');
define( 'APP_CONTENT_DIR', APP_PATH . '/content');
define( 'CONTENT_DIR', '/content');
define( 'PUBLIC_WEB_DIR', APP_PATH . '/public');

0 comments on commit 5861c58

Please sign in to comment.