File tree Expand file tree Collapse file tree 5 files changed +13
-7
lines changed Expand file tree Collapse file tree 5 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ includes:
77- vendor/phpstan/phpstan-phpunit/rules.neon 
88parameters : 
99  #  TODO level up to max
10-   level :  2 
10+   level :  3 
1111  paths : 
1212  - src 
1313  - tests 
Original file line number Diff line number Diff line change @@ -19,22 +19,25 @@ public function test_can_set_model_value_using_enum_instance()
1919    public  function  test_can_set_model_value_using_enum_value ()
2020    {
2121        $ modelnew  Example ;
22+         // @phpstan-ignore-next-line loose typing 
2223        $ modeluser_type  = UserType::Moderator;
2324
2425        $ this assertEquals (UserType::Moderator (), $ modeluser_type );
2526    }
2627
2728    public  function  test_cannot_set_model_value_using_invalid_enum_value ()
2829    {
29-         $ this expectException (InvalidEnumMemberException::class);
30- 
3130        $ modelnew  Example ;
31+ 
32+         $ this expectException (InvalidEnumMemberException::class);
33+         // @phpstan-ignore-next-line intentionally wrong 
3234        $ modeluser_type  = 5 ;
3335    }
3436
3537    public  function  test_getting_model_value_returns_enum_instance ()
3638    {
3739        $ modelnew  Example ;
40+         // @phpstan-ignore-next-line loose typing 
3841        $ modeluser_type  = UserType::Moderator;
3942
4043        $ this assertInstanceOf (UserType::class, $ modeluser_type );
Original file line number Diff line number Diff line change 66use  Illuminate \Database \Eloquent \Model ;
77
88/** 
9-  * @property UserType $user_type 
9+  * @property UserType|null  $user_type 
1010 */ 
1111class  Example extends  Model
1212{
Original file line number Diff line number Diff line change 77use  Illuminate \Database \Eloquent \Model ;
88
99/** 
10-  * @property UserType $user_type 
10+  * @property UserType|null  $user_type 
1111 * @property UserTypeCustomCast $user_type_custom 
1212 */ 
1313class  NativeCastModel extends  Model
Original file line number Diff line number Diff line change @@ -21,22 +21,25 @@ public function test_can_set_model_value_using_enum_instance()
2121    public  function  test_can_set_model_value_using_enum_value ()
2222    {
2323        $ modelnew  NativeCastModel ;
24+         // @phpstan-ignore-next-line loose typing 
2425        $ modeluser_type  = UserType::Moderator;
2526
2627        $ this assertEquals (UserType::Moderator (), $ modeluser_type );
2728    }
2829
2930    public  function  test_cannot_set_model_value_using_invalid_enum_value ()
3031    {
31-         $ this expectException (InvalidEnumMemberException::class);
32- 
3332        $ modelnew  NativeCastModel ;
33+ 
34+         $ this expectException (InvalidEnumMemberException::class);
35+         // @phpstan-ignore-next-line intentionally wrong 
3436        $ modeluser_type  = 5 ;
3537    }
3638
3739    public  function  test_getting_model_value_returns_enum_instance ()
3840    {
3941        $ modelnew  NativeCastModel ;
42+         // @phpstan-ignore-next-line loose typing 
4043        $ modeluser_type  = UserType::Moderator;
4144
4245        $ this assertInstanceOf (UserType::class, $ modeluser_type );
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments