Skip to content

Commit

Permalink
all methods on facade doc; fix @see references
Browse files Browse the repository at this point in the history
  • Loading branch information
donwilson committed Nov 9, 2023
1 parent a62760d commit ff8520a
Show file tree
Hide file tree
Showing 26 changed files with 96 additions and 78 deletions.
2 changes: 1 addition & 1 deletion src/Magnetar/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ protected function registerBaseServiceProviders(): void {
* Register the container's core list of aliases
* @return void
*
* @see Magnetar\Helpers\Facades\Facade::defaultAliases()
* @see \Magnetar\Helpers\Facades\Facade::defaultAliases()
*/
public function registerCoreContainerAliases(): void {
foreach([
Expand Down
4 changes: 2 additions & 2 deletions src/Magnetar/Auth/AuthManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Authentication manager
*
* @see AuthenticationAdapter
* @see \Magnetar\Auth\AuthenticationAdapter
*/
class AuthManager {
/**
Expand Down Expand Up @@ -128,7 +128,7 @@ public function adapter(string $connection_name): AuthenticationAdapter {
* @param array $args
* @return mixed
*
* @see AuthenticationAdapter
* @see \Magnetar\Auth\AuthenticationAdapter
*/
public function __call(string $method, array $args): mixed {
return $this->connection()->$method(...$args);
Expand Down
7 changes: 6 additions & 1 deletion src/Magnetar/Cache/StoreManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ class StoreManager {

/**
* Constructor
* @param Application $app The application instance
*/
public function __construct(
/**
* The application instance
* @var Application
*/
protected Application $app
) {

Expand Down Expand Up @@ -75,6 +78,8 @@ protected function makeConnection(string $driver_name): void {
* @param string $method
* @param array $args
* @return mixed
*
* @see \Magnetar\Cache\AbstractCacheStore
*/
public function __call(string $method, array $args): mixed {
return $this->connection()->$method(...$args);
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Database/ConnectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function adapter(string $connection_name): DatabaseAdapter {
* @param array $args
* @return mixed
*
* @see DatabaseAdapter
* @see \Magnetar\Database\DatabaseAdapter
*/
public function __call(string $method, array $args): mixed {
return $this->connection()->$method(...$args);
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Database/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public function insert(
* @example $db->insertIgnore( ['column' => 'value'] );
* @example $db->insertIgnore( [ ['column' => 'value'], ['column' => 'value2'] ] );
*
* @see insert()
* @see \Magnetar\Database\QueryBuilder
*/
public function insertIgnore(array $data): int {
return $this->insert($data, true);
Expand Down
42 changes: 0 additions & 42 deletions src/Magnetar/Filesystem/Adapter/Adapter.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Magnetar/Filesystem/Adapter/DiskAdapter.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Magnetar/Filesystem/ConnectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ public function drive(string $name): DiskAdapter {
}

/**
* Passes method calls to the default disk adapter
* Passes method calls to the default disk adapter. Different methods are available based on the type of adapter used
* @param string $method The method name
* @param array $args The method arguments
* @return mixed
*
* @see DiskAdapter
* @see \Magnetar\Filesystem\Disk\DiskAdapter
*/
public function __call(string $method, array $args): mixed {
return $this->connection()->$method(...$args);
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Helpers/Facades/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
* @method offsetSet(mixed $key, mixed $value): void
* @method offsetUnset(mixed $key): void
*
* @see Magnetar\Application
* @see \Magnetar\Application
*/
class App extends Facade {
/**
Expand Down
5 changes: 4 additions & 1 deletion src/Magnetar/Helpers/Facades/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
* @method getDefaultConnectionName(): ?string
* @method getConnected(): array
* @method adapter(string $connection_name): Magnetar\Auth\AuthenticationAdapter
* @method getAdapterName(): string
* @method setModelClass(string $model_class): void
*
* @see Magnetar\Auth\AuthManager
* @see \Magnetar\Auth\AuthManager
* @see \Magnetar\Auth\AuthenticationAdapter
*/
class Auth extends Facade {
/**
Expand Down
13 changes: 12 additions & 1 deletion src/Magnetar/Helpers/Facades/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@

/**
* @method connection(?string $driver_name=null): Magnetar\Cache\AbstractCacheStore
* @method clear(): void
* @method delete(string $key): bool
* @method get(string $key, mixed $callback=null, int $ttl=3600): mixed
* @method getMany(array $keys): array
* @method increment(string $key, int $step=1): int|false
* @method decrement(string $key, int $step=1): int|false
* @method has(string $key): bool
* @method hasMany(array $keys): array
* @method set(string $key, mixed $value, int|false $ttl=3600): mixed
* @method setMany(array $values, int|false $ttl=3600): void
*
* @see Magnetar\Cache\StoreManager
* @see \Magnetar\Cache\StoreManager
* @see \Magnetar\Cache\AbstractCacheStore
*/
class Cache extends Facade {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Helpers/Facades/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @method offsetSet(mixed $key, mixed $value): void
* @method offsetUnset(mixed $key): void
*
* @see Magnetar\Config\Config
* @see \Magnetar\Config\Config
*/
class Config extends Facade {
/**
Expand Down
11 changes: 10 additions & 1 deletion src/Magnetar/Helpers/Facades/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@
* @method getDefaultConnectionName(): ?string
* @method getConnected(): array
* @method adapter(string $connection_name): Magnetar\Database\DatabaseAdapter
* @method getAdapterName(): string
* @method query(string $sql_query, array $params=[]): int|false
* @method get_rows(string $sql_query, array $params=[], string|false $column_key=false): array|false
* @method get_row(string $sql_query, array $params=[]): array|false
* @method get_col(string $sql_query, array $params=[], string|int $column_key=0): array|false
* @method get_col_assoc(string $sql_query, array $params=[], string|int $assoc_key=0, string|int $column_key=1): array|false
* @method get_var(string $sql_query, array $params=[], string|int|false $column_key=false): string|int|false
* @method table(string $table_name): Magnetar\Database\QueryBuilder
*
* @see Magnetar\Database\ConnectionManager
* @see \Magnetar\Database\ConnectionManager
* @see \Magnetar\Database\DatabaseAdapter
*/
class DB extends Facade {
/**
Expand Down
26 changes: 25 additions & 1 deletion src/Magnetar/Helpers/Facades/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,32 @@
* @method getConnected(): array
* @method adapter(string $name): Magnetar\Filesystem\DiskAdapter
* @method drive(string $name): Magnetar\Filesystem\DiskAdapter
* @method path(string $rel_path=''): string
* @method write(string $path, string $contents, bool $overwrite=false): bool
* @method copy(string $source, string $destination, bool $overwrite=false): bool
* @method read(string $path): string|false
* @method exists(string $path): bool
* @method isFile(string $path): bool
* @method name(string $path): string
* @method basename(string $path): string
* @method extension(string $path): string
* @method size(string $path): int
* @method mimetype(string $path): string|false
* @method lastModified(string $path): string|false
* @method append(string $path, string $contents): bool
* @method prepend(string $path, string $contents): bool
* @method move(string $source, string $destination, bool $overwrite=false): bool
* @method delete(array|string $paths): bool
* @method directoryExists(string $path): bool
* @method isDirectory(string $path): bool
* @method makeDirectory(string $path, int $mode=511, bool $recursive=false): bool
* @method copyDirectory(string $source, string $destination, bool $overwrite=false): bool
* @method emptyDirectory(string $path): bool
* @method deleteDirectory(string $path): bool
* @method url(string $path): string
*
* @see Magnetar\Filesystem\ConnectionManager
* @see \Magnetar\Filesystem\ConnectionManager
* @see \Magnetar\Filesystem\Disk\DiskAdapter
*/
class File extends Facade {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Helpers/Facades/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @method getLogs(int $minLevel=0): array
* @method dump(int $minLevel=0, bool $return=false): mixed
*
* @see Magnetar\Log\Logger
* @see \Magnetar\Log\Logger
*/
class Log extends Facade {
/**
Expand Down
11 changes: 10 additions & 1 deletion src/Magnetar/Helpers/Facades/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@
* @method getDefaultConnectionName(): ?string
* @method getConnected(): array
* @method adapter(string $connection_name): Magnetar\Queue\QueueAdapter
* @method getApp(): Magnetar\Application
* @method getAdapterName(): string
* @method getConnectionName(): string
* @method getConnectionConfig(): array
* @method getConnection(): Magnetar\Queue\Connection
* @method makeMessage(mixed $body): Magnetar\Queue\Message
* @method channel(string $channelName): Magnetar\Queue\Channel
* @method publish(string $channel, mixed $message, string $exchange=''): bool
*
* @see Magnetar\Queue\QueueManager
* @see \Magnetar\Queue\QueueManager
* @see \Magnetar\Queue\QueueAdapter
*/
class Queue extends Facade {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Helpers/Facades/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @method file(string $input_name): Magnetar\Http\UploadedFile|array|null
* @method files(): array
*
* @see Magnetar\Http\Request
* @see \Magnetar\Http\Request
*/
class Request extends Facade {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Helpers/Facades/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @method redirect(string $path, int $response_code=302): self
* @method json(mixed $body): self
*
* @see Magnetar\Http\Response
* @see \Magnetar\Http\Response
*/
class Response extends Facade {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Helpers/Facades/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @method redirect(string $pattern, string $redirect_path, int $response_code=302): Magnetar\Router\Route
* @method permanentRedirect(string $pattern, string $redirect_path): Magnetar\Router\Route
*
* @see Magnetar\Router\Router
* @see \Magnetar\Router\Router
*/
class Router extends Facade {
/**
Expand Down
8 changes: 7 additions & 1 deletion src/Magnetar/Helpers/Facades/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
/**
* @method theme(?string $theme_name=null): Magnetar\Template\Template
* @method tpl(string $tpl_name, array $view_data=[]): string
* @method getViewPath(string $tpl_name): string
* @method render(string $tpl_name, array $view_data=[]): string
* @method display(string $tpl_name): void
* @method renderResponse(string $tpl_name, array $view_data=[]): Magnetar\Http\Response
* @method getData(): array
*
* @see Magnetar\Template\ThemeManager
* @see \Magnetar\Template\ThemeManager
* @see \Magnetar\Template\Template
*/
class Theme extends Facade {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Helpers/Facades/URL.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @method to(string $path, array $params=[]): string
* @method from(string $url): Magnetar\Router\URLBuilder
*
* @see Magnetar\Router\URLGenerator
* @see \Magnetar\Router\URLGenerator
*/
class URL extends Facade {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Helpers/TypedEnumHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static function getType(mixed $value, TypedEnum|null $default=null): Type
*
* @throws Exception If the type is unknown and no default value is provided
*
* @see Magnetar\Helpers\Enums\TypedEnum
* @see \Magnetar\Helpers\Enums\TypedEnum
*/
public static function typeByName(string $named_type, mixed $default=null): TypedEnum {
return match($named_type) {
Expand Down
2 changes: 2 additions & 0 deletions src/Magnetar/Please/Actions/Facades/UpdateFacadePHPDocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

use Magnetar\Helpers\Facades\Log;

// @NOTE this is outdated, only here temporarily for reference

class UpdateFacadePHPDocs extends Actionable {
/**
* {@inheritDoc}
Expand Down
2 changes: 2 additions & 0 deletions src/Magnetar/Queue/QueueManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public function adapter(string $connection_name): QueueAdapter {
* @param string $method
* @param array $args
* @return mixed
*
* @see \Magnetar\Queue\QueueAdapter
*/
public function __call(string $method, array $args): mixed {
return $this->connection()->$method(...$args);
Expand Down
2 changes: 1 addition & 1 deletion src/Magnetar/Router/Helpers/HTTPMethodEnumResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HTTPMethodEnumResolver {
*
* @throws Exception If the method is unknown and no default value is provided
*
* @see Magnetar\Router\Enums\HTTPMethodEnum
* @see \Magnetar\Router\Enums\HTTPMethodEnum
*/
public static function resolve(string $method, mixed $default=null): HTTPMethodEnum {
return match($method) {
Expand Down
2 changes: 2 additions & 0 deletions src/Magnetar/Template/ThemeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public function tpl(string $tpl_name, array $view_data=[]): string {
* @param string $method The method name to call
* @param array $args The arguments to pass to the method
* @return mixed
*
* @see \Magnetar\Template\Template
*/
public function __call(string $method, array $args): mixed {
return $this->theme()->$method(...$args);
Expand Down

0 comments on commit ff8520a

Please sign in to comment.