Skip to content

Commit 47e8e49

Browse files
committed
Upgrade to php-cs-fixer 3.x. Add visibility to const (requires php 7.1)
1 parent d448ebb commit 47e8e49

File tree

121 files changed

+456
-456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+456
-456
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/.buildpath
22
/.idea
3-
/.php_cs.cache
3+
/.php-cs-fixer.cache
44
/.phpunit.result.cache
55
atlassian-ide-plugin.xml
66
/.project

.php_cs renamed to .php-cs-fixer.dist.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?php
22

3-
$config = PhpCsFixer\Config::create()
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('build/')
5+
->exclude('docs/')
6+
->exclude('tests/')
7+
->exclude('vendor/')
8+
->in(__DIR__);
9+
10+
$config = new PhpCsFixer\Config();
11+
$config
412
->setRiskyAllowed(true)
513
->setIndent("\t")
614
->setLineEnding("\n")
@@ -25,21 +33,13 @@
2533
'phpdoc_order' => true,
2634
'phpdoc_scalar' => true,
2735
'phpdoc_types_order' => true,
28-
'psr4' => true,
36+
'psr_autoloading' => true,
2937
'ternary_operator_spaces' => true,
3038
'ternary_to_null_coalescing' => true,
3139
'trim_array_spaces' => true,
3240
'visibility_required' => true,
3341
'whitespace_after_comma_in_array' => true,
3442
])
35-
->setFinder(
36-
PhpCsFixer\Finder::create()
37-
->exclude('build/')
38-
->exclude('docs/')
39-
->exclude('tests/')
40-
->exclude('vendor/')
41-
->in(__DIR__)
42-
)
43-
;
43+
->setFinder($finder);
4444

4545
return $config;

framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class TScaffoldInputBase
2323
{
24-
const DEFAULT_ID = 'scaffold_input';
24+
public const DEFAULT_ID = 'scaffold_input';
2525
private $_parent;
2626

2727
protected function getParent()

framework/Data/ActiveRecord/TActiveRecord.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@
149149
*/
150150
abstract class TActiveRecord extends \Prado\TComponent
151151
{
152-
const BELONGS_TO = 'BELONGS_TO';
153-
const HAS_ONE = 'HAS_ONE';
154-
const HAS_MANY = 'HAS_MANY';
155-
const MANY_TO_MANY = 'MANY_TO_MANY';
156-
157-
const STATE_NEW = 0;
158-
const STATE_LOADED = 1;
159-
const STATE_DELETED = 2;
152+
public const BELONGS_TO = 'BELONGS_TO';
153+
public const HAS_ONE = 'HAS_ONE';
154+
public const HAS_MANY = 'HAS_MANY';
155+
public const MANY_TO_MANY = 'MANY_TO_MANY';
156+
157+
public const STATE_NEW = 0;
158+
public const STATE_LOADED = 1;
159+
public const STATE_DELETED = 2;
160160

161161
/**
162162
* @var int record state: 0 = new, 1 = loaded, 2 = deleted.

framework/Data/ActiveRecord/TActiveRecordConfig.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
*/
7373
class TActiveRecordConfig extends TDataSourceConfig
7474
{
75-
const DEFAULT_MANAGER_CLASS = '\Prado\Data\ActiveRecord\TActiveRecordManager';
76-
const DEFAULT_GATEWAY_CLASS = '\Prado\Data\ActiveRecord\TActiveRecordGateway';
75+
public const DEFAULT_MANAGER_CLASS = '\Prado\Data\ActiveRecord\TActiveRecordManager';
76+
public const DEFAULT_GATEWAY_CLASS = '\Prado\Data\ActiveRecord\TActiveRecordGateway';
7777

7878
/**
7979
* Defaults to {@link TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_MANAGER_CLASS}

framework/Data/ActiveRecord/TActiveRecordGateway.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
class TActiveRecordGateway extends \Prado\TComponent
3333
{
34-
const DEFAULT_DATA_GATEWAY_CLASS = '\Prado\Data\DataGateway\TDataGatewayCommand';
34+
public const DEFAULT_DATA_GATEWAY_CLASS = '\Prado\Data\DataGateway\TDataGatewayCommand';
3535

3636
/**
3737
* Defaults to {@link TActiveRecordGateway::DEFAULT_GATEWAY_CLASS DEFAULT_GATEWAY_CLASS}
@@ -47,11 +47,11 @@ class TActiveRecordGateway extends \Prado\TComponent
4747
/**
4848
* Constant name for specifying optional table name in TActiveRecord.
4949
*/
50-
const TABLE_CONST = 'TABLE';
50+
public const TABLE_CONST = 'TABLE';
5151
/**
5252
* Method name for returning optional table name in in TActiveRecord
5353
*/
54-
const TABLE_METHOD = 'table';
54+
public const TABLE_METHOD = 'table';
5555

5656
/**
5757
* Record gateway constructor.

framework/Data/ActiveRecord/TActiveRecordInvalidFinderResult.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
*/
2929
class TActiveRecordInvalidFinderResult extends \Prado\TEnumerable
3030
{
31-
const Null = 'Null';
32-
const Exception = 'Exception';
31+
public const Null = 'Null';
32+
public const Exception = 'Exception';
3333
}

framework/Data/ActiveRecord/TActiveRecordManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
class TActiveRecordManager extends \Prado\TComponent
3737
{
38-
const DEFAULT_GATEWAY_CLASS = '\Prado\Data\ActiveRecord\TActiveRecordGateway';
38+
public const DEFAULT_GATEWAY_CLASS = '\Prado\Data\ActiveRecord\TActiveRecordGateway';
3939

4040
/**
4141
* Defaults to {@link TActiveRecordManager::DEFAULT_GATEWAY_CLASS DEFAULT_GATEWAY_CLASS}

framework/Data/Common/Mssql/TMssqlMetaData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
class TMssqlMetaData extends TDbMetaData
2828
{
29-
const DEFAULT_SCHEMA = 'dbo';
29+
public const DEFAULT_SCHEMA = 'dbo';
3030

3131
/**
3232
* @return string TDbTableInfo class name.

framework/Data/Common/TDbTableColumn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class TDbTableColumn extends \Prado\TComponent
2323
{
24-
const UNDEFINED_VALUE = INF; //use infinity for undefined value
24+
public const UNDEFINED_VALUE = INF; //use infinity for undefined value
2525

2626
private $_info = [];
2727

0 commit comments

Comments
 (0)