modif comtabilite

This commit is contained in:
2019-01-16 16:23:31 +01:00
parent 6b741a9666
commit 9312edc3ae
1844 changed files with 158848 additions and 55874 deletions
+5 -5
View File
@@ -13,7 +13,7 @@ class Message
/**
* @var array|string[]
*/
protected $messages = array();
protected $messages = [];
/**
* Add message to the queue.
@@ -25,11 +25,11 @@ class Message
public function add($message, $scope = 'default')
{
$key = md5($scope.'~'.$message);
$message = array('message' => $message, 'scope' => $scope);
$item = ['message' => $message, 'scope' => $scope];
// don't add duplicates
if (!array_key_exists($key, $this->messages)) {
$this->messages[$key] = $message;
$this->messages[$key] = $item;
}
return $this;
@@ -47,7 +47,7 @@ class Message
$this->messages = array();
} else {
foreach ($this->messages as $key => $message) {
if ($message['scope'] == $scope) {
if ($message['scope'] === $scope) {
unset($this->messages[$key]);
}
}
@@ -69,7 +69,7 @@ class Message
$messages = array();
foreach ($this->messages as $message) {
if ($message['scope'] == $scope) {
if ($message['scope'] === $scope) {
$messages[] = $message;
}
}
+5 -12
View File
@@ -31,12 +31,11 @@ class Session implements \IteratorAggregate
{
// Session is a singleton.
if (isset(self::$instance)) {
throw new \RuntimeException("Session has already been initialized.", 500);
throw new \RuntimeException('Session has already been initialized.', 500);
}
// Destroy any existing sessions started with session.auto_start
if ($this->isSessionStarted())
{
if ($this->isSessionStarted()) {
session_unset();
session_destroy();
}
@@ -52,12 +51,6 @@ class Session implements \IteratorAggregate
register_shutdown_function([$this, 'close']);
session_cache_limiter('nocache');
if (isset($this->count)) {
$this->count++;
} else {
$this->count = 1;
}
self::$instance = $this;
}
@@ -69,7 +62,7 @@ class Session implements \IteratorAggregate
*/
public function instance()
{
if (!isset(self::$instance)) {
if (null === self::$instance) {
throw new \RuntimeException("Session hasn't been initialized.", 500);
}
@@ -101,7 +94,7 @@ class Session implements \IteratorAggregate
/**
* Get session ID
*
* @return string Session ID
* @return string|null Session ID
*/
public function getId()
{
@@ -126,7 +119,7 @@ class Session implements \IteratorAggregate
/**
* Get session name
*
* @return string
* @return string|null
*/
public function getName()
{