mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	Use instanceof instead of method is_a
Since is_a is a method, it is significantly slower than using instanceof Following is a perfomance comparison: http://micro-optimization.com/is_a-vs-instanceof
This commit is contained in:
		
							parent
							
								
									5199a915b6
								
							
						
					
					
						commit
						8ae83cbabd
					
				@ -59,7 +59,7 @@ class Factory
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        $instance = new $className($taskConfig, $inRollback, $stage, $taskParameters);
 | 
					        $instance = new $className($taskConfig, $inRollback, $stage, $taskParameters);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!is_a($instance, 'Mage\Task\AbstractTask')) {
 | 
					        if (!($instance instanceof AbstractTask)) {
 | 
				
			||||||
            throw new Exception('The Task ' . $taskName . ' must be an instance of Mage\Task\AbstractTask.');
 | 
					            throw new Exception('The Task ' . $taskName . ' must be an instance of Mage\Task\AbstractTask.');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user