File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -569,6 +569,8 @@ public static function isAscii($value)
569569 *
570570 * @param mixed $value
571571 * @return bool
572+ *
573+ * @phpstan-assert-if-true =non-empty-string $value
572574 */
573575 public static function isJson ($ value )
574576 {
@@ -585,6 +587,8 @@ public static function isJson($value)
585587 * @param mixed $value
586588 * @param array $protocols
587589 * @return bool
590+ *
591+ * @phpstan-assert-if-true =non-empty-string $value
588592 */
589593 public static function isUrl ($ value , array $ protocols = [])
590594 {
@@ -628,6 +632,8 @@ public static function isUrl($value, array $protocols = [])
628632 * @param mixed $value
629633 * @param int<0, 8>|'nil'|'max'|null $version
630634 * @return bool
635+ *
636+ * @phpstan-assert-if-true =non-empty-string $value
631637 */
632638 public static function isUuid ($ value , $ version = null )
633639 {
@@ -669,6 +675,8 @@ public static function isUuid($value, $version = null)
669675 *
670676 * @param mixed $value
671677 * @return bool
678+ *
679+ * @phpstan-assert-if-true =non-empty-string $value
672680 */
673681 public static function isUlid ($ value )
674682 {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate \Support \Str ;
4+
5+ use function PHPStan \Testing \assertType ;
6+
7+ /**
8+ * @var mixed $json
9+ * @var mixed $ulid
10+ * @var mixed $url
11+ * @var mixed $uuid
12+ */
13+ if (Str::isJson ($ json )) {
14+ assertType ('non-empty-string ' , $ json );
15+ } else {
16+ assertType ('mixed ' , $ json );
17+ }
18+
19+ if (Str::isUlid ($ ulid )) {
20+ assertType ('non-empty-string ' , $ ulid );
21+ } else {
22+ assertType ('mixed ' , $ ulid );
23+ }
24+
25+ if (Str::isUrl ($ url )) {
26+ assertType ('non-empty-string ' , $ url );
27+ } else {
28+ assertType ('mixed ' , $ url );
29+ }
30+
31+ if (Str::isUuid ($ uuid )) {
32+ assertType ('non-empty-string ' , $ uuid );
33+ } else {
34+ assertType ('mixed ' , $ uuid );
35+ }
You can’t perform that action at this time.
0 commit comments