mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-18 12:48:41 +00:00
Adjusting for documentor and add docblocks
This commit is contained in:
parent
4366341ed9
commit
09d4f67f62
|
|
@ -21,7 +21,10 @@ use phpOMS\Localization\NullLocalization;
|
|||
use phpOMS\Validation\Network\Email;
|
||||
|
||||
/**
|
||||
* Account manager class.
|
||||
* Account class.
|
||||
*
|
||||
* The account class is the base model for accounts. This model contains the most common account
|
||||
* information. This model is not comparable to a profile which contains much more information.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Account
|
||||
|
|
@ -156,6 +159,8 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* The constructor automatically sets the created date as well as the last activity to now.
|
||||
*
|
||||
* @param int $id Account id
|
||||
*
|
||||
|
|
@ -183,6 +188,8 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
|
||||
/**
|
||||
* Get localization.
|
||||
*
|
||||
* Every account can have a different localization which can be accessed here.
|
||||
*
|
||||
* @return Localization
|
||||
*
|
||||
|
|
@ -195,8 +202,11 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
|
||||
/**
|
||||
* Get groups.
|
||||
*
|
||||
* Every account can belong to multiple groups.
|
||||
* These groups usually are used for permissions and categorize accounts.
|
||||
*
|
||||
* @return array
|
||||
* @return array Returns array of all groups
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -221,6 +231,8 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
|
||||
/**
|
||||
* Set permissions.
|
||||
*
|
||||
* The method accepts an array of permissions. All existing permissions are replaced.
|
||||
*
|
||||
* @param PermissionAbstract[] $permissions
|
||||
*
|
||||
|
|
@ -235,8 +247,10 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
|
||||
/**
|
||||
* Add permissions.
|
||||
*
|
||||
* Adds permissions to the account
|
||||
*
|
||||
* @param PermissionAbstract[] $permissions
|
||||
* @param PermissionAbstract[] $permissions Array of permissions to add to the account
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
@ -249,8 +263,10 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
|
||||
/**
|
||||
* Add permission.
|
||||
*
|
||||
* Adds a single permission to the account
|
||||
*
|
||||
* @param PermissionAbstract $permission
|
||||
* @param PermissionAbstract $permission Permission to add to the account
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
@ -264,15 +280,17 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
/**
|
||||
* Has permissions.
|
||||
*
|
||||
* @param int $permission Check if user has this permission
|
||||
* @param int $unit Unit
|
||||
* @param string $app App
|
||||
* @param int $module Module
|
||||
* @param int $type Type (e.g. customer)
|
||||
* @param int $element (e.g. customer id)
|
||||
* @param int $component (e.g. address)
|
||||
* Checks if the account has a permission defined
|
||||
*
|
||||
* @param int $permission Permission to check
|
||||
* @param int $unit Unit Unit to check (null if all are acceptable)
|
||||
* @param string $app App App to check (null if all are acceptable)
|
||||
* @param int $module Module Module to check (null if all are acceptable)
|
||||
* @param int $type Type (e.g. customer) (null if all are acceptable)
|
||||
* @param int $element (e.g. customer id) (null if all are acceptable)
|
||||
* @param int $component (e.g. address) (null if all are acceptable)
|
||||
*
|
||||
* @return bool
|
||||
* @return bool Returns true if the account has the permission, false otherwise
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -403,6 +421,8 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @param string $email Email
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \InvalidArgumentException Exception is thrown if the provided string is not a valid email
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ use phpOMS\DataStorage\Session\SessionInterface;
|
|||
|
||||
/**
|
||||
* Account manager class.
|
||||
*
|
||||
* The account manager is used to manage multiple accounts.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Account
|
||||
|
|
@ -47,14 +49,6 @@ class AccountManager implements \Countable
|
|||
*/
|
||||
private $session = null;
|
||||
|
||||
/**
|
||||
* Database connection instance.
|
||||
*
|
||||
* @var ConnectionAbstract
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $connection = null;
|
||||
|
||||
/**
|
||||
* Authenticator.
|
||||
*
|
||||
|
|
@ -66,16 +60,14 @@ class AccountManager implements \Countable
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ConnectionAbstract $connection Database connection
|
||||
* @param SessionInterface $session Session
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct(ConnectionAbstract $connection, SessionInterface $session)
|
||||
public function __construct(SessionInterface $session)
|
||||
{
|
||||
$this->connection = $connection;
|
||||
$this->session = $session;
|
||||
$this->auth = new Auth($this->connection, $this->session);
|
||||
$this->auth = new Auth($this->session);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@ declare(strict_types=1);
|
|||
namespace phpOMS\Account;
|
||||
|
||||
/**
|
||||
* InfoManager class.
|
||||
*
|
||||
* Handling the info files for modules
|
||||
* Permission class.
|
||||
*
|
||||
* This permission abstract is the basis for all permissions. Contrary to it's name it is not an
|
||||
* abstract class and can be used directly if needed.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Module
|
||||
|
|
@ -26,7 +27,7 @@ namespace phpOMS\Account;
|
|||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class PermissionAbstract
|
||||
class PermissionAbstract
|
||||
{
|
||||
/**
|
||||
* Permission id.
|
||||
|
|
|
|||
|
|
@ -39,26 +39,16 @@ class Auth
|
|||
*/
|
||||
private $session = null;
|
||||
|
||||
/**
|
||||
* Database connection instance.
|
||||
*
|
||||
* @var ConnectionAbstract
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $connection = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ConnectionAbstract $connection Database connection
|
||||
* @param SessionInterface $session Session
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct(ConnectionAbstract $connection, SessionInterface $session)
|
||||
public function __construct(SessionInterface $session)
|
||||
{
|
||||
$this->connection = $connection;
|
||||
$this->session = $session;
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ declare(strict_types=1);
|
|||
namespace phpOMS\Business\Marketing;
|
||||
|
||||
/**
|
||||
* Net Promoter Score
|
||||
* Marketing Metrics
|
||||
*
|
||||
* This class provided basic marketing metric calculations
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Business
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ namespace phpOMS\Business\Marketing;
|
|||
|
||||
/**
|
||||
* Net Promoter Score
|
||||
*
|
||||
* The net promoter score is a basic evaluation of the happiness of customers.
|
||||
* Instead of customers the NPS can also be transferred to non-customers.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Business
|
||||
|
|
|
|||
|
|
@ -12,9 +12,13 @@
|
|||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Business\Programming;
|
||||
|
||||
/**
|
||||
* Programming metrics
|
||||
*
|
||||
* This class provides basic programming metric calculations.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Business
|
||||
|
|
|
|||
|
|
@ -12,9 +12,14 @@
|
|||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Business\Sales;
|
||||
|
||||
/**
|
||||
* Market share calculations (Zipf function)
|
||||
*
|
||||
* This class can be used to calculate the market share based on a rank or vice versa
|
||||
* the rank based on a marketshare in a Zipf distributed market.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Business
|
||||
|
|
@ -24,11 +29,11 @@ namespace phpOMS\Business\Sales;
|
|||
*/
|
||||
class MarketShareEstimation {
|
||||
/**
|
||||
* Calculate rank (r) based on marketshare (m)
|
||||
* Calculate rank (r) based on market share (m)
|
||||
*
|
||||
* @latex r = \sqrt[s]{\frac{1}{m \times \sum_{n=1}^N{\frac{1}{n^{s}}}}}
|
||||
*
|
||||
* @param int $participants (p)
|
||||
* @param int $participants (N)
|
||||
* @param float $marketShare (m)
|
||||
* @param float $modifier (s)
|
||||
*
|
||||
|
|
@ -47,11 +52,11 @@ class MarketShareEstimation {
|
|||
}
|
||||
|
||||
/**
|
||||
* Calculate marketshare (m) based on rank (r)
|
||||
* Calculate market share (m) based on rank (r)
|
||||
*
|
||||
* @latex m = \frac{\frac{1}{r^{s}}}{\sum_{n=1}^N{\frac{1}{n^{s}}}}
|
||||
*
|
||||
* @param int $participants (p)
|
||||
* @param int $participants (N)
|
||||
* @param int $rank (r)
|
||||
* @param float $modifier (s)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace phpOMS\Message\Mail;
|
|||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class MailAbstract
|
||||
class EmailAbstract
|
||||
{
|
||||
/**
|
||||
* Host.
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function permission(string $path) : string
|
||||
public static function permission(string $path) : int
|
||||
{
|
||||
// TODO: Implement permission() method.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,9 +192,9 @@ class File extends FileAbstract implements FileInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function permission(string $path) : string
|
||||
public static function permission(string $path) : int
|
||||
{
|
||||
return self::parseFtpFileData($path)['permission'] ?? '';
|
||||
return (int) self::parseFtpFileData($path)['permission'] ?? 0;
|
||||
}
|
||||
|
||||
private static function parseFtpFileData(string $path) : array
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder;
|
||||
namespace phpOMS\Utils\EDI\AnsiX12;
|
||||
|
||||
/**
|
||||
* EDI
|
||||
|
|
|
|||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode11 extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode128 extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode25 extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode39 extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class Barcode93 extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class BarcodeCodebar extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class BarcodeDatamatrix extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class BarcodeEAN extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class BarcodeMSI extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -19,5 +19,8 @@ use phpOMS\Validation\ValidatorAbstract;
|
|||
|
||||
class QrCode extends ValidatorAbstract
|
||||
{
|
||||
|
||||
public static function isValid($value, array $constraints = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user