Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1656,12 +1656,6 @@ parameters:
count: 16
path: src/Phaseolies/Support/Collection.php

-
message: '#^Comparison operation "\<" between int\<80500, 80599\> and 70300 is always false\.$#'
identifier: smaller.alwaysFalse
count: 1
path: src/Phaseolies/Support/CookieJar.php

-
message: '#^PHPDoc tag @return with type void is incompatible with native type bool\.$#'
identifier: return.phpDocType
Expand Down
21 changes: 0 additions & 21 deletions src/Phaseolies/Support/CookieJar.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,27 +148,6 @@ protected function setCookie(Cookie $cookie): bool
$options['partitioned'] = true;
}

if (PHP_VERSION_ID < 70300) {
// For PHP < 7.3
$path = $options['path'];
if (isset($options['samesite'])) {
$path .= '; samesite=' . $options['samesite'];
}
if (isset($options['partitioned'])) {
$path .= '; partitioned';
}
return setcookie(
$name,
$value,
$options['expires'],
$path,
$options['domain'],
$options['secure'],
$options['httponly']
);
}

// For PHP >= 7.3
return setcookie($name, $value, $options);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Phaseolies/Support/Facades/Abort.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Phaseolies\Support\Facades;

use Phaseolies\Facade\BaseFacade;

/**
* @method static \Phaseolies\Http\Support\RequestAbortion abort(int $code, string $message = '')
* @method static \Phaseolies\Http\Support\RequestAbortion abortIf(bool $condition, int $code, string $message = '')
* @method static void abort(int $code, string $message = '')
* @method static void abortIf(bool $condition, int $code, string $message = '')
*
* @see \Phaseolies\Http\Support\RequestAbortion
*/

use Phaseolies\Facade\BaseFacade;

class Abort extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
45 changes: 22 additions & 23 deletions src/Phaseolies/Support/Facades/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,31 @@

namespace Phaseolies\Support\Facades;

use Phaseolies\Facade\BaseFacade;

/**
* @method static \Phaseolies\Application langPath($path = ''): string
* @method static \Phaseolies\Application setBasePath(string $basePath): self
* @method static \Phaseolies\Application templatesPath($path = ''): string
* @method static \Phaseolies\Application bootstrapPath($path = ''): string
* @method static \Phaseolies\Application schemaPath($path = ''): string
* @method static \Phaseolies\Application publicPath($path = ''): string
* @method static \Phaseolies\Application storagePath($path = ''): string
* @method static \Phaseolies\Application appPath(): string
* @method static \Phaseolies\Application basePath(): string
* @method static \Phaseolies\Application configPath($path = ''): string
* @method static \Phaseolies\Application runningInConsole(): bool
* @method static \Phaseolies\Application hasBeenBootstrapped(): bool
* @method static \Phaseolies\Application isBooted(): bool
* @method static \Phaseolies\Application make($abstract, array $parameters = [])
* @method static \Phaseolies\Application getLocale(): string
* @method static \Phaseolies\Application currentLocale(): string
* @method static \Phaseolies\Application getFallbackLocale(): string
* @method static \Phaseolies\Application setLocale($locale): void
* @method static \Phaseolies\Application setFallbackLocale($fallbackLocale)
* @method static \Phaseolies\Application isLocale($locale): bool
* @method static string langPath($path = '')
* @method static string templatesPath($path = '')
* @method static string bootstrapPath($path = '')
* @method static string schemaPath($path = '')
* @method static string publicPath($path = '')
* @method static string storagePath($path = '')
* @method static string appPath()
* @method static string basePath()
* @method static string configPath($path = '')
* @method static bool runningInConsole()
* @method static bool hasBeenBootstrapped()
* @method static bool isBooted()
* @method static object|string make($abstract, array $parameters = [])
* @method static string getLocale()
* @method static string currentLocale()
* @method static string getFallbackLocale()
* @method static void setLocale($locale)
* @method static void setFallbackLocale($fallbackLocale)
* @method static bool isLocale($locale)
*
* @see \Phaseolies\Application
*/

