Skip to content

Commit 8c1fe74

Browse files
committed
Add types on constants
1 parent 508f6d8 commit 8c1fe74

11 files changed

Lines changed: 75 additions & 75 deletions

File tree

lib/GaletteObjectsLend/Entity/CategoryPicture.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
*/
3232
class CategoryPicture extends Picture
3333
{
34-
public const PK = 'category_id';
35-
public const TABLE = 'categories_pictures';
34+
public const string PK = 'category_id';
35+
public const string TABLE = 'categories_pictures';
3636

3737
/**
3838
* Default constructor.

lib/GaletteObjectsLend/Entity/LendCategory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
*/
4242
class LendCategory
4343
{
44-
public const TABLE = 'category';
45-
public const PK = 'category_id';
44+
public const string TABLE = 'category';
45+
public const string PK = 'category_id';
4646

4747
/** @var array<string> */
4848
private array $fields = [

lib/GaletteObjectsLend/Entity/LendObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
*/
6363
class LendObject
6464
{
65-
public const TABLE = 'objects';
66-
public const PK = 'object_id';
65+
public const string TABLE = 'objects';
66+
public const string PK = 'object_id';
6767

6868
/** @var array<string,string> */
6969
private array $fields = [

lib/GaletteObjectsLend/Entity/LendRent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
*/
5252
class LendRent
5353
{
54-
public const TABLE = 'rents';
55-
public const PK = 'rent_id';
54+
public const string TABLE = 'rents';
55+
public const string PK = 'rent_id';
5656

5757
/** @var array<string, string> */
5858
private array $fields = [

lib/GaletteObjectsLend/Entity/LendStatus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
*/
4242
class LendStatus
4343
{
44-
public const TABLE = 'status';
45-
public const PK = 'status_id';
44+
public const string TABLE = 'status';
45+
public const string PK = 'status_id';
4646

4747
private Db $zdb;
4848

lib/GaletteObjectsLend/Entity/ObjectPicture.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
*/
3232
class ObjectPicture extends Picture
3333
{
34-
public const PK = 'object_id';
35-
public const TABLE = 'pictures';
34+
public const string PK = 'object_id';
35+
public const string TABLE = 'pictures';
3636

3737
/**
3838
* Default constructor.

lib/GaletteObjectsLend/Entity/Preferences.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
*/
5252
class Preferences
5353
{
54-
public const TABLE = 'parameters';
55-
public const PK = 'code';
54+
public const string TABLE = 'parameters';
55+
public const string PK = 'code';
5656

5757
private Db $zdb;
5858
/** @var array<string,mixed> */
@@ -62,97 +62,97 @@ class Preferences
6262
* Show categories at the top of the objects list
6363
* Valeur : 0 = false / 1 = true
6464
*/
65-
public const PARAM_VIEW_CATEGORY = 'VIEW_CATEGORY';
65+
public const string PARAM_VIEW_CATEGORY = 'VIEW_CATEGORY';
6666

6767
/**
6868
* Show serial number column
6969
* Valeur : 0 = false / 1 = true
7070
*/
71-
public const PARAM_VIEW_SERIAL = 'VIEW_SERIAL';
71+
public const string PARAM_VIEW_SERIAL = 'VIEW_SERIAL';
7272

7373
/**
7474
* Show thumbnail column
7575
* Valeur : 0 = false / 1 = true
7676
*/
77-
public const PARAM_VIEW_THUMBNAIL = 'VIEW_THUMBNAIL';
77+
public const string PARAM_VIEW_THUMBNAIL = 'VIEW_THUMBNAIL';
7878

7979
/**
8080
* Show description column
8181
* Valeur : 0 = false / 1 = true
8282
*/
83-
public const PARAM_VIEW_DESCRIPTION = 'VIEW_DESCRIPTION';
83+
public const string PARAM_VIEW_DESCRIPTION = 'VIEW_DESCRIPTION';
8484

8585
/**
8686
* Show price column
8787
* Valeur : 0 = false / 1 = true
8888
*/
89-
public const PARAM_VIEW_PRICE = 'VIEW_PRICE';
89+
public const string PARAM_VIEW_PRICE = 'VIEW_PRICE';
9090

9191
/**
9292
* Show dimensions column
9393
* Valeur : 0 = false / 1 = true
9494
*/
95-
public const PARAM_VIEW_DIMENSION = 'VIEW_DIMENSION';
95+
public const string PARAM_VIEW_DIMENSION = 'VIEW_DIMENSION';
9696

9797
/**
9898
* Show weight column
9999
* Valeur : 0 = false / 1 = true
100100
*/
101-
public const PARAM_VIEW_WEIGHT = 'VIEW_WEIGHT';
101+
public const string PARAM_VIEW_WEIGHT = 'VIEW_WEIGHT';
102102

103103
/**
104104
* Show rent price column
105105
* Valeur : 0 = false / 1 = true
106106
*/
107-
public const PARAM_VIEW_LEND_PRICE = 'VIEW_LEND_PRICE';
107+
public const string PARAM_VIEW_LEND_PRICE = 'VIEW_LEND_PRICE';
108108

109109
/**
110110
* Show previsional return date column
111111
* Valeur : 0 = false / 1 = true
112112
*/
113-
public const PARAM_VIEW_DATE_FORECAST = 'VIEW_DATE_FORECAST';
113+
public const string PARAM_VIEW_DATE_FORECAST = 'VIEW_DATE_FORECAST';
114114

115115
/**
116116
* Show the sum of prices on the list of objects
117117
* Valeur : 0 = false / 1 = true
118118
*/
119-
public const PARAM_VIEW_LIST_PRICE_SUM = 'VIEW_LIST_PRICE_SUM';
119+
public const string PARAM_VIEW_LIST_PRICE_SUM = 'VIEW_LIST_PRICE_SUM';
120120

121121
/**
122122
* Maximum width of a thumbnail (applied to objects/categories)
123123
* Valeur : largeur en pixels
124124
*/
125-
public const PARAM_THUMB_MAX_WIDTH = 'THUMB_MAX_WIDTH';
125+
public const string PARAM_THUMB_MAX_WIDTH = 'THUMB_MAX_WIDTH';
126126

127127
/**
128128
* Maximum height of a thumbnail (applied to objects/categories)
129129
* Valeur : largeur en pixels
130130
*/
131-
public const PARAM_THUMB_MAX_HEIGHT = 'THUMB_MAX_HEIGHT';
131+
public const string PARAM_THUMB_MAX_HEIGHT = 'THUMB_MAX_HEIGHT';
132132

133133
/**
134134
* Generate automatically a contribution when an object is rented
135135
* Valeur : 0 = false / 1 = true
136136
*/
137-
public const PARAM_AUTO_GENERATE_CONTRIBUTION = 'AUTO_GENERATE_CONTRIBUTION';
137+
public const string PARAM_AUTO_GENERATE_CONTRIBUTION = 'AUTO_GENERATE_CONTRIBUTION';
138138

139139
/**
140140
* Contribution ID to generate when an object is rented
141141
* Valeur : ID du type de contribution
142142
*/
143-
public const PARAM_GENERATED_CONTRIBUTION_TYPE_ID = 'GENERATED_CONTRIBUTION_TYPE_ID';
143+
public const string PARAM_GENERATED_CONTRIBUTION_TYPE_ID = 'GENERATED_CONTRIBUTION_TYPE_ID';
144144

145145
/**
146146
* Text for the contribution
147147
* Valeur : texte d'info à mettre avec des placeholders à remplacer
148148
*/
149-
public const PARAM_GENERATED_CONTRIB_INFO_TEXT = 'GENERATED_CONTRIB_INFO_TEXT';
149+
public const string PARAM_GENERATED_CONTRIB_INFO_TEXT = 'GENERATED_CONTRIB_INFO_TEXT';
150150

151151
/**
152152
* Allow non staff members to rent objects
153153
* Valeur : 0 = false / 1 = true
154154
*/
155-
public const PARAM_ENABLE_MEMBER_RENT_OBJECT = 'ENABLE_MEMBER_RENT_OBJECT';
155+
public const string PARAM_ENABLE_MEMBER_RENT_OBJECT = 'ENABLE_MEMBER_RENT_OBJECT';
156156

157157
/**
158158
* Default constructor

lib/GaletteObjectsLend/IO/PdfObjects.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*/
4040
class PdfObjects extends Pdf
4141
{
42-
public const LIST_FONT = self::FONT_SIZE - 2;
42+
public const int LIST_FONT = self::FONT_SIZE - 2;
4343

4444
private Db $zdb;
4545
private LendPreferences $lendsprefs;

lib/GaletteObjectsLend/Repository/Categories.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@
4242
*/
4343
class Categories
4444
{
45-
public const TABLE = LendCategory::TABLE;
46-
public const PK = LendCategory::PK;
45+
public const string TABLE = LendCategory::TABLE;
46+
public const string PK = LendCategory::PK;
4747

48-
public const ALL_CATEGORIES = 0;
49-
public const ACTIVE_CATEGORIES = 1;
50-
public const INACTIVE_CATEGORIES = 2;
48+
public const int ALL_CATEGORIES = 0;
49+
public const int ACTIVE_CATEGORIES = 1;
50+
public const int INACTIVE_CATEGORIES = 2;
5151

52-
public const FILTER_NAME = 0;
52+
public const int FILTER_NAME = 0;
5353

54-
public const ORDERBY_NAME = 0;
55-
public const ORDERBY_ACTIVITY = 1;
54+
public const int ORDERBY_NAME = 0;
55+
public const int ORDERBY_ACTIVITY = 1;
5656

5757
private CategoriesList $filters;
5858
private ?int $count = null;

lib/GaletteObjectsLend/Repository/Objects.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,28 @@
4343
*/
4444
class Objects
4545
{
46-
public const TABLE = LendObject::TABLE;
47-
public const PK = LendObject::PK;
48-
49-
public const ALL_OBJECTS = 0;
50-
public const ACTIVE_OBJECTS = 1;
51-
public const INACTIVE_OBJECTS = 2;
52-
53-
public const FILTER_NAME = 0;
54-
public const FILTER_SERIAL = 1;
55-
public const FILTER_DIM = 2;
56-
public const FILTER_ID = 3;
57-
58-
public const ORDERBY_NAME = 0;
59-
public const ORDERBY_SERIAL = 1;
60-
public const ORDERBY_PRICE = 2;
61-
public const ORDERBY_RENTPRICE = 3;
62-
public const ORDERBY_WEIGHT = 4;
63-
public const ORDERBY_STATUS = 5;
64-
public const ORDERBY_BDATE = 6;
65-
public const ORDERBY_FDATE = 7;
66-
public const ORDERBY_MEMBER = 8;
67-
public const ORDERBY_CATEGORY = 9;
46+
public const string TABLE = LendObject::TABLE;
47+
public const string PK = LendObject::PK;
48+
49+
public const int ALL_OBJECTS = 0;
50+
public const int ACTIVE_OBJECTS = 1;
51+
public const int INACTIVE_OBJECTS = 2;
52+
53+
public const int FILTER_NAME = 0;
54+
public const int FILTER_SERIAL = 1;
55+
public const int FILTER_DIM = 2;
56+
public const int FILTER_ID = 3;
57+
58+
public const int ORDERBY_NAME = 0;
59+
public const int ORDERBY_SERIAL = 1;
60+
public const int ORDERBY_PRICE = 2;
61+
public const int ORDERBY_RENTPRICE = 3;
62+
public const int ORDERBY_WEIGHT = 4;
63+
public const int ORDERBY_STATUS = 5;
64+
public const int ORDERBY_BDATE = 6;
65+
public const int ORDERBY_FDATE = 7;
66+
public const int ORDERBY_MEMBER = 8;
67+
public const int ORDERBY_CATEGORY = 9;
6868

6969
private Db $zdb;
7070

0 commit comments

Comments
 (0)