1 | <?php |
||
15 | |||
16 | config([ |
||
17 | 'database.default' => 'mysql_sync', |
||
18 | ]); |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Dump `sync` database into a SQL file and return its path. |
||
23 | * |
||
24 | * @param boolean $isPreview |
||
25 | * @return string |
||
26 | */ |
||
27 | View Code Duplication | protected function dumpSync(bool $isPreview, string $connector = 'mysql'): string |
|
41 | |||
42 | /** |
||
43 | * Dump SQL database in given file path. |
||
44 | * |
||
45 | * @param string $path |
||
46 | * @param string $connector |
||
47 | * @return void |
||
48 | */ |
||
49 | View Code Duplication | protected function dumpSql(string $path, string $connector) |
|
64 | |||
65 | protected function getConnector(bool $isPreview, string $connector = 'mysql'): string |
||
75 | |||
76 | |||
77 | /** |
||
78 | * Put previous dump in live-preview database. |
||
79 | * |
||
80 | * @param string $path |
||
81 | * @param boolean $isPreview |
||
82 | * @return void |
||
83 | */ |
||
84 | protected function putSync(string $path, bool $isPreview, string $connector = 'mysql') |
||
95 | |||
96 | /** |
||
97 | * Put SQL file into given database. |
||
98 | * |
||
99 | * @param string $path |
||
100 | * @param string $connector |
||
101 | * @return void |
||
102 | */ |
||
103 | View Code Duplication | protected function putSql(string $path, string $connector) |
|
118 | } |
||
119 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.