use Phaseolies\Facade\BaseFacade;

class App extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
57 changes: 30 additions & 27 deletions src/Phaseolies/Support/Facades/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,39 @@

namespace Phaseolies\Support\Facades;

use Closure;
use Phaseolies\Facade\BaseFacade;
use Phaseolies\Cache\Lock\AtomicLock;

/**
* @method static \Phaseolies\Cache\CacheStore get($key, $default = null): mixed
* @method static \Phaseolies\Cache\CacheStore set($key, $value, $ttl = null): bool
* @method static \Phaseolies\Cache\CacheStore delete($key): bool
* @method static \Phaseolies\Cache\CacheStore clear(): bool
* @method static \Phaseolies\Cache\CacheStore getMultiple($keys, $default = null): iterable
* @method static \Phaseolies\Cache\CacheStore setMultiple($values, $ttl = null): bool
* @method static \Phaseolies\Cache\CacheStore deleteMultiple($keys): bool
* @method static \Phaseolies\Cache\CacheStore has($key): bool
* @method static \Phaseolies\Cache\CacheStore increment($key, $value = 1): int|bool
* @method static \Phaseolies\Cache\CacheStore decrement($key, $value = 1): int|bool
* @method static \Phaseolies\Cache\CacheStore forever($key, $value): bool
* @method static \Phaseolies\Cache\CacheStore forget($key)
* @method static \Phaseolies\Cache\CacheStore stash(string $key, $ttl, Closure $callback): mixed
* @method static \Phaseolies\Cache\CacheStore stashForever(string $key, Closure $callback): mixed
* @method static \Phaseolies\Cache\CacheStore stashWhen(string $key, Closure $callback, bool $condition, $ttl = null): mixed
* @method static locked(string $name, int $seconds = 10, ?string $owner = null): AtomicLock
* @method static restoreLock(string $name, string $owner): AtomicLock
* @method static \Phaseolies\Cache\Lock\AtomicLock get(): bool
* @method static \Phaseolies\Cache\Lock\AtomicLock block(int $seconds): bool
* @method static \Phaseolies\Cache\Lock\AtomicLock release(): bool
* @method static \Phaseolies\Cache\Lock\AtomicLock owner(): string
* @method static \Phaseolies\Cache\Lock\AtomicLock isOwnedByCurrentProcess(): bool
* @method static \Phaseolies\Cache\Lock\AtomicLock getOwner(): string
* @method static \Phaseolies\Cache\Lock\AtomicLock getName(): string
* @method static mixed get($key, $default = null)
* @method static bool set($key, $value, $ttl = null)
* @method static bool delete($key)
* @method static bool clear()
* @method static iterable getMultiple($keys, $default = null)
* @method static bool setMultiple($values, $ttl = null)
* @method static bool deleteMultiple($keys)
* @method static bool has($key)
* @method static int|bool increment($key, $value = 1)
* @method static int|bool decrement($key, $value = 1)
* @method static bool forever($key, $value)
* @method static bool forget($key)
* @method static mixed stash(string $key, $ttl, Closure $callback)
* @method static mixed stashForever(string $key, Closure $callback)
* @method static mixed stashWhen(string $key, Closure $callback, bool $condition, $ttl = null)
* @method static AtomicLock locked(string $name, int $seconds = 10, ?string $owner = null)
* @method static AtomicLock restoreLock(string $name, string $owner)
* @method static bool get()
* @method static bool block(int $seconds)
* @method static bool release()
* @method static string owner()
* @method static bool isOwnedByCurrentProcess()
* @method static string getOwner()
* @method static string getName()
*
* @see \Phaseolies\Cache\CacheStore
* @see \Phaseolies\Cache\Lock\AtomicLock
*/

use Phaseolies\Facade\BaseFacade;

class Cache extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
13 changes: 7 additions & 6 deletions src/Phaseolies/Support/Facades/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

