| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php namespace jlourenco\support\Database; |
||
| 37 | protected static function useCustomGrammar($connection) |
||
| 38 | { |
||
| 39 | // Only for MySqlGrammar |
||
| 40 | if (get_class($connection) === 'Illuminate\Database\MySqlConnection') { |
||
| 41 | $MySqlGrammar = $connection->withTablePrefix(new MySqlGrammar); |
||
| 42 | $connection->setSchemaGrammar($MySqlGrammar); |
||
|
1 ignored issue
–
show
|
|||
| 43 | } |
||
| 44 | |||
| 45 | $schema = $connection->getSchemaBuilder(); |
||
| 46 | $schema->blueprintResolver(function($table, $callback) { |
||
| 47 | return new Blueprint($table, $callback); |
||
| 48 | }); |
||
| 49 | |||
| 50 | return $schema; |
||
| 51 | } |
||
| 52 | |||
| 53 | } |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.