Skip to content

Commit d1d6358

Browse files
authored
PHP-CS-Fixer: added all directories to checks (#4406)
* Add all directories to checks * composer.lock * composer.lock * rector: exclude files * composer.json
1 parent 360b6f5 commit d1d6358

File tree

13 files changed

+122
-119
lines changed

13 files changed

+122
-119
lines changed

.rector.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@
99

1010
return RectorConfig::configure()
1111
->withPaths([
12-
__DIR__ . '/app',
13-
__DIR__ . '/dev',
14-
__DIR__ . '/errors',
15-
__DIR__ . '/lib',
16-
__DIR__ . '/pub',
17-
__DIR__ . '/shell',
18-
__DIR__ . '/tests',
12+
__DIR__,
1913
])
2014
->withSkipPath(__DIR__ . '/vendor')
2115
->withSkip([

get.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ function sendNotFoundPage()
174174
* Check resource by whitelist
175175
*
176176
* @param string $resource
177-
* @param array $allowedResources
178177
*/
179178
function checkResource($resource, array $allowedResources)
180179
{

lib/3Dsecure/CentinelErrors.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
// Distributed by license from CardinalCommerce Corporation
34
/////////////////////////////////////////////////////////////////////////////////////////////
45
// CardinalCommerce (http://www.cardinalcommerce.com)
@@ -10,11 +11,11 @@
1011
//
1112
/////////////////////////////////////////////////////////////////////////////////////////////
1213

13-
define("CENTINEL_ERROR_CODE_8000", "8000");
14-
define("CENTINEL_ERROR_CODE_8000_DESC", "Protocol Not Recogonized, must be http:// or https://");
15-
define("CENTINEL_ERROR_CODE_8010", "8010");
16-
define("CENTINEL_ERROR_CODE_8010_DESC", "Unable to Communicate with MAPS Server");
17-
define("CENTINEL_ERROR_CODE_8020", "8020");
18-
define("CENTINEL_ERROR_CODE_8020_DESC", "Error Parsing XML Response");
19-
define("CENTINEL_ERROR_CODE_8030", "8030");
20-
define("CENTINEL_ERROR_CODE_8030_DESC", "Communication Timeout Encountered");
14+
define('CENTINEL_ERROR_CODE_8000', '8000');
15+
define('CENTINEL_ERROR_CODE_8000_DESC', 'Protocol Not Recogonized, must be http:// or https://');
16+
define('CENTINEL_ERROR_CODE_8010', '8010');
17+
define('CENTINEL_ERROR_CODE_8010_DESC', 'Unable to Communicate with MAPS Server');
18+
define('CENTINEL_ERROR_CODE_8020', '8020');
19+
define('CENTINEL_ERROR_CODE_8020_DESC', 'Error Parsing XML Response');
20+
define('CENTINEL_ERROR_CODE_8030', '8030');
21+
define('CENTINEL_ERROR_CODE_8030_DESC', 'Communication Timeout Encountered');

lib/3Dsecure/XMLParser.php

Lines changed: 76 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
// Distributed by license from CardinalCommerce Corporation
34
/////////////////////////////////////////////////////////////////////////////////////////////
45
// CardinalCommerce (http://www.cardinalcommerce.com)
@@ -11,78 +12,78 @@
1112
//
1213
/////////////////////////////////////////////////////////////////////////////////////////////
1314

14-
class XMLParser{
15-
16-
var $xml_parser;
17-
var $deseralizedResponse;
18-
var $elementName;
19-
var $elementValue;
20-
21-
/////////////////////////////////////////////////////////////////////////////////////////////
22-
// Function XMLParser()
23-
//
24-
// Initialize the XML parser.
25-
/////////////////////////////////////////////////////////////////////////////////////////////
26-
27-
function __construct() {
28-
$this->xml_parser = xml_parser_create();
29-
}
30-
31-
/////////////////////////////////////////////////////////////////////////////////////////////
32-
// Function startElement(parser, name, attribute)
33-
//
34-
// Start Tag Element Handler
35-
/////////////////////////////////////////////////////////////////////////////////////////////
36-
37-
function startElement($parser, $name, $attrs='') {
38-
$this->elementName= $name;
39-
40-
}
41-
42-
/////////////////////////////////////////////////////////////////////////////////////////////
43-
// Function elementData(parser, data)
44-
//
45-
// Element Data Handler
46-
/////////////////////////////////////////////////////////////////////////////////////////////
47-
48-
function elementData($parser, $data) {
49-
$this->elementValue .= $data;
50-
51-
}
52-
53-
/////////////////////////////////////////////////////////////////////////////////////////////
54-
// Function endElement(name, value)
55-
//
56-
// End Tag Element Handler
57-
/////////////////////////////////////////////////////////////////////////////////////////////
58-
59-
function endElement($parser, $name) {
60-
61-
$this->deserializedResponse[$this->elementName]= $this->elementValue;
62-
$this->elementName = "";
63-
$this->elementValue = "";
64-
}
65-
66-
/////////////////////////////////////////////////////////////////////////////////////////////
67-
// Function deserialize(xmlString)
68-
//
69-
// Deserilize the XML reponse message and add each element to the deseralizedResponse collection.
70-
// Once complete, then each element reference will be available using the getValue function.
71-
/////////////////////////////////////////////////////////////////////////////////////////////
72-
73-
function deserializeXml($responseString) {
74-
75-
xml_set_object($this->xml_parser, $this);
76-
xml_parser_set_option($this->xml_parser,XML_OPTION_CASE_FOLDING,FALSE);
77-
xml_set_element_handler($this->xml_parser, "startElement", "endElement");
78-
xml_set_character_data_handler($this->xml_parser, "elementData");
79-
80-
if (!xml_parse($this->xml_parser, $responseString)) {
81-
82-
$this->deserializedResponse["ErrorNo"]= CENTINEL_ERROR_CODE_8020;
83-
$this->deserializedResponse["ErrorDesc"]= CENTINEL_ERROR_CODE_8020_DESC;
84-
}
85-
86-
xml_parser_free($this->xml_parser);
87-
}
88-
}
15+
class XMLParser
16+
{
17+
public $xml_parser;
18+
public $deseralizedResponse;
19+
public $elementName;
20+
public $elementValue;
21+
22+
/////////////////////////////////////////////////////////////////////////////////////////////
23+
// Function XMLParser()
24+
//
25+
// Initialize the XML parser.
26+
/////////////////////////////////////////////////////////////////////////////////////////////
27+
28+
public function __construct()
29+
{
30+
$this->xml_parser = xml_parser_create();
31+
}
32+
33+
/////////////////////////////////////////////////////////////////////////////////////////////
34+
// Function startElement(parser, name, attribute)
35+
//
36+
// Start Tag Element Handler
37+
/////////////////////////////////////////////////////////////////////////////////////////////
38+
39+
public function startElement($parser, $name, $attrs='')
40+
{
41+
$this->elementName= $name;
42+
}
43+
44+
/////////////////////////////////////////////////////////////////////////////////////////////
45+
// Function elementData(parser, data)
46+
//
47+
// Element Data Handler
48+
/////////////////////////////////////////////////////////////////////////////////////////////
49+
50+
public function elementData($parser, $data)
51+
{
52+
$this->elementValue .= $data;
53+
}
54+
55+
/////////////////////////////////////////////////////////////////////////////////////////////
56+
// Function endElement(name, value)
57+
//
58+
// End Tag Element Handler
59+
/////////////////////////////////////////////////////////////////////////////////////////////
60+
61+
public function endElement($parser, $name)
62+
{
63+
$this->deserializedResponse[$this->elementName]= $this->elementValue;
64+
$this->elementName = '';
65+
$this->elementValue = '';
66+
}
67+
68+
/////////////////////////////////////////////////////////////////////////////////////////////
69+
// Function deserialize(xmlString)
70+
//
71+
// Deserilize the XML reponse message and add each element to the deseralizedResponse collection.
72+
// Once complete, then each element reference will be available using the getValue function.
73+
/////////////////////////////////////////////////////////////////////////////////////////////
74+
75+
public function deserializeXml($responseString)
76+
{
77+
xml_set_object($this->xml_parser, $this);
78+
xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false);
79+
xml_set_element_handler($this->xml_parser, 'startElement', 'endElement');
80+
xml_set_character_data_handler($this->xml_parser, 'elementData');
81+
82+
if (!xml_parse($this->xml_parser, $responseString)) {
83+
$this->deserializedResponse['ErrorNo']= CENTINEL_ERROR_CODE_8020;
84+
$this->deserializedResponse['ErrorDesc']= CENTINEL_ERROR_CODE_8020_DESC;
85+
}
86+
87+
xml_parser_free($this->xml_parser);
88+
}
89+
}

lib/Unserialize/Parser.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* OpenMage
45
*
@@ -18,16 +19,16 @@
1819
*/
1920
class Unserialize_Parser
2021
{
21-
const TYPE_STRING = 's';
22-
const TYPE_INT = 'i';
23-
const TYPE_DOUBLE = 'd';
24-
const TYPE_ARRAY = 'a';
25-
const TYPE_BOOL = 'b';
26-
const TYPE_NULL = 'N';
22+
public const TYPE_STRING = 's';
23+
public const TYPE_INT = 'i';
24+
public const TYPE_DOUBLE = 'd';
25+
public const TYPE_ARRAY = 'a';
26+
public const TYPE_BOOL = 'b';
27+
public const TYPE_NULL = 'N';
2728

28-
const SYMBOL_QUOTE = '"';
29-
const SYMBOL_SEMICOLON = ';';
30-
const SYMBOL_COLON = ':';
29+
public const SYMBOL_QUOTE = '"';
30+
public const SYMBOL_SEMICOLON = ';';
31+
public const SYMBOL_COLON = ':';
3132

3233
/**
3334
* @param $str

lib/Unserialize/Reader/Arr.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* OpenMage
45
*
@@ -38,11 +39,11 @@ class Unserialize_Reader_Arr
3839
*/
3940
protected $_reader = null;
4041

41-
const READING_LENGTH = 1;
42-
const FINISHED_LENGTH = 2;
43-
const READING_KEY = 3;
44-
const READING_VALUE = 4;
45-
const FINISHED_ARR = 5;
42+
public const READING_LENGTH = 1;
43+
public const FINISHED_LENGTH = 2;
44+
public const READING_KEY = 3;
45+
public const READING_VALUE = 4;
46+
public const FINISHED_ARR = 5;
4647

4748
/**
4849
* @param $char
@@ -52,7 +53,7 @@ class Unserialize_Reader_Arr
5253
*/
5354
public function read($char, $prevChar)
5455
{
55-
$this->_result = !is_null($this->_result) ? $this->_result : array();
56+
$this->_result = !is_null($this->_result) ? $this->_result : [];
5657

5758
if (is_null($this->_status) && $prevChar == Unserialize_Parser::SYMBOL_COLON) {
5859
$this->_length .= $char;

lib/Unserialize/Reader/ArrKey.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* OpenMage
45
*
@@ -28,8 +29,8 @@ class Unserialize_Reader_ArrKey
2829
*/
2930
protected $_reader;
3031

31-
const NOT_STARTED = 1;
32-
const READING_KEY = 2;
32+
public const NOT_STARTED = 1;
33+
public const READING_KEY = 2;
3334

3435
/**
3536
* Construct

lib/Unserialize/Reader/ArrValue.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* OpenMage
45
*
@@ -18,7 +19,6 @@
1819
*/
1920
class Unserialize_Reader_ArrValue
2021
{
21-
2222
/**
2323
* @var
2424
*/
@@ -34,8 +34,8 @@ class Unserialize_Reader_ArrValue
3434
*/
3535
protected $_reader;
3636

37-
const NOT_STARTED = 1;
38-
const READING_VALUE = 2;
37+
public const NOT_STARTED = 1;
38+
public const READING_VALUE = 2;
3939

4040
public function __construct($key)
4141
{

lib/Unserialize/Reader/Bool.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* OpenMage
45
*
@@ -28,7 +29,7 @@ class Unserialize_Reader_Bool
2829
*/
2930
protected $_value;
3031

31-
const READING_VALUE = 1;
32+
public const READING_VALUE = 1;
3233

3334
/**
3435
* @param string $char

lib/Unserialize/Reader/Dbl.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* OpenMage
45
*
@@ -28,7 +29,7 @@ class Unserialize_Reader_Dbl
2829
*/
2930
protected $_value;
3031

31-
const READING_VALUE = 1;
32+
public const READING_VALUE = 1;
3233

3334
/**
3435
* @param string $char

0 commit comments

Comments
 (0)