namespace Phaseolies\Support\Facades;

use Phaseolies\Facade\BaseFacade;

/**
* @method static \Phaseolies\Config\Config set(string $key, mixed $value): void
* @method static \Phaseolies\Config\Config get(string $key, mixed $default = null): mixed
* @method static \Phaseolies\Config\Config all(): array
* @method static \Phaseolies\Config\Config clearCache(): void
* @method static void set(string $key, mixed $value)
* @method static mixed get(string $key, mixed $default = null)
* @method static array all()
* @method static void clearCache()
*
* @see \Phaseolies\Config\Config
*/
use Phaseolies\Facade\BaseFacade;

class Config extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
21 changes: 11 additions & 10 deletions src/Phaseolies/Support/Facades/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

namespace Phaseolies\Support\Facades;

use Phaseolies\Facade\BaseFacade;
use Phaseolies\Http\Response\Cookie as BrowserCookie;

/**
* @method static \Phaseolies\Support\CookieJar make(string $name, ?string $value = null, array $options = []): Cookie
* @method static \Phaseolies\Support\CookieJar get(string $key, $default = null)
* @method static \Phaseolies\Support\CookieJar has(string $key): bool
* @method static \Phaseolies\Support\CookieJar store($name, $value = null, array $options = []): bool
* @method static \Phaseolies\Support\CookieJar remove(string $name, array $options = []): void
* @method static \Phaseolies\Support\CookieJar forever(string $name, string $value, array $options = []): void
* @method static \Phaseolies\Support\CookieJar all(bool $decodeValues = true): array
* @method static BrowserCookie make(string $name, ?string $value = null, array $options = [])
* @method static mixed get(string $key, $default = null)
* @method static bool has(string $key)
* @method static bool store($name, $value = null, array $options = [])
* @method static void remove(string $name, array $options = [])
* @method static void forever(string $name, string $value, array $options = [])
* @method static array all(bool $decodeValues = true)
*
* @see \Phaseolies\Support\CookieJar
*/

use Phaseolies\Facade\BaseFacade;

class Cookie extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
9 changes: 5 additions & 4 deletions src/Phaseolies/Support/Facades/Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace Phaseolies\Support\Facades;

use Phaseolies\Facade\BaseFacade;

/**
* @method static \Phaseolies\Support\Encryption encrypt(mixed $payload): string
* @method static \Phaseolies\Support\Encryption decrypt(string $payload): string
* @method static string encrypt(mixed $payload)
* @method static mixed decrypt(string $payload)
*
* @see \Phaseolies\Support\Encryption
*/
use Phaseolies\Facade\BaseFacade;

class Crypt extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
62 changes: 34 additions & 28 deletions src/Phaseolies/Support/Facades/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,44 @@

namespace Phaseolies\Support\Facades;

use PDO;
use PDOStatement;
use Phaseolies\Facade\BaseFacade;
use Phaseolies\Database\Query\Builder;
use Phaseolies\Database\Entity\Model;
use Phaseolies\Support\Collection;

