Skip to content

Commit 0799392

Browse files
committed
Releasing 1.0.2
2 parents 43f1cd4 + e019083 commit 0799392

File tree

10 files changed

+260
-23
lines changed

10 files changed

+260
-23
lines changed

.buildpath

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<buildpath>
3+
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
4+
<buildpathentry kind="src" path="src/TgLog">
5+
<attributes>
6+
<attribute name="composer" value="source"/>
7+
</attributes>
8+
</buildpathentry>
9+
<buildpathentry kind="src" path="src/TgUtils">
10+
<attributes>
11+
<attribute name="composer" value="source"/>
12+
</attributes>
13+
</buildpathentry>
14+
<buildpathentry kind="src" path="vendor/composer">
15+
<attributes>
16+
<attribute name="composer" value="vendor"/>
17+
</attributes>
18+
</buildpathentry>
19+
<buildpathentry kind="src" path="vendor/doctrine/instantiator/src/Doctrine/Instantiator">
20+
<attributes>
21+
<attribute name="composer" value="vendor"/>
22+
</attributes>
23+
</buildpathentry>
24+
<buildpathentry kind="src" path="vendor/myclabs/deep-copy/src/DeepCopy">
25+
<attributes>
26+
<attribute name="composer" value="vendor"/>
27+
</attributes>
28+
</buildpathentry>
29+
<buildpathentry kind="src" path="vendor/nikic/php-parser/lib/PhpParser">
30+
<attributes>
31+
<attribute name="composer" value="vendor"/>
32+
</attributes>
33+
</buildpathentry>
34+
<buildpathentry kind="src" path="vendor/phar-io/manifest/src">
35+
<attributes>
36+
<attribute name="composer" value="vendor"/>
37+
</attributes>
38+
</buildpathentry>
39+
<buildpathentry kind="src" path="vendor/phar-io/version/src">
40+
<attributes>
41+
<attribute name="composer" value="vendor"/>
42+
</attributes>
43+
</buildpathentry>
44+
<buildpathentry kind="src" path="vendor/phpdocumentor/reflection-common/src">
45+
<attributes>
46+
<attribute name="composer" value="vendor"/>
47+
</attributes>
48+
</buildpathentry>
49+
<buildpathentry kind="src" path="vendor/phpdocumentor/reflection-docblock/src">
50+
<attributes>
51+
<attribute name="composer" value="vendor"/>
52+
</attributes>
53+
</buildpathentry>
54+
<buildpathentry kind="src" path="vendor/phpdocumentor/type-resolver/src">
55+
<attributes>
56+
<attribute name="composer" value="vendor"/>
57+
</attributes>
58+
</buildpathentry>
59+
<buildpathentry kind="src" path="vendor/phpspec/prophecy/src/Prophecy">
60+
<attributes>
61+
<attribute name="composer" value="vendor"/>
62+
</attributes>
63+
</buildpathentry>
64+
<buildpathentry kind="src" path="vendor/phpunit/php-code-coverage/src">
65+
<attributes>
66+
<attribute name="composer" value="vendor"/>
67+
</attributes>
68+
</buildpathentry>
69+
<buildpathentry kind="src" path="vendor/phpunit/php-file-iterator/src">
70+
<attributes>
71+
<attribute name="composer" value="vendor"/>
72+
</attributes>
73+
</buildpathentry>
74+
<buildpathentry kind="src" path="vendor/phpunit/php-invoker/src">
75+
<attributes>
76+
<attribute name="composer" value="vendor"/>
77+
</attributes>
78+
</buildpathentry>
79+
<buildpathentry kind="src" path="vendor/phpunit/php-text-template/src">
80+
<attributes>
81+
<attribute name="composer" value="vendor"/>
82+
</attributes>
83+
</buildpathentry>
84+
<buildpathentry kind="src" path="vendor/phpunit/php-timer/src">
85+
<attributes>
86+
<attribute name="composer" value="vendor"/>
87+
</attributes>
88+
</buildpathentry>
89+
<buildpathentry excluding="Framework/Assert/" kind="src" path="vendor/phpunit/phpunit/src">
90+
<attributes>
91+
<attribute name="composer" value="vendor"/>
92+
</attributes>
93+
</buildpathentry>
94+
<buildpathentry kind="src" path="vendor/phpunit/phpunit/src/Framework/Assert">
95+
<attributes>
96+
<attribute name="composer" value="vendor"/>
97+
</attributes>
98+
</buildpathentry>
99+
<buildpathentry kind="src" path="vendor/sebastian/cli-parser/src">
100+
<attributes>
101+
<attribute name="composer" value="vendor"/>
102+
</attributes>
103+
</buildpathentry>
104+
<buildpathentry kind="src" path="vendor/sebastian/code-unit-reverse-lookup/src">
105+
<attributes>
106+
<attribute name="composer" value="vendor"/>
107+
</attributes>
108+
</buildpathentry>
109+
<buildpathentry kind="src" path="vendor/sebastian/code-unit/src">
110+
<attributes>
111+
<attribute name="composer" value="vendor"/>
112+
</attributes>
113+
</buildpathentry>
114+
<buildpathentry kind="src" path="vendor/sebastian/comparator/src">
115+
<attributes>
116+
<attribute name="composer" value="vendor"/>
117+
</attributes>
118+
</buildpathentry>
119+
<buildpathentry kind="src" path="vendor/sebastian/complexity/src">
120+
<attributes>
121+
<attribute name="composer" value="vendor"/>
122+
</attributes>
123+
</buildpathentry>
124+
<buildpathentry kind="src" path="vendor/sebastian/diff/src">
125+
<attributes>
126+
<attribute name="composer" value="vendor"/>
127+
</attributes>
128+
</buildpathentry>
129+
<buildpathentry kind="src" path="vendor/sebastian/environment/src">
130+
<attributes>
131+
<attribute name="composer" value="vendor"/>
132+
</attributes>
133+
</buildpathentry>
134+
<buildpathentry kind="src" path="vendor/sebastian/exporter/src">
135+
<attributes>
136+
<attribute name="composer" value="vendor"/>
137+
</attributes>
138+
</buildpathentry>
139+
<buildpathentry kind="src" path="vendor/sebastian/global-state/src">
140+
<attributes>
141+
<attribute name="composer" value="vendor"/>
142+
</attributes>
143+
</buildpathentry>
144+
<buildpathentry kind="src" path="vendor/sebastian/lines-of-code/src">
145+
<attributes>
146+
<attribute name="composer" value="vendor"/>
147+
</attributes>
148+
</buildpathentry>
149+
<buildpathentry kind="src" path="vendor/sebastian/object-enumerator/src">
150+
<attributes>
151+
<attribute name="composer" value="vendor"/>
152+
</attributes>
153+
</buildpathentry>
154+
<buildpathentry kind="src" path="vendor/sebastian/object-reflector/src">
155+
<attributes>
156+
<attribute name="composer" value="vendor"/>
157+
</attributes>
158+
</buildpathentry>
159+
<buildpathentry kind="src" path="vendor/sebastian/recursion-context/src">
160+
<attributes>
161+
<attribute name="composer" value="vendor"/>
162+
</attributes>
163+
</buildpathentry>
164+
<buildpathentry kind="src" path="vendor/sebastian/resource-operations/src">
165+
<attributes>
166+
<attribute name="composer" value="vendor"/>
167+
</attributes>
168+
</buildpathentry>
169+
<buildpathentry kind="src" path="vendor/sebastian/type/src">
170+
<attributes>
171+
<attribute name="composer" value="vendor"/>
172+
</attributes>
173+
</buildpathentry>
174+
<buildpathentry kind="src" path="vendor/sebastian/version/src">
175+
<attributes>
176+
<attribute name="composer" value="vendor"/>
177+
</attributes>
178+
</buildpathentry>
179+
<buildpathentry kind="src" path="vendor/symfony/polyfill-ctype">
180+
<attributes>
181+
<attribute name="composer" value="vendor"/>
182+
</attributes>
183+
</buildpathentry>
184+
<buildpathentry kind="src" path="vendor/technicalguru/i18n/src/TgI18n">
185+
<attributes>
186+
<attribute name="composer" value="vendor"/>
187+
</attributes>
188+
</buildpathentry>
189+
<buildpathentry kind="src" path="vendor/theseer/tokenizer/src">
190+
<attributes>
191+
<attribute name="composer" value="vendor"/>
192+
</attributes>
193+
</buildpathentry>
194+
<buildpathentry kind="src" path="vendor/webmozart/assert/src">
195+
<attributes>
196+
<attribute name="composer" value="vendor"/>
197+
</attributes>
198+
</buildpathentry>
199+
</buildpath>

