forked from webshr/core
initial commit
This commit is contained in:
87
src/Contracts/Application.php
Normal file
87
src/Contracts/Application.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Webshr\Core
|
||||
* @since 1.0.0
|
||||
* @author Webshore, H. Liebel
|
||||
* @license https://opensource.org/licenses/GPL-3.0-or-later GPL-3.0-or-later
|
||||
* @link https://webshore.eu/
|
||||
*
|
||||
* This file contains a customized adaptation of the Illuminate\Foundation package.
|
||||
* Original author: Laravel
|
||||
* Original source: https://laravel.com/api/master/Illuminate/Foundation.html
|
||||
*/
|
||||
|
||||
namespace Lichtblick\Core\Contracts;
|
||||
|
||||
interface Application
|
||||
{
|
||||
/**
|
||||
* Get the version number of the application.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function version();
|
||||
|
||||
/**
|
||||
* Get the base path of the installation.
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
public function base_path($path = '');
|
||||
|
||||
/**
|
||||
* Get the path to the application configuration files.
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
public function config_path($path = '');
|
||||
|
||||
/**
|
||||
* Get the path to the language files.
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
public function lang_path($path = '');
|
||||
|
||||
/**
|
||||
* Register a shared binding in the application.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param \Closure|string|null $concrete
|
||||
* @return void
|
||||
*/
|
||||
public function singleton($abstract, $concrete = null);
|
||||
|
||||
/**
|
||||
* Resolve the given type from the application.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param array $parameters
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \Lichtblick\Core\Exceptions\Binding_Resolution_Exception
|
||||
*/
|
||||
public function make($abstract, array $parameters = []);
|
||||
|
||||
/**
|
||||
* Call the given Closure / class@method and inject its dependencies.
|
||||
*
|
||||
* @param callable|string $callback
|
||||
* @param array $parameters
|
||||
* @param string|null $default_method
|
||||
* @return mixed
|
||||
*/
|
||||
public function call($callback, array $parameters = [], $default_method = null);
|
||||
|
||||
/**
|
||||
* Get the value of a configuration key.
|
||||
*
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function get(string $key);
|
||||
}
|
||||
25
src/Contracts/Deferrable_Module.php
Normal file
25
src/Contracts/Deferrable_Module.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Webshr\Core
|
||||
* @since 1.0.0
|
||||
* @author Webshore, H. Liebel
|
||||
* @license https://opensource.org/licenses/GPL-3.0-or-later GPL-3.0-or-later
|
||||
* @link https://webshore.eu/
|
||||
*
|
||||
* This file contains a customized adaptation of the Illuminate\Foundation package.
|
||||
* Original author: Laravel
|
||||
* Original source: https://laravel.com/api/master/Illuminate/Foundation.html
|
||||
*/
|
||||
|
||||
namespace Lichtblick\Core\Contracts;
|
||||
|
||||
interface Deferrable_Module
|
||||
{
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides();
|
||||
}
|
||||
64
src/Contracts/Repository.php
Normal file
64
src/Contracts/Repository.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Webshr\Core
|
||||
* @since 1.0.0
|
||||
* @author Webshore, H. Liebel
|
||||
* @license https://opensource.org/licenses/GPL-3.0-or-later GPL-3.0-or-later
|
||||
* @link https://webshore.eu/
|
||||
*
|
||||
* This file contains a customized adaptation of the Illuminate\Foundation package.
|
||||
* Original author: Laravel
|
||||
* Original source: https://laravel.com/api/master/Illuminate/Foundation.html
|
||||
*/
|
||||
|
||||
namespace Lichtblick\Core\Contracts;
|
||||
|
||||
interface Repository
|
||||
{
|
||||
/**
|
||||
* Determine if the given configuration value exists.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key);
|
||||
/**
|
||||
* Get the specified configuration value.
|
||||
*
|
||||
* @param array|string $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($key, $default = null);
|
||||
/**
|
||||
* Get all of the configuration items for the application.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function all();
|
||||
/**
|
||||
* Set a given configuration value.
|
||||
*
|
||||
* @param array|string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function set($key, $value = null);
|
||||
/**
|
||||
* Prepend a value onto an array configuration value.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function prepend($key, $value);
|
||||
/**
|
||||
* Push a value onto an array configuration value.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function push($key, $value);
|
||||
}
|
||||
Reference in New Issue
Block a user