/**
* @method static getPdoInstance(?string $connection = null): PDO
* @method static beginTransaction(): void
* @method static commit(): void
* @method static rollBack(): void
* @method static transaction(\Closure $callback, int $attempts = 1)
* @method static transactionLevel(): int
* @method static getTableColumns(?string $table = null): array
* @method static dropAllTables(): int
* @method static table(string $table): Builder
* @method static getTables(): array
* @method static tableExists(string $table): bool
* @method static getTable(Model $model): string
* @method static getConnection(): PDO
* @method static procedure(string $procedureName,array $params = [],array $outputParams = []): \Phaseolies\Support\Collection
* @method static view(string $viewName, array $where = [], array $params = []): array
* @method static query(string $sql, array $params = []): \Phaseolies\Support\Collection
* @method static execute(string $sql, array $params = []): int
* @method static statement(string $sql, array $params = []): \PDOStatement
* @method static connection(?string $name = null): self
* @method static bucket(string $table): \Phaseolies\Database\Entity\Query\Builder
* @method static disconnect(?string $connection = null): bool
* @method static reconnect(?string $connection = null): PDO
* @method static isConnected(?string $connection = null): bool
* @method static getFreshConnection(?string $connection = null): PDO
* @method static cleanupAllConnections(): void
* @method static PDO getPdoInstance(?string $connection = null)
* @method static void beginTransaction()
* @method static void commit()
* @method static void rollBack()
* @method static mixed transaction(\Closure $callback, int $attempts = 1)
* @method static int transactionLevel()
* @method static array getTableColumns(?string $table = null)
* @method static int dropAllTables()
* @method static Builder table(string $table)
* @method static array getTables()
* @method static bool tableExists(string $table)
* @method static string getTable(Model $model)
* @method static PDO getConnection()
* @method static \Phaseolies\Database\Procedure\ProcedureResult procedure(string $procedureName,array $params = [],array $outputParams = [])
* @method static array view(string $viewName, array $where = [], array $params = [])
* @method static Collection query(string $sql, array $params = [])
* @method static int execute(string $sql, array $params = [])
* @method static PDOStatement statement(string $sql, array $params = [])
* @method static \Phaseolies\Database\Database connection(?string $name = null)
* @method static \Phaseolies\Database\Entity\Query\Builder bucket(string $table)
* @method static bool disconnect(?string $connection = null)
* @method static PDO reconnect(?string $connection = null)
* @method static bool isConnected(?string $connection = null)
* @method static PDO getFreshConnection(?string $connection = null)
* @method static void cleanupAllConnections()
* @method static void disableForeignKeyConstraints()
* @method static void enableForeignKeyConstraints()
*
* @see \Phaseolies\Database\Database
*/

use Phaseolies\Facade\BaseFacade;

class DB extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
12 changes: 6 additions & 6 deletions src/Phaseolies/Support/Facades/Hash.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Phaseolies\Support\Facades;

use Phaseolies\Facade\BaseFacade;

/**
* @method static \Phaseolies\Auth\Security\PasswordHashing make(string $plainText)
* @method static \Phaseolies\Auth\Security\PasswordHashing check(string $plainText, string $hashedText)
* @method static \Phaseolies\Auth\Security\PasswordHashing needsRehash(string $password)
* @method static string make(string $plainText)
* @method static bool check(string $plainText, string $hashedText)
* @method static bool needsRehash(string $password)
*
* @see \Phaseolies\Auth\Security\PasswordHashing
*/

use Phaseolies\Facade\BaseFacade;

class Hash extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
21 changes: 11 additions & 10 deletions src/Phaseolies/Support/Facades/Lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

namespace Phaseolies\Support\Facades;

use Phaseolies\Facade\BaseFacade;

/**
* @method static \Phaseolies\Translation\Translator trans($key, array $replace = [], $locale = null)
* @method static \Phaseolies\Translation\Translator get($key, array $replace = [], $locale = null)
* @method static \Phaseolies\Application makeReplacements($line, array $replace)
* @method static \Phaseolies\Application load($namespace, $group, $locale)
* @method static \Phaseolies\Application setLocale($locale)
* @method static \Phaseolies\Application getLocale()
* @method static \Phaseolies\Application setFallback($fallback)
* @method static \Phaseolies\Application getFallback()
* @method static string trans($key, array $replace = [], $locale = null)
* @method static string get($key, array $replace = [], $locale = null)
* @method static string makeReplacements($line, array $replace)
* @method static array load(string $locale, string $group, ?string $namespace = null)
* @method static void setLocale($locale)
* @method static string getLocale()
* @method static void setFallback($fallback)
* @method static string getFallback()
*
* @see \Phaseolies\Translation\Translator
*/
use Phaseolies\Facade\BaseFacade;

class Lang extends BaseFacade
{
protected static function getFacadeAccessor()
Expand Down
Loading
Loading