Skip to content

Commit

Permalink
chore: apply PSR-12 manual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shpran committed May 11, 2023
1 parent ec4701c commit fe1be2d
Show file tree
Hide file tree
Showing 39 changed files with 79 additions and 56 deletions.
5 changes: 4 additions & 1 deletion common/cache/class.PartitionedCachable.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ public function __wakeup()
* @access public
* @author Jerome Bogaerts, <[email protected]>
* @return mixed
*
* phpcs:disable PSR2.Methods.MethodDeclaration
*/
public function _remove()
{
Expand All @@ -183,6 +185,7 @@ public function _remove()
$this->getCache()->remove($this->getSerial());
}
}
// phpcs:enable PSR2.Methods.MethodDeclaration

/**
* Short description of method getSuccessors
Expand Down Expand Up @@ -263,4 +266,4 @@ abstract protected function buildSerial();
* @return common_cache_Cache
*/
abstract public function getCache();
} /* end of abstract class common_cache_PartitionedCachable */
}
2 changes: 1 addition & 1 deletion common/cache/class.SingletonCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ public static function getCached($function)
private function __construct()
{
}
} /* end of abstract class common_cache_SingletonCache */
}
2 changes: 1 addition & 1 deletion common/configuration/class.BoundableComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ public function getMax()
* @return string
*/
abstract public function getValue();
} /* end of abstract class common_configuration_BoundableComponent */
}
2 changes: 1 addition & 1 deletion common/configuration/class.Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ public function setName($name)

$this->name = $name;
}
} /* end of abstract class common_configuration_Component */
}
2 changes: 1 addition & 1 deletion common/ext/class.AbstractExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ public function getRequiredExtensions()
public function getVersion()
{
}
} /* end of abstract class common_ext_AbstractExtension */
}
2 changes: 1 addition & 1 deletion common/interface.Serializable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ interface common_Serializable
* @return string
*/
public function getSerial();
} /* end of interface common_Serializable */
}
2 changes: 2 additions & 0 deletions common/legacy/class.LegacyAutoLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,6 @@ private function wrapClass($legacyClass, $realClass)
}
}

// phpcs:disable PSR1.Files.SideEffects
common_legacy_LegacyAutoLoader::register();
// phpcs:enable PSR1.Files.SideEffects
2 changes: 1 addition & 1 deletion common/log/interface.Appender.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ public function getLogThreshold();
* @return boolean
*/
public function init($configuration);
} /* end of interface common_log_Appender */
}
2 changes: 1 addition & 1 deletion common/log/interface.SeverityLevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ interface common_log_SeverityLevel
* @return int
*/
public function getSeverity();
} /* end of interface common_log_SeverityLevel */
}
4 changes: 2 additions & 2 deletions common/oatbox/service/ServiceFactoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -21,6 +19,8 @@
*
*/

declare(strict_types=1);

namespace oat\oatbox\service;

use Zend\ServiceManager\ServiceLocatorInterface;
Expand Down
3 changes: 3 additions & 0 deletions common/persistence/class.Persistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ public static function getPersistence($driverId)
* @author "Lionel Lecaque, <[email protected]>"
* @param array $params
* @param common_persistence_driver $driver
*
* phpcs:disable PEAR.Functions.ValidDefaultValue
*/
public function __construct($params = [], common_persistence_driver $driver)
{
$this->setParams($params);
$this->setDriver($driver);
}
// phpcs:enable PEAR.Functions.ValidDefaultValue

/**
* Retrieve persistence's driver
Expand Down
2 changes: 1 addition & 1 deletion common/uri/class.AbstractUriProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ public function __construct($driver)

$this->setDriver($driver);
}
} /* end of abstract class common_uri_AbstractUriProvider */
}
4 changes: 2 additions & 2 deletions config/default/SimpleCache.conf.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use oat\oatbox\cache\KeyValueCache;

/**
* The default cache implementation
*/

use oat\oatbox\cache\KeyValueCache;

return new KeyValueCache([
KeyValueCache::OPTION_PERSISTENCE => 'cache'
]);
4 changes: 2 additions & 2 deletions config/default/session.conf.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

use oat\oatbox\session\SessionService;

/**
* Session config
*/

use oat\oatbox\session\SessionService;

return new SessionService();
4 changes: 2 additions & 2 deletions config/default/uriProvider.conf.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

use oat\generis\model\kernel\uri\Bin2HexUriProvider;

/**
* Default config header
*
* To replace this add a file generis/conf/header/uriProvider.conf.php
*/

use oat\generis\model\kernel\uri\Bin2HexUriProvider;

return new Bin2HexUriProvider([
Bin2HexUriProvider::OPTION_NAMESPACE => LOCAL_NAMESPACE . '#'
]);
2 changes: 1 addition & 1 deletion core/kernel/api/interface.Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ public function logIn($login, $password, $module, $role);
* @return boolean
*/
public function logOut();
} /* end of interface core_kernel_api_Api */
}
2 changes: 2 additions & 0 deletions core/kernel/classes/class.DbWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
*
*/

// phpcs:disable PSR1.Files.SideEffects
error_reporting(E_ALL);
// phpcs:enable PSR1.Files.SideEffects


/**
Expand Down
2 changes: 2 additions & 0 deletions core/kernel/impl/class.ApiModelOO.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
use oat\oatbox\service\ServiceManager;
use Zend\ServiceManager\ServiceLocatorInterface;

// phpcs:disable PSR1.Files.SideEffects
error_reporting(E_ALL);
// phpcs:enable PSR1.Files.SideEffects

/**
* Generis Object Oriented API - core\kernel\impl\class.ApiModelOO.php
Expand Down
2 changes: 1 addition & 1 deletion core/kernel/persistence/interface.PropertyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ public function setMultiple(core_kernel_classes_Resource $resource, $isMultiple)
* @return void
*/
public function setLgDependent(core_kernel_classes_Resource $resource, $isLgDependent);
} /* end of interface core_kernel_persistence_PropertyInterface */
}
4 changes: 2 additions & 2 deletions core/kernel/persistence/newsql/NewSqlRdf.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -22,6 +20,8 @@
* @license GPLv2
*/

declare(strict_types=1);

namespace oat\generis\model\kernel\persistence\newsql;

use core_kernel_classes_Triple;
Expand Down
4 changes: 2 additions & 2 deletions core/kernel/persistence/smoothsql/class.SmoothRdf.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -21,6 +19,8 @@
*
*/

declare(strict_types=1);

use Doctrine\DBAL\ParameterType;
use oat\generis\model\data\Ontology;
use oat\generis\model\data\RdfInterface;
Expand Down
30 changes: 12 additions & 18 deletions core/kernel/rules/class.Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,10 @@ public function expEval($variable = [])
) {
common_Logger::d('Both Part are Container', ['Generis Expression']);
$returnValue = $this->operatorEval($firstPart, $secondPart);
}

//both are vector
elseif (
} elseif (
//both are vector
$firstPart instanceof core_kernel_classes_ContainerCollection
&& $secondPart instanceof core_kernel_classes_ContainerCollection
&& $secondPart instanceof core_kernel_classes_ContainerCollection
) {
$returnValue = false;
foreach ($firstPart->getIterator() as $subLeftPart) {
Expand All @@ -240,11 +238,10 @@ public function expEval($variable = [])
//die("the evaluation is ". $returnValue);

//throw new common_Exception('not implemented yet', __FILE__,__LINE__);
}
// first is a vector second is a value
elseif (
($firstPart instanceof core_kernel_classes_ContainerCollection)
&& ($secondPart instanceof core_kernel_classes_Container)
} elseif (
// first is a vector second is a value
$firstPart instanceof core_kernel_classes_ContainerCollection
&& $secondPart instanceof core_kernel_classes_Container
) {
$tempResult = false;
foreach ($firstPart->getIterator() as $container) {
Expand All @@ -265,11 +262,10 @@ public function expEval($variable = [])
}
}
$returnValue = $tempResult;
}
// first is a value second is a vector
elseif (
($firstPart instanceof core_kernel_classes_Container)
&& ($secondPart instanceof core_kernel_classes_ContainerCollection)
} elseif (
// first is a value second is a vector
$firstPart instanceof core_kernel_classes_Container
&& $secondPart instanceof core_kernel_classes_ContainerCollection
) {
foreach ($secondPart->getIterator() as $container) {
common_Logger::d('FirstPart Part Container is Second is ContainerCollection', ['Generis Expression']);
Expand All @@ -279,9 +275,7 @@ public function expEval($variable = [])
$tempResult = $tempResult && $this->operatorEval($firstPart, $container);
}
$returnValue = $tempResult;
}
//case we compare boolean
else {
} else { //case we compare boolean
common_Logger::d('Both part are boolean', ['Generis Expression']);

switch ($this->getLogicalOperator()->getUri()) {
Expand Down
2 changes: 1 addition & 1 deletion core/kernel/users/interface.UsersManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ public function getAllowedRoles();
* @return core_kernel_classes_Resource
*/
public function getDefaultRole();
} /* end of interface core_kernel_users_UsersManagement */
}
2 changes: 2 additions & 0 deletions test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* @license GPLv2
* @package package_name
* @subpackage
*
* phpcs:disable PSR1.Files.SideEffects
*/

$extensionRoot = realpath(__DIR__ . '/../');
Expand Down
2 changes: 2 additions & 0 deletions test/integration/mutex/test_action.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

// phpcs:disable PSR1.Files.SideEffects

require_once __DIR__ . '/../../../common/inc.extension.php';

use oat\oatbox\mutex\LockService;
Expand Down
2 changes: 2 additions & 0 deletions test/integration/rules/ExpressionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
* 2017 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*/

// phpcs:disable PSR1.Files.SideEffects
error_reporting(E_ALL);
// phpcs:enable PSR1.Files.SideEffects

use oat\generis\model\RulesRdf;
use oat\generis\test\GenerisPhpUnitTestRunner;
Expand Down
3 changes: 1 addition & 2 deletions test/integration/rules/ExpressionTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

use oat\generis\model\RulesRdf;

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -24,6 +22,7 @@
*/

use oat\generis\test\TestCase;
use oat\generis\model\RulesRdf;

class ExpressionTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions test/integration/rules/OperationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
* 2017 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*/

// phpcs:disable PSR1.Files.SideEffects
error_reporting(E_ALL);
// phpcs:enable PSR1.Files.SideEffects

use oat\generis\model\RulesRdf;
use oat\generis\test\GenerisPhpUnitTestRunner;
Expand Down
2 changes: 2 additions & 0 deletions test/integration/rules/OperationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
* 2017 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*/

// phpcs:disable PSR1.Files.SideEffects
error_reporting(E_ALL);
// phpcs:enable PSR1.Files.SideEffects

use oat\generis\model\RulesRdf;
use oat\generis\test\GenerisPhpUnitTestRunner;
Expand Down
2 changes: 2 additions & 0 deletions test/integration/rules/TermFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
* 2017 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*/

// phpcs:disable PSR1.Files.SideEffects
error_reporting(E_ALL);
// phpcs:enable PSR1.Files.SideEffects

use oat\generis\model\GenerisRdf;
use oat\generis\model\OntologyRdfs;
Expand Down
3 changes: 3 additions & 0 deletions test/integration/rules/TermTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
* 2017 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*/

// phpcs:disable PSR1.Files.SideEffects
error_reporting(E_ALL);
// phpcs:enable PSR1.Files.SideEffects

use oat\generis\model\GenerisRdf;
use oat\generis\model\OntologyRdfs;
Expand Down
3 changes: 1 addition & 2 deletions test/samples/manifests/complexManifest.php
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
Expand All @@ -18,8 +19,6 @@
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
*
*/
?>
<?php

/**
* @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
Expand Down
3 changes: 1 addition & 2 deletions test/samples/manifests/lightweightManifest.php
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
Expand All @@ -18,8 +19,6 @@
* 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
*
*/
?>
<?php

/**
* This lightweight manifest is based on the TAO filemanager one.
Expand Down
Loading

0 comments on commit fe1be2d

Please sign in to comment.