mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 22:17:35 -05:00 
			
		
		
		
	Remove trait
This commit is contained in:
		
							parent
							
								
									bc4215a1b5
								
							
						
					
					
						commit
						cb94973bd1
					
				@ -1,31 +0,0 @@
 | 
				
			|||||||
<?php
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * Invoice Ninja (https://invoiceninja.com).
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @license https://www.elastic.co/licensing/elastic-license
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace App\Helpers\Document;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
trait WithTypeHelpers
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Returns boolean based on checks for image.
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @return bool
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public function isImage(): bool
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (in_array($this->type, ['png', 'jpeg', 'jpg', 'tiff', 'gif'])) {
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return false;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -64,7 +64,6 @@ class Document extends BaseModel
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    use SoftDeletes;
 | 
					    use SoftDeletes;
 | 
				
			||||||
    use Filterable;
 | 
					    use Filterable;
 | 
				
			||||||
    use WithTypeHelpers;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const DOCUMENT_PREVIEW_SIZE = 300; // pixels
 | 
					    const DOCUMENT_PREVIEW_SIZE = 300; // pixels
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -234,4 +233,18 @@ class Document extends BaseModel
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns boolean based on checks for image.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return bool
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function isImage(): bool
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (in_array($this->type, ['png', 'jpeg', 'jpg', 'tiff', 'gif'])) {
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user