| Conditions | 4 |
| Paths | 8 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function toArray($request) |
||
| 18 | { |
||
| 19 | // return parent::toArray($request); |
||
| 20 | return [ |
||
| 21 | 'link_id' => $this->link_id, |
||
|
1 ignored issue
–
show
|
|||
| 22 | 'user_id' => $this->user_id, |
||
|
1 ignored issue
–
show
|
|||
| 23 | 'cust_id' => $this->cust_id, |
||
|
1 ignored issue
–
show
|
|||
| 24 | 'cust_name' => $this->cust_id ? Customers::find($this->cust_id)->name : 'None', |
||
| 25 | 'link_hash' => $this->link_hash, |
||
|
1 ignored issue
–
show
|
|||
| 26 | 'link_name' => $this->link_name, |
||
|
1 ignored issue
–
show
|
|||
| 27 | 'exp_format' => Carbon::parse($this->expire)->format('M d, Y'), |
||
|
1 ignored issue
–
show
|
|||
| 28 | 'expired' => $this->expire < Carbon::now() ? 1 : 0, |
||
| 29 | 'exp_stamp' => Carbon::parse($this->expire)->format('Y-m-d'), |
||
| 30 | 'allow_upload' => $this->allow_upload, |
||
|
1 ignored issue
–
show
|
|||
| 31 | 'file_count' => isset($this->file_link_files_count) ? $this->file_link_files_count : 0 |
||
|
1 ignored issue
–
show
|
|||
| 32 | ]; |
||
| 35 |
Let?s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let?s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: