Skip to content

Commit

Permalink
Merge pull request #1229 from sabre-io/dependabot/composer/friendsofp…
Browse files Browse the repository at this point in the history
…hp/php-cs-fixer-3.45.0

Update friendsofphp/php-cs-fixer requirement from 3.3.2 to 3.45.0
  • Loading branch information
ByteHamster authored Feb 4, 2024
2 parents 05b8830 + 6299ac4 commit bca95f4
Show file tree
Hide file tree
Showing 22 changed files with 72 additions and 68 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
cs-fixer: [ true ]
include:
- php-versions: '8.1'
- php-versions: '7.2'
cs-fixer: false
- php-versions: '8.2'
- php-versions: '7.3'
cs-fixer: false
steps:
- name: Checkout
Expand Down
6 changes: 5 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
'@PSR2' => true,
'@Symfony' => true,
'binary_operator_spaces' => [],
'braces' => ['position_after_functions_and_oop_constructs' => 'same'],
'braces_position' => [
'functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'same_line'],
'concat_space' => ['spacing' => 'one'],
'fully_qualified_strict_types' => false,
'no_superfluous_phpdoc_tags' => false,
'no_unneeded_control_parentheses' => false,
'phpdoc_align' => false,
'single_line_comment_style' => false,
'single_line_comment_spacing' => false,
'single_quote' => false,
'trailing_comma_in_multiline' => true,
'visibility_required' => false,
Expand Down
7 changes: 3 additions & 4 deletions Core/Frameworks/Baikal/Core/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

namespace Baikal\Core;

use PDO;
use Symfony\Component\Yaml\Yaml;

/**
Expand Down Expand Up @@ -71,7 +70,7 @@ class Server {
/**
* Reference to Database object.
*
* @var PDO
* @var \PDO
*/
protected $pdo;

Expand All @@ -96,10 +95,10 @@ class Server {
* @param bool $enableCardDAV
* @param string $authType
* @param string $authRealm
* @param PDO $pdo
* @param \PDO $pdo
* @param string $baseUri
*/
function __construct($enableCalDAV, $enableCardDAV, $authType, $authRealm, PDO $pdo, $baseUri) {
function __construct($enableCalDAV, $enableCardDAV, $authType, $authRealm, \PDO $pdo, $baseUri) {
$this->enableCalDAV = $enableCalDAV;
$this->enableCardDAV = $enableCardDAV;
$this->authType = $authType;
Expand Down
2 changes: 1 addition & 1 deletion Core/Frameworks/Baikal/Model/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ function hasInstances() {
$rSql = $GLOBALS["DB"]->exec_SELECTquery(
"count(*)",
"calendarinstances",
"calendarid" . "='" . $this->aData["calendarid"] . "'"
"calendarid='" . $this->aData["calendarid"] . "'"
);

if (($aRs = $rSql->fetch()) === false) {
Expand Down
2 changes: 1 addition & 1 deletion Core/Frameworks/Baikal/Model/Calendar/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function hasInstances() {
$rSql = $GLOBALS["DB"]->exec_SELECTquery(
"count(*)",
"calendarinstances",
"calendarid" . "='" . $this->aData["id"] . "'"
"calendarid='" . $this->aData["id"] . "'"
);

if (($aRs = $rSql->fetch()) === false) {
Expand Down
6 changes: 3 additions & 3 deletions Core/Frameworks/Baikal/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ protected function getConfigAsString() {

function writable() {
return (
@file_exists(PROJECT_PATH_CONFIG . "baikal.yaml") &&
@is_file(PROJECT_PATH_CONFIG . "baikal.yaml") &&
@is_writable(PROJECT_PATH_CONFIG . "baikal.yaml")
@file_exists(PROJECT_PATH_CONFIG . "baikal.yaml")
&& @is_file(PROJECT_PATH_CONFIG . "baikal.yaml")
&& @is_writable(PROJECT_PATH_CONFIG . "baikal.yaml")
);
}

Expand Down
2 changes: 1 addition & 1 deletion Core/Frameworks/Baikal/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class User extends \Flake\Core\Model\Db {
"digesta1" => "",
];

protected $oIdentityPrincipal = null;
protected $oIdentityPrincipal;

function initByPrimary($sPrimary) {
parent::initByPrimary($sPrimary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function render() {
exit(0);

#$sMessage = "<p>Baïkal is now configured. You may <a class='btn btn-success' href='" . PROJECT_URI . "admin/'>Access the Baïkal admin</a></p>";
#$sForm = "";
#$sForm = "";
} else {
$sMessage = "";
$sForm = $this->oForm->render();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ protected function upgrade($databaseConfig, $sVersionFrom, $sVersionTo) {
UNIQUE (calendarid, share_href)
);
SQL
);
);
$this->aSuccess[] = 'Created calendarinstances table';
$pdo->exec('
INSERT INTO calendarinstances
Expand Down Expand Up @@ -426,7 +426,7 @@ protected function upgrade($databaseConfig, $sVersionFrom, $sVersionTo) {
components text NOT NULL
);
SQL
);
);
$this->aSuccess[] = 'Created new calendars table';
} else { // mysql
$pdo->exec(<<<SQL
Expand All @@ -450,7 +450,7 @@ protected function upgrade($databaseConfig, $sVersionFrom, $sVersionTo) {
UNIQUE(calendarid, share_href)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
SQL
);
);
$this->aSuccess[] = 'Created calendarinstances table';
$pdo->exec('
INSERT INTO calendarinstances
Expand Down Expand Up @@ -489,14 +489,14 @@ protected function upgrade($databaseConfig, $sVersionFrom, $sVersionTo) {
components VARBINARY(21)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SQL
);
);
$this->aSuccess[] = 'Created new calendars table';
}

$pdo->exec(<<<SQL
INSERT INTO calendars (id, synctoken, components) SELECT id, COALESCE(synctoken,1) as synctoken, COALESCE(components,"VEVENT,VTODO,VJOURNAL") as components FROM $calendarBackup
SQL
);
);
$this->aSuccess[] = 'Migrated calendars table';
}
if (version_compare($sVersionFrom, '0.9.4', '<')) {
Expand Down
6 changes: 3 additions & 3 deletions Core/Frameworks/BaikalAdmin/Controller/Navigation/Topbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ function render() {
$sActiveHome = "active";
}
if (
$sCurrentRoute === $GLOBALS["ROUTER"]::getRouteForController("\BaikalAdmin\Controller\Users") ||
$sCurrentRoute === $GLOBALS["ROUTER"]::getRouteForController("\BaikalAdmin\Controller\User\Calendars") ||
$sCurrentRoute === $GLOBALS["ROUTER"]::getRouteForController("\BaikalAdmin\Controller\User\AddressBooks")
$sCurrentRoute === $GLOBALS["ROUTER"]::getRouteForController("\BaikalAdmin\Controller\Users")
|| $sCurrentRoute === $GLOBALS["ROUTER"]::getRouteForController("\BaikalAdmin\Controller\User\Calendars")
|| $sCurrentRoute === $GLOBALS["ROUTER"]::getRouteForController("\BaikalAdmin\Controller\User\AddressBooks")
) {
$sActiveUsers = "active";
}
Expand Down
4 changes: 2 additions & 2 deletions Core/Frameworks/BaikalAdmin/Controller/Settings/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ function validationHook(\Formal\Form $oForm, \Formal\Form\Morphology $oMorpho) {
} catch (\Exception $e) {
$oForm->declareError(
$oMorpho->element("sqlite_file"),
"Baïkal was not able to establish a connexion to the SQLite database as configured.<br />SQLite says: " . $e->getMessage() . (string) $e
);
"Baïkal was not able to establish a connexion to the SQLite database as configured.<br />SQLite says: " . $e->getMessage() . (string) $e
);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ function generateSprite($aSymbols, $iCols, $iRows, $iPngWidth, $iPngHeight, $sCl
CSS;
}

$sCss = "\n" . "/* " . count($aSprites) . " glyphs, generated on " . strftime("%Y-%m-%d %H:%M:%S") . "; C=" . $iCols . "; R=" . $iRows . "; W=" . $iPngWidth . "; H=" . $iPngHeight . "; PREFIX=" . $sClassPrefix . " */\n" . $sCss;
$sCss = "\n/* " . count($aSprites) . " glyphs, generated on " . strftime("%Y-%m-%d %H:%M:%S") . "; C=" . $iCols . "; R=" . $iRows . "; W=" . $iPngWidth . "; H=" . $iPngHeight . "; PREFIX=" . $sClassPrefix . " */\n" . $sCss;

return $sCss;
}
6 changes: 3 additions & 3 deletions Core/Frameworks/Flake/Controller/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ function log($sStr) {

function header($sMsg) {
$sStr = "\n" . str_repeat("#", 80);
$sStr .= "\n" . "#" . str_repeat(" ", 78) . "#";
$sStr .= "\n" . "#" . str_pad(strtoupper($sMsg), 78, " ", STR_PAD_BOTH) . "#";
$sStr .= "\n" . "#" . str_repeat(" ", 78) . "#";
$sStr .= "\n#" . str_repeat(" ", 78) . "#";
$sStr .= "\n#" . str_pad(strtoupper($sMsg), 78, " ", STR_PAD_BOTH) . "#";
$sStr .= "\n#" . str_repeat(" ", 78) . "#";
$sStr .= "\n" . str_repeat("#", 80);
$sStr .= "\n";

Expand Down
32 changes: 16 additions & 16 deletions Core/Frameworks/Flake/Core/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ function remove($sKey) {

function &__call($sName, $aArguments) {
if (
strlen($sName) > 7 &&
$sName[0] === "s" &&
$sName[1] === "e" &&
$sName[2] === "t" &&
$sName[3] === "M" &&
$sName[4] === "e" &&
$sName[5] === "t" &&
$sName[6] === "a"
strlen($sName) > 7
&& $sName[0] === "s"
&& $sName[1] === "e"
&& $sName[2] === "t"
&& $sName[3] === "M"
&& $sName[4] === "e"
&& $sName[5] === "t"
&& $sName[6] === "a"
) {
$sKey = strtolower(substr($sName, 7, 1)) . substr($sName, 8);
$mValue = &$aArguments[0];
Expand All @@ -199,14 +199,14 @@ function &__call($sName, $aArguments) {

return $res; # To avoid 'Notice: Only variable references should be returned by reference'
} elseif (
strlen($sName) > 7 &&
$sName[0] === "g" &&
$sName[1] === "e" &&
$sName[2] === "t" &&
$sName[3] === "M" &&
$sName[4] === "e" &&
$sName[5] === "t" &&
$sName[6] === "a"
strlen($sName) > 7
&& $sName[0] === "g"
&& $sName[1] === "e"
&& $sName[2] === "t"
&& $sName[3] === "M"
&& $sName[4] === "e"
&& $sName[5] === "t"
&& $sName[6] === "a"
) {
$sKey = strtolower(substr($sName, 7, 1)) . substr($sName, 8);
if (array_key_exists($sKey, $this->aMeta)) {
Expand Down
1 change: 1 addition & 0 deletions Core/Frameworks/Flake/Core/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ static function buildRoute($aParams = []) {
# TODO: il faut remplacer le mécanisme basé sur un nombre variable de paramètres en un mécanisme basé sur un seul paramètre "tableau"
#$aParams = func_get_args();
$sController = "\\" . get_called_class();

#array_unshift($aParams, $sController); # Injecting current controller as first param
#return call_user_func_array($GLOBALS["ROUTER"] . "::buildRouteForController", $aParams);
return $GLOBALS["ROUTER"]::buildRouteForController($sController, $aParams);
Expand Down
2 changes: 1 addition & 1 deletion Core/Frameworks/Flake/Core/Database/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace Flake\Core\Database;

class Statement extends \Flake\Core\FLObject {
protected $stmt = null;
protected $stmt;

function __construct($stmt) {
$this->stmt = $stmt;
Expand Down
4 changes: 2 additions & 2 deletions Core/Frameworks/Flake/Core/Datastructure/ChainLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
namespace Flake\Core\Datastructure;

abstract class ChainLink implements \Flake\Core\Datastructure\Chainable {
protected $__container = null;
protected $__key = null;
protected $__container;
protected $__key;

function chain(Chain $container, $key) {
$this->__container = $container;
Expand Down
2 changes: 1 addition & 1 deletion Core/Frameworks/Flake/Framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected static function defineBaseUri() {
if (isset($config["system"]["base_uri"]) && $config["system"]["base_uri"] !== "") {
// SabreDAV needs a "/" at the beginning of BASEURL
define("PROJECT_BASEURI",
self::prependSlash(self::appendSlash($config["system"]["base_uri"])));
self::prependSlash(self::appendSlash($config["system"]["base_uri"])));
define("PROJECT_URI", \Flake\Util\Tools::getCurrentProtocol() . "://"
. $_SERVER["HTTP_HOST"] . PROJECT_BASEURI);

Expand Down
24 changes: 12 additions & 12 deletions Core/Frameworks/Flake/Util/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ static function sendHtmlMail($sToAddress, $sSubject, $sBody, $sFromName, $sFromA
</html>
TEST;

$sHeaders = "From: " . $sFromName . "<" . $sFromAddress . ">" . "\r\n";
$sHeaders .= "Reply-To: " . $sReplyToName . "<" . $sReplyToAddress . ">" . "\r\n";
$sHeaders .= "Bcc: " . $sReplyToName . "<" . $sReplyToAddress . ">" . "\r\n";
$sHeaders .= "Content-Type: text/html" . "\r\n";
$sHeaders = "From: " . $sFromName . "<" . $sFromAddress . ">\r\n";
$sHeaders .= "Reply-To: " . $sReplyToName . "<" . $sReplyToAddress . ">\r\n";
$sHeaders .= "Bcc: " . $sReplyToName . "<" . $sReplyToAddress . ">\r\n";
$sHeaders .= "Content-Type: text/html\r\n";

mail($sToAddress, $sSubject, $sMessage, $sHeaders);
}
Expand Down Expand Up @@ -761,14 +761,14 @@ static function gzdecode($data, &$filename = '', &$error = '', $maxlength = null
$data = "";
if ($bodylen > 0) {
switch ($method) {
case 8:
// Currently the only supported compression method:
$data = gzinflate($body, $maxlength);
break;
default:
$error = "Unknown compression method.";

return false;
case 8:
// Currently the only supported compression method:
$data = gzinflate($body, $maxlength);
break;
default:
$error = "Unknown compression method.";

return false;
}
} // zero-byte body content is allowed
// Verifiy CRC32
Expand Down
8 changes: 4 additions & 4 deletions Core/Frameworks/Formal/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ class Form {
"hook.validation" => false,
"hook.morphology" => false,
];
protected $oModelInstance = null;
protected $oElements = null;
protected $oModelInstance;
protected $oElements;
protected $aErrors = [];
protected $bPersisted = null; # TRUE when form has persisted; available only after execute
protected $bPersisted; # TRUE when form has persisted; available only after execute

protected $sDisplayTitle = ""; # Displayed form title; generated in setModelInstance()
protected $sDisplayMessage = ""; # Displayed confirm message; generated in execute()

protected $oMorpho = null;
protected $oMorpho;

function __construct($sModelClass, $aOptions = []) {
$this->sModelClass = $sModelClass;
Expand Down
2 changes: 1 addition & 1 deletion Core/Frameworks/Formal/Form/Morphology.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace Formal\Form;

class Morphology {
protected $oElements = null;
protected $oElements;

function __construct() {
$this->oElements = new \Flake\Core\CollectionTyped("\Formal\Element");
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"ext-zlib" : "*"
},
"require-dev" : {
"friendsofphp/php-cs-fixer": "3.3.2",
"phpstan/phpstan": "^1.2"
"friendsofphp/php-cs-fixer": "3.45.0",
"phpstan/phpstan": "^1.10"
},
"replace" : {
"jeromeschneider/baikal" : "self.version"
Expand Down

0 comments on commit bca95f4

Please sign in to comment.