.project

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,29 @@
55
<projects>
66
</projects>
77
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.php.composer.core.builder.buildPathManagementBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.validation.validationbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.dltk.core.scriptbuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
828
</buildSpec>
929
<natures>
30+
<nature>org.eclipse.php.core.PHPNature</nature>
31+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
1032
</natures>
1133
</projectDescription>

.settings/org.eclipse.php.core.prefs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
include_path=0;/php-utils/src
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<fixed facet="php.component"/>
4+
<fixed facet="php.core.component"/>
5+
<installed facet="php.core.component" version="1"/>
6+
<installed facet="php.component" version="7.4"/>
7+
<installed facet="php.composer.component" version="1"/>
8+
</faceted-project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disabled=06vendor
2+
eclipse.preferences.version=1

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
],
1515
"require" : {
1616
"php" : ">=7.0.0",
17-
"technicalguru/i18n": "^1"
17+
"technicalguru/i18n" : "~1"
1818
},
1919
"autoload" : {
2020
"psr-4" : {

src/TgLog/Log.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
*/
1313
class Log {
1414

15-
public static const NONE = 'none';
16-
public static const DEBUG = 'debug';
17-
public static const INFO = 'info';
18-
public static const WARN = 'warn';
19-
public static const ERROR = 'error';
15+
public const NONE = 'none';
16+
public const DEBUG = 'debug';
17+
public const INFO = 'info';
18+
public const WARN = 'warn';
19+
public const ERROR = 'error';
2020

2121
/** The available log priorities */
2222
protected static $logPriorities;
@@ -35,7 +35,7 @@ class Log {
3535
*/
3636
public static function instance() {
3737
if (self::$logLevel == null) {
38-
self::$logLevel == INFO;
38+
self::$logLevel == self::INFO;
3939
}
4040
if (self::$instance == null) {
4141
self::$instance = new Log();
@@ -109,7 +109,7 @@ public function getStackTrace($excludeFile = NULL) {
109109
* @param mixed $o - an oject to be dumped along with message. An Exception object will cause a stacktrace dump (optional).
110110
*/
111111
public static function debug($s, $o = null) {
112-
self::instance()->log(DEBUG, $s, $o);
112+
self::instance()->log(self::DEBUG, $s, $o);
113113
}
114114

115115
/**
@@ -118,7 +118,7 @@ public static function debug($s, $o = null) {
118118
* @param mixed $o - an oject to be dumped along with message. An Exception object will cause a stacktrace dump (optional).
119119
*/
120120
public static function info($s, $o = null) {
121-
self::instance()->log(INFO, $s, $o);
121+
self::instance()->log(self::INFO, $s, $o);
122122
}
123123

124124
/**
@@ -127,7 +127,7 @@ public static function info($s, $o = null) {
127127
* @param mixed $o - an oject to be dumped along with message. An Exception object will cause a stacktrace dump (optional).
128128
*/
129129
public static function warn($s, $o = null) {
130-
self::instance()->log(WARN, $s, $o);
130+
self::instance()->log(self::WARN, $s, $o);
131131
}
132132

133133
/**
@@ -136,39 +136,39 @@ public static function warn($s, $o = null) {
136136
* @param mixed $o - an oject to be dumped along with message. An Exception object will cause a stacktrace dump (optional).
137137
*/
138138
public static function error($s, $o = null) {
139-
self::instance()->log(ERROR, $s, $o);
139+
self::instance()->log(self::ERROR, $s, $o);
140140
}
141141

142142
/**
143143
* Print stacktrace into debug log, optionally excluding a certain file from trace.
144144
* @param string $excludeFile - the file to be excluded (optional).
145145
*/
146146
public static function debugStackTrace($excludeFile = NULL) {
147-
self::instance()->logStackTrace(DEBUG, $excludeFile);
147+
self::instance()->logStackTrace(self::DEBUG, $excludeFile);
148148
}
149149

150150
/**
151151
* Print stacktrace into info log, optionally excluding a certain file from trace.
152152
* @param string $excludeFile - the file to be excluded (optional).
153153
*/
154154
public static function infoStackTrace($excludeFile = NULL) {
155-
self::instance()->logStackTrace(INFO, $excludeFile);
155+
self::instance()->logStackTrace(self::INFO, $excludeFile);
156156
}
157157

158158
/**
159159
* Print stacktrace into warning log, optionally excluding a certain file from trace.
160160
* @param string $excludeFile - the file to be excluded (optional).
161161
*/
162162
public static function warnStackTrace($excludeFile = NULL) {
163-
self::instance()->logStackTrace(WARN, $excludeFile);
163+
self::instance()->logStackTrace(self::WARN, $excludeFile);
164164
}
165165

166166
/**
167167
* Print stacktrace into error log, optionally excluding a certain file from trace.
168168
* @param string $excludeFile - the file to be excluded (optional).
169169
*/
170170
public static function errorStackTrace($excludeFile = NULL) {
171-
self::instance()->logStackTrace(ERROR, $excludeFile);
171+
self::instance()->logStackTrace(self::ERROR, $excludeFile);
172172
}
173173

174174
/**
@@ -216,7 +216,7 @@ public static function get() {
216216
*/
217217
protected static function isLogLevelIncluded($sev) {
218218
if (self::$logPriorities == null) {
219-
self::$logPriorities = array(NONE, DEBUG, INFO, WARN, ERROR);
219+
self::$logPriorities = array(self::NONE, self::DEBUG, self::INFO, self::WARN, self::ERROR);
220220
}
221221
$logIndex = array_search(self::$logLevel, self::$logPriorities);
222222
$sevIndex = array_search($sev, self::$logPriorities);

src/TgUtils/Date.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
namespace TgUtils;
1010

11-
\TgI18n\I18N::addI18nFile(__DIR__.'/../date_i18n.php', FALSE);
11+
use \TgI18n\I18N;
12+
13+
I18N::addI18nFile(__DIR__.'/../date_i18n.php', FALSE);
1214

1315
/**
1416
* Date is a class that stores a date and provides logic to manipulate
@@ -60,7 +62,7 @@ class Date extends \DateTime {
6062
/**
6163
* The DateTimeZone object for usage in rending dates as strings.
6264
*
63-
* @var DateTimeZone
65+
* @var \DateTimeZone
6466
*/
6567
protected $tz;
6668

@@ -349,7 +351,7 @@ public function monthToString($month, $abbr = false, $language = null) {
349351
/**
350352
* Method to wrap the setTimezone() function and set the internal time zone object.
351353
*
352-
* @param DateTimeZone $tz The new DateTimeZone object.
354+
* @param \DateTimeZone $tz The new DateTimeZone object.
353355
*
354356
* @return Date
355357
*

src/TgUtils/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function getHeader($key) {
228228
* @param string $key - the parameter name.
229229
* @param mixed $default - the default value when not found (optional, default is NULL)
230230
* @param boolean $getPrecedes - TRUE when GET parameter shall be returned even when POST parameter is given. (optional, default is TRUE).
231-
* @return the parameter value or its default.
231+
* @return string the parameter value or its default.
232232
*/
233233
public function getParam($key, $default = NULL, $getPrecedes = true) {
234234
$rc = $getPrecedes ? $this->getGetParam($key) : $this->getPostParam($key);

0 commit comments

Comments
 (0)