mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-28 00:48:40 +00:00
phpcs fixes
This commit is contained in:
parent
11c7b0e626
commit
3059003191
|
|
@ -109,7 +109,7 @@ interface DataMapperInterface
|
|||
/**
|
||||
* Load.
|
||||
*
|
||||
* @param array $objects Objects to load
|
||||
* @param array ...$objects Objects to load
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
|
|
|
|||
|
|
@ -144,6 +144,8 @@ abstract class GrammarAbstract
|
|||
* Set table prefix.
|
||||
*
|
||||
* @param string $prefix Table prefix
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ class Builder extends BuilderAbstract
|
|||
/**
|
||||
* Select.
|
||||
*
|
||||
* @param array $columns Columns
|
||||
* @param array ...$columns Columns
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -273,7 +273,7 @@ class Builder extends BuilderAbstract
|
|||
/**
|
||||
* Select.
|
||||
*
|
||||
* @param array $columns Columns
|
||||
* @param array ...$columns Columns
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -423,7 +423,7 @@ class Builder extends BuilderAbstract
|
|||
/**
|
||||
* From.
|
||||
*
|
||||
* @param string|array $tables Tables
|
||||
* @param string|array ...$tables Tables
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -627,7 +627,7 @@ class Builder extends BuilderAbstract
|
|||
/**
|
||||
* Group by.
|
||||
*
|
||||
* @param string|array|\Closure $columns Grouping result
|
||||
* @param string|array|\Closure ...$columns Grouping result
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -761,6 +761,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Lock query.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -770,6 +772,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Lock for update query.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -779,6 +783,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Create query string.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -789,6 +795,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Find query.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -813,6 +821,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Select minimum.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -822,6 +832,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Select maximum.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -831,6 +843,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Select sum.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -840,6 +854,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Select average.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -850,7 +866,7 @@ class Builder extends BuilderAbstract
|
|||
/**
|
||||
* Insert into columns.
|
||||
*
|
||||
* @param array $columns Columns
|
||||
* @param array ...$columns Columns
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -892,7 +908,7 @@ class Builder extends BuilderAbstract
|
|||
/**
|
||||
* Values to insert.
|
||||
*
|
||||
* @param array $values Values
|
||||
* @param array ...$values Values
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -928,7 +944,7 @@ class Builder extends BuilderAbstract
|
|||
/**
|
||||
* Values to insert.
|
||||
*
|
||||
* @param array $sets Values
|
||||
* @param array ...$sets Values
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -961,7 +977,7 @@ class Builder extends BuilderAbstract
|
|||
/**
|
||||
* Update columns.
|
||||
*
|
||||
* @param array $tables Column names to update
|
||||
* @param array ...$tables Column names to update
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -988,6 +1004,13 @@ class Builder extends BuilderAbstract
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete query
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function delete() : Builder
|
||||
{
|
||||
if ($this->isReadOnly) {
|
||||
|
|
@ -1001,6 +1024,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Increment value.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -1010,6 +1035,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Decrement value.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -1019,6 +1046,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Join.
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -1029,6 +1058,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Join where.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -1038,6 +1069,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Left join.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -1047,6 +1080,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Left join where.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -1056,6 +1091,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Right join.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -1065,6 +1102,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* Right join where.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -1086,6 +1125,8 @@ class Builder extends BuilderAbstract
|
|||
|
||||
/**
|
||||
* On.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class Dispatcher
|
|||
* Dispatch controller.
|
||||
*
|
||||
* @param string|array|\Closure $controller Controller string
|
||||
* @param mixed $data Data
|
||||
* @param mixed ...$data Data
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class Money implements \Serializable
|
|||
/**
|
||||
* Add money.
|
||||
*
|
||||
* @param Money|string|int|float $value
|
||||
* @param Money|string|int|float $value Value to add
|
||||
*
|
||||
* @return Money
|
||||
*
|
||||
|
|
@ -228,7 +228,7 @@ class Money implements \Serializable
|
|||
/**
|
||||
* Sub money.
|
||||
*
|
||||
* @param Money|string|int|float $value
|
||||
* @param Money|string|int|float $value Value to subtract
|
||||
*
|
||||
* @return Money
|
||||
*
|
||||
|
|
@ -250,7 +250,7 @@ class Money implements \Serializable
|
|||
/**
|
||||
* Mult.
|
||||
*
|
||||
* @param int|float $value
|
||||
* @param int|float $value Value to multiply with
|
||||
*
|
||||
* @return Money
|
||||
*
|
||||
|
|
@ -268,7 +268,7 @@ class Money implements \Serializable
|
|||
/**
|
||||
* Div.
|
||||
*
|
||||
* @param int|float $value
|
||||
* @param int|float $value Value to divide by
|
||||
*
|
||||
* @return Money
|
||||
*
|
||||
|
|
@ -300,7 +300,7 @@ class Money implements \Serializable
|
|||
/**
|
||||
* Power.
|
||||
*
|
||||
* @param int|float $value
|
||||
* @param int|float $value Value to power
|
||||
*
|
||||
* @return Money
|
||||
*
|
||||
|
|
@ -330,7 +330,7 @@ class Money implements \Serializable
|
|||
/**
|
||||
* Unserialize.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param mixed $value Value to unserialize
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
|
|||
|
|
@ -215,9 +215,9 @@ class FileLogger implements LoggerInterface
|
|||
/**
|
||||
* Interpolate context
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $level
|
||||
* @param string $message Log schema
|
||||
* @param array $context Context to log
|
||||
* @param string $level Log level
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
|
|
@ -256,7 +256,7 @@ class FileLogger implements LoggerInterface
|
|||
/**
|
||||
* Write to file.
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $message Log message
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
@ -285,14 +285,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* System is unusable.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function emergency(string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
@ -301,17 +294,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Action must be taken immediately.
|
||||
*
|
||||
* Example: Entire website down, database unavailable, etc. This should
|
||||
* trigger the SMS alerts and wake you up.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function alert(string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
@ -320,16 +303,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Critical conditions.
|
||||
*
|
||||
* Example: Application component unavailable, unexpected exception.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function critical(string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
@ -338,15 +312,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Runtime errors that do not require immediate action but should typically
|
||||
* be logged and monitored.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function error(string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
@ -355,17 +321,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Exceptional occurrences that are not errors.
|
||||
*
|
||||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||
* that are not necessarily wrong.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function warning(string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
@ -374,14 +330,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Normal but significant events.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function notice(string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
@ -390,16 +339,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Interesting events.
|
||||
*
|
||||
* Example: User logs in, SQL logs.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function info(string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
@ -408,14 +348,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Detailed debug information.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function debug(string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
@ -424,15 +357,7 @@ class FileLogger implements LoggerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Logs with an arbitrary level.
|
||||
*
|
||||
* @param string $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function log(string $level, string $message, array $context = []) /* : void */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ interface LoggerInterface
|
|||
/**
|
||||
* System is unusable.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
@ -41,8 +41,8 @@ interface LoggerInterface
|
|||
* Example: Entire website down, database unavailable, etc. This should
|
||||
* trigger the SMS alerts and wake you up.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
@ -53,8 +53,8 @@ interface LoggerInterface
|
|||
*
|
||||
* Example: Application component unavailable, unexpected exception.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
@ -64,8 +64,8 @@ interface LoggerInterface
|
|||
* Runtime errors that do not require immediate action but should typically
|
||||
* be logged and monitored.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
@ -77,8 +77,8 @@ interface LoggerInterface
|
|||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||
* that are not necessarily wrong.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
@ -87,8 +87,8 @@ interface LoggerInterface
|
|||
/**
|
||||
* Normal but significant events.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
@ -99,8 +99,8 @@ interface LoggerInterface
|
|||
*
|
||||
* Example: User logs in, SQL logs.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
@ -109,8 +109,8 @@ interface LoggerInterface
|
|||
/**
|
||||
* Detailed debug information.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
@ -119,9 +119,9 @@ interface LoggerInterface
|
|||
/**
|
||||
* Logs with an arbitrary level.
|
||||
*
|
||||
* @param string $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @param string $level Log level/severeness
|
||||
* @param string $message Logging message schema
|
||||
* @param array $context Context to log
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ class Functions
|
|||
*
|
||||
* Example: (7, 2)
|
||||
*
|
||||
* @param int $n
|
||||
* @param int $k
|
||||
* @param int $n n
|
||||
* @param int $k k
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
@ -111,8 +111,8 @@ class Functions
|
|||
/**
|
||||
* Calculate ackermann function.
|
||||
*
|
||||
* @param int $m
|
||||
* @param int $n
|
||||
* @param int $m m
|
||||
* @param int $n n
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
@ -152,7 +152,7 @@ class Functions
|
|||
/**
|
||||
* Calculate inverse modular.
|
||||
*
|
||||
* @param int $a
|
||||
* @param int $a a
|
||||
* @param int $n Modulo
|
||||
*
|
||||
* @return int
|
||||
|
|
@ -198,8 +198,8 @@ class Functions
|
|||
/**
|
||||
* Modular implementation for negative values.
|
||||
*
|
||||
* @param int $a
|
||||
* @param int $b
|
||||
* @param int $a a
|
||||
* @param int $b b
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
|
|||
|
|
@ -224,6 +224,8 @@ class Header extends HeaderAbstract
|
|||
|
||||
/**
|
||||
* Push all headers.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ interface UploadedFileInterface
|
|||
|
||||
/**
|
||||
* Retrieve a stream representing the uploaded file.
|
||||
*
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getStream();
|
||||
|
|
@ -45,29 +45,37 @@ interface UploadedFileInterface
|
|||
|
||||
/**
|
||||
* Retrieve the file size.
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getSize();
|
||||
public function getSize() : int;
|
||||
|
||||
/**
|
||||
* Retrieve the error associated with the uploaded file.
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getError();
|
||||
public function getError() : int;
|
||||
|
||||
/**
|
||||
* Retrieve the filename sent by the client.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getClientFilename();
|
||||
public function getClientFilename() : string;
|
||||
|
||||
/**
|
||||
* Retrieve the media type sent by the client.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getClientMediaType();
|
||||
public function getClientMediaType() : string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,8 @@ class Head implements RenderableInterface
|
|||
|
||||
/**
|
||||
* Set page meta.
|
||||
*
|
||||
* @return Meta
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -110,6 +110,8 @@ class InfoManager
|
|||
* @param string $path Value path
|
||||
* @param mixed $data Scalar or array of data to set
|
||||
* @param string $delim Delimiter of path
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -94,6 +94,8 @@ class ModuleFactory
|
|||
* Load modules this module is requesting from
|
||||
*
|
||||
* @param ModuleAbstract $obj Current module
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -112,6 +114,8 @@ class ModuleFactory
|
|||
* Register modules this module is receiving from
|
||||
*
|
||||
* @param ModuleAbstract $obj Current module
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -210,6 +210,15 @@ class ModuleManager
|
|||
return $this->active;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is module active
|
||||
*
|
||||
* @param string $module Module name
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function isActive(string $module) : bool
|
||||
{
|
||||
return in_array($module, $this->getActiveModules(false));
|
||||
|
|
@ -294,7 +303,7 @@ class ModuleManager
|
|||
*/
|
||||
private function loadInfo(string $module) : InfoManager
|
||||
{
|
||||
$path = realpath($oldPath = $this->modulePath . '/' . $module . '/' . 'info.json');
|
||||
$path = realpath($oldPath = $this->modulePath . '/' . $module . '/info.json');
|
||||
|
||||
if ($path === false) {
|
||||
throw new PathException($oldPath);
|
||||
|
|
|
|||
|
|
@ -263,18 +263,7 @@ class PackageManager
|
|||
private function authenticate(string $signedHash, string $rawHash) : bool
|
||||
{
|
||||
// https://3v4l.org/PN9Xl
|
||||
$publicKey = 'MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjr73rerPRq3ZwWmrUKsN
|
||||
Bjg8Wy5lnyWu9HCRQz0fix6grz+NOOsr4m/jazB2knfdtn7fi5XifbIbmrNJY8e6
|
||||
musCJ0FTgJPVBqVk7XAFVSRe2gUaCPZrTPtfZ00C3cynjwTlxSdjNtU9N0ZAo17s
|
||||
VWghH8ki4T2d5Mg1erGOtMJzp5yw47UHUa+KbxUmUV25WMcRYyi7+itD2xANF2AE
|
||||
+PQZT1dSEU8++NI+zT6tXD/Orv5ikk0whoVqvo6duWejx5n5cpJB4EiMo4Q7epbw
|
||||
9uMo9uIKqgQ9y3KdT36GBQkBErFf1dhf8KYJBGYMhO1UJE11dY3XrA7Ij1+zK+ai
|
||||
duQHOc5EMClUGZQzCJAIU5lj4WEHQ4Lo0gop+fx9hzuBTDxdyOjWSJzkqyuWMkq3
|
||||
zEpRBay785iaglaue9XDLee58wY+toiGLBfXe73gsbDqDSOll+cQYNjrronVN7sU
|
||||
Dc2WyTIVW1Z8KFwK10D3SW0oEylCaGLtClyyihuW7JPu/8Or1Zjf87W82XTm31Fp
|
||||
YkRgoEMDtVHZq0N2eHpLz1L8zKyT0ogZYN5eH5VlGrPcpwbAludNKlgAJ0hrgED1
|
||||
9YsCBLwJQpFa4VZP7A5a/Qcw8EFAvNkgaPpBbAAtWoDbyOQsez6Jsdan/enfZ18+
|
||||
LL7qOB5oFFM/pKlTIeVS+UsCAwEAAQ==';
|
||||
$publicKey = 'MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjr73rerPRq3ZwWmrUKsNBjg8Wy5lnyWu9HCRQz0fix6grz+NOOsr4m/jazB2knfdtn7fi5XifbIbmrNJY8e6musCJ0FTgJPVBqVk7XAFVSRe2gUaCPZrTPtfZ00C3cynjwTlxSdjNtU9N0ZAo17sVWghH8ki4T2d5Mg1erGOtMJzp5yw47UHUa+KbxUmUV25WMcRYyi7+itD2xANF2AE+PQZT1dSEU8++NI+zT6tXD/Orv5ikk0whoVqvo6duWejx5n5cpJB4EiMo4Q7epbw9uMo9uIKqgQ9y3KdT36GBQkBErFf1dhf8KYJBGYMhO1UJE11dY3XrA7Ij1+zK+aiduQHOc5EMClUGZQzCJAIU5lj4WEHQ4Lo0gop+fx9hzuBTDxdyOjWSJzkqyuWMkq3zEpRBay785iaglaue9XDLee58wY+toiGLBfXe73gsbDqDSOll+cQYNjrronVN7sUDc2WyTIVW1Z8KFwK10D3SW0oEylCaGLtClyyihuW7JPu/8Or1Zjf87W82XTm31FpYkRgoEMDtVHZq0N2eHpLz1L8zKyT0ogZYN5eH5VlGrPcpwbAludNKlgAJ0hrgED19YsCBLwJQpFa4VZP7A5a/Qcw8EFAvNkgaPpBbAAtWoDbyOQsez6Jsdan/enfZ18+LL7qOB5oFFM/pKlTIeVS+UsCAwEAAQ==';
|
||||
$unsignedHash = \sodium_crypto_sign_open($signedHash, $publicKey);
|
||||
|
||||
return $unsignedHash === $rawHash;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,12 @@ namespace phpOMS\Security;
|
|||
*/
|
||||
class PhpCode
|
||||
{
|
||||
/**
|
||||
* Deprecated functions
|
||||
*
|
||||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static $deprecatedFunctions = [
|
||||
'apache_child_terminate', 'apache_setenv', 'define_syslog_variables', 'escapeshellarg', 'escapeshellcmd', 'eval',
|
||||
'exec', 'fp', 'fput', 'ftp_connect', 'ftp_exec', 'ftp_get', 'ftp_login', 'ftp_nb_fput', 'ftp_put', 'ftp_raw',
|
||||
|
|
@ -33,16 +39,43 @@ class PhpCode
|
|||
'posix_setuid', 'posix_uname', 'proc_close', 'proc_get_status',
|
||||
];
|
||||
|
||||
/**
|
||||
* Normalize source code for inspection
|
||||
*
|
||||
* @param string $source Source code
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static function normalizeSource(string $source) : string
|
||||
{
|
||||
return str_replace(["\n", "\r\n", "\r", "\t"], ['', '', '', ' '], $source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if has source unicode
|
||||
*
|
||||
* @param string $source Source code
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function hasUnicode(string $source) : bool
|
||||
{
|
||||
return (bool) preg_match('/[^\x20-\x7f]/', $source) || !mb_check_encoding($source, 'ASCII');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if function is disabled
|
||||
*
|
||||
* @param array $functions Functions to check
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function isDisabled(array $functions) : bool
|
||||
{
|
||||
$disabled = ini_get('disable_functions');
|
||||
|
|
@ -58,12 +91,21 @@ class PhpCode
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if has deprecated functions
|
||||
*
|
||||
* @param string $source Source code
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function hasDeprecatedFunction(string $source) : bool
|
||||
{
|
||||
$source = self::normalizeSource($source);
|
||||
|
||||
foreach (self::$deprecatedFunctions as $function) {
|
||||
if (preg_match('/' . $function . '\s*\(' . '/', $source) === 1) {
|
||||
if (preg_match('/' . $function . '\s*\(/', $source) === 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,8 +324,10 @@ interface ContainerInterface
|
|||
*
|
||||
* This is used in order to initialize all resources.
|
||||
* Sub-sub-resources are only initialized once they are needed.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function index();
|
||||
public function index(); /* : void */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ interface UriInterface
|
|||
/**
|
||||
* Set root path.
|
||||
*
|
||||
* @param string $uri Uri
|
||||
* @param string $root Root path
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ class ArrayUtils
|
|||
$str .= $key . ' => ' . $value . ', ';
|
||||
break;
|
||||
case 'string':
|
||||
$str .= $key . ' => \'' . $value . '\'' . ', ';
|
||||
$str .= $key . ' => \'' . $value . '\', ';
|
||||
break;
|
||||
case 'object':
|
||||
$str .= $key . ' => ' . get_class($value['default']) . '()';
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ class C128a extends C128Abstract
|
|||
* Set content to encrypt
|
||||
*
|
||||
* @param string $content Content to encrypt
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @todo : add mirror parameter
|
||||
*
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ class Currency
|
|||
* Reset currency rates.
|
||||
*
|
||||
* Can be used in order to refresh them. Be careful currency rates only get updated once a day from the ECB website.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ class Branch
|
|||
* Set branch name
|
||||
*
|
||||
* @param string $name Branch name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -152,6 +152,8 @@ class Commit
|
|||
* Set commit message.
|
||||
*
|
||||
* @param string $message Commit message
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -208,6 +210,8 @@ class Commit
|
|||
* Set commit author.
|
||||
*
|
||||
* @param Author $author Commit author
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -232,6 +236,8 @@ class Commit
|
|||
* Set commit branch.
|
||||
*
|
||||
* @param Branch $branch Commit branch
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -256,6 +262,8 @@ class Commit
|
|||
* Set commit tag.
|
||||
*
|
||||
* @param Tag $tag Commit tag
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -306,6 +314,8 @@ class Commit
|
|||
* Set commit repository.
|
||||
*
|
||||
* @param Repository $repository Commit repository
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -321,6 +331,8 @@ class Commit
|
|||
* @param int $line Line number
|
||||
* @param string $old Old line
|
||||
* @param string $new New line
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@ class Git
|
|||
* Set git binary.
|
||||
*
|
||||
* @param string $path Git path
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws PathException
|
||||
*
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ class Repository
|
|||
* Set repository path.
|
||||
*
|
||||
* @param string $path Path to repository
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws PathException
|
||||
*
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@ class Text
|
|||
/**
|
||||
* Set if the text should have formatting.
|
||||
*
|
||||
* @param bool $hasFormatting
|
||||
* @param bool $hasFormatting Text has formatting.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setFormatting($hasFormatting) /* : void */
|
||||
public function setFormatting(bool $hasFormatting) /* : void */
|
||||
{
|
||||
$this->hasFormatting = $hasFormatting;
|
||||
}
|
||||
|
|
@ -91,13 +91,13 @@ class Text
|
|||
/**
|
||||
* Set if the text should have paragraphs.
|
||||
*
|
||||
* @param bool $hasParagraphs
|
||||
* @param bool $hasParagraphs Text has paragraphs
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setParagraphs($hasParagraphs) /* : void */
|
||||
public function setParagraphs(bool $hasParagraphs) /* : void */
|
||||
{
|
||||
$this->hasParagraphs = $hasParagraphs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ class Interval implements \Serializable
|
|||
* Unserialize.
|
||||
*
|
||||
* @param string $serialized String to unserialize
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -279,6 +281,8 @@ class Interval implements \Serializable
|
|||
* @param int $step Step
|
||||
* @param bool $any Any
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @since 1.0.0
|
||||
|
|
@ -341,6 +345,8 @@ class Interval implements \Serializable
|
|||
* @param array $hour Hour
|
||||
* @param int $step Step
|
||||
* @param bool $any Any
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
|
|
@ -379,6 +385,8 @@ class Interval implements \Serializable
|
|||
* @param bool $any Any
|
||||
* @param bool $last Last
|
||||
* @param int $nearest Nearest day
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
|
|
@ -446,6 +454,8 @@ class Interval implements \Serializable
|
|||
* @param int $step Step
|
||||
* @param bool $any Any
|
||||
* @param bool $last Last
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
|
|
@ -508,6 +518,8 @@ class Interval implements \Serializable
|
|||
* @param array $month Month
|
||||
* @param int $step Step
|
||||
* @param bool $any Any
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
|
|
@ -544,6 +556,8 @@ class Interval implements \Serializable
|
|||
* @param array $year Year
|
||||
* @param int $step Step
|
||||
* @param bool $any Any
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ abstract class SchedulerAbstract
|
|||
* Set git binary.
|
||||
*
|
||||
* @param string $path Git path
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws PathException
|
||||
*
|
||||
|
|
@ -92,7 +94,7 @@ abstract class SchedulerAbstract
|
|||
/**
|
||||
* Create task
|
||||
*
|
||||
* @param TaskAbstract
|
||||
* @param TaskAbstract $task Task to create
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode11 extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode128 extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode25 extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode39 extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode93 extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class BarcodeCodebar extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class BarcodeDatamatrix extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class BarcodeEAN extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class BarcodeMSI extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class QrCode extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user