-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1041 from oat-sa/feature/ADF-1440/psr-12-apply
chore: apply PSR-12
- Loading branch information
Showing
453 changed files
with
4,530 additions
and
2,815 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -14,9 +15,12 @@ | |
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2); | ||
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER); | ||
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV); | ||
* Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg | ||
* (under the project TAO & TAO2); | ||
* 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung | ||
* (under the project TAO-TRANSFER); | ||
* 2009-2012 (update and modification) Public Research Centre Henri Tudor | ||
* (under the project TAO-SUSTAIN & TAO-DEV); | ||
* | ||
*/ | ||
|
||
|
@@ -65,12 +69,12 @@ public function getSerial() | |
{ | ||
$returnValue = (string) ''; | ||
|
||
|
||
if (empty($this->serial)) { | ||
$this->serial = $this->buildSerial(); | ||
} | ||
$returnValue = $this->serial; | ||
|
||
|
||
return (string) $returnValue; | ||
} | ||
|
@@ -84,7 +88,7 @@ public function getSerial() | |
*/ | ||
public function __construct() | ||
{ | ||
|
||
if (!is_null($this->getCache())) { | ||
$this->getCache()->put($this); | ||
} | ||
|
@@ -101,7 +105,7 @@ public function __sleep() | |
{ | ||
$returnValue = []; | ||
|
||
|
||
$this->serializedProperties = []; | ||
$reflection = new ReflectionClass($this); | ||
foreach ($reflection->getProperties() as $property) { | ||
|
@@ -122,7 +126,10 @@ public function __sleep() | |
} | ||
} | ||
if ($containsNonSerializable && $containsSerializable) { | ||
throw new common_exception_Error('Serializable ' . $this->getSerial() . ' mixed serializable and non serializable values in property ' . $propertyName); | ||
throw new common_exception_Error( | ||
'Serializable ' . $this->getSerial() | ||
. ' mixed serializable and non serializable values in property ' . $propertyName | ||
); | ||
} | ||
} else { | ||
if (is_object($value) && $value instanceof self) { | ||
|
@@ -137,7 +144,7 @@ public function __sleep() | |
} | ||
} | ||
} | ||
|
||
|
||
return (array) $returnValue; | ||
} | ||
|
@@ -151,7 +158,7 @@ public function __sleep() | |
*/ | ||
public function __wakeup() | ||
{ | ||
|
||
foreach ($this->serializedProperties as $key => $value) { | ||
if (is_array($value)) { | ||
$restored = []; | ||
|
@@ -172,16 +179,19 @@ public function __wakeup() | |
* @access public | ||
* @author Jerome Bogaerts, <[email protected]> | ||
* @return mixed | ||
* | ||
* phpcs:disable PSR2.Methods.MethodDeclaration | ||
*/ | ||
public function _remove() | ||
{ | ||
|
||
//usefull only when persistance is enabled | ||
if (!is_null($this->getCache())) { | ||
//clean session | ||
$this->getCache()->remove($this->getSerial()); | ||
} | ||
} | ||
// phpcs:enable PSR2.Methods.MethodDeclaration | ||
|
||
/** | ||
* Short description of method getSuccessors | ||
|
@@ -194,7 +204,7 @@ public function getSuccessors() | |
{ | ||
$returnValue = []; | ||
|
||
|
||
$reflection = new ReflectionClass($this); | ||
foreach ($reflection->getProperties() as $property) { | ||
if (!$property->isStatic() && !$property->isPrivate()) { | ||
|
@@ -203,15 +213,15 @@ public function getSuccessors() | |
if (is_array($value)) { | ||
foreach ($value as $key => $subvalue) { | ||
if (is_object($subvalue) && $subvalue instanceof self) { | ||
$returnValue[] = $subvalue; | ||
$returnValue[] = $subvalue; | ||
} | ||
} | ||
} elseif (is_object($value) && $value instanceof self) { | ||
$returnValue[] = $value; | ||
$returnValue[] = $value; | ||
} | ||
} | ||
} | ||
|
||
|
||
return (array) $returnValue; | ||
} | ||
|
@@ -228,7 +238,7 @@ public function getPredecessors($classFilter = null) | |
{ | ||
$returnValue = []; | ||
|
||
|
||
foreach ($this->getCache()->getAll() as $serial => $instance) { | ||
if ( | ||
($classFilter == null || $instance instanceof $classFilter) | ||
|
@@ -238,7 +248,7 @@ public function getPredecessors($classFilter = null) | |
break; | ||
} | ||
} | ||
|
||
|
||
return (array) $returnValue; | ||
} | ||
|
@@ -262,4 +272,4 @@ abstract protected function buildSerial(); | |
* @return common_cache_Cache | ||
*/ | ||
abstract public function getCache(); | ||
} /* end of abstract class common_cache_PartitionedCachable */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.