File tree Expand file tree Collapse file tree 4 files changed +59
-17
lines changed
src/JsonSchema/Constraints Expand file tree Collapse file tree 4 files changed +59
-17
lines changed Original file line number Diff line number Diff line change 1+ name : " PHPStan"
2+
3+ on :
4+ - push
5+ - pull_request
6+
7+ env :
8+ COMPOSER_FLAGS : " --ansi --no-interaction --no-progress --prefer-dist"
9+
10+ jobs :
11+ tests :
12+ name : " PHPStan"
13+
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - name : " Checkout"
18+ uses : " actions/checkout@v2"
19+
20+ - name : " Install PHP"
21+ uses : " shivammathur/setup-php@v2"
22+ with :
23+ coverage : " none"
24+ extensions : " intl, zip"
25+ ini-values : " memory_limit=-1"
26+ php-version : " 7.4"
27+
28+ - name : " Update dependencies"
29+ run : " composer update ${{ env.COMPOSER_FLAGS }}"
30+
31+ - name : Run PHPStan
32+ run : |
33+ composer require --dev phpstan/phpstan:^0.12.93 marc-mabe/php-enum-phpstan ${{ env.COMPOSER_FLAGS }}
34+ vendor/bin/phpstan analyse
Original file line number Diff line number Diff line change 1+ parameters :
2+ level : 1
3+ paths :
4+ - ./src/
5+ ignoreErrors : []
6+
7+ includes :
8+ - vendor/marc-mabe/php-enum-phpstan/extension.neon
Original file line number Diff line number Diff line change @@ -165,4 +165,21 @@ public static function jsonPatternToPhpRegex($pattern)
165165 {
166166 return '~ ' . str_replace ('~ ' , '\\~ ' , $ pattern ) . '~u ' ;
167167 }
168+
169+ /**
170+ * @param JsonPointer $pointer
171+ *
172+ * @return string property path
173+ */
174+ protected function convertJsonPointerIntoPropertyPath (JsonPointer $ pointer )
175+ {
176+ $ result = array_map (
177+ function ($ path ) {
178+ return sprintf (is_numeric ($ path ) ? '[%d] ' : '.%s ' , $ path );
179+ },
180+ $ pointer ->getPropertyPaths ()
181+ );
182+
183+ return trim (implode ('' , $ result ), '. ' );
184+ }
168185}
Original file line number Diff line number Diff line change @@ -215,21 +215,4 @@ protected function getTypeCheck()
215215 {
216216 return $ this ->factory ->getTypeCheck ();
217217 }
218-
219- /**
220- * @param JsonPointer $pointer
221- *
222- * @return string property path
223- */
224- protected function convertJsonPointerIntoPropertyPath (JsonPointer $ pointer )
225- {
226- $ result = array_map (
227- function ($ path ) {
228- return sprintf (is_numeric ($ path ) ? '[%d] ' : '.%s ' , $ path );
229- },
230- $ pointer ->getPropertyPaths ()
231- );
232-
233- return trim (implode ('' , $ result ), '. ' );
234- }
235218}
You can’t perform that action at this time.
0 